Skip to content

chore: harden CI/CD against supply-chain attacks #162

@sasagar

Description

@sasagar

Background

直近で shai-hulud npm worm、tj-actions/changed-files の compromise、nx/chalk/debug の悪性版配布など、サプライチェーン攻撃が連続的に発生している。Rox の CI/CD と依存管理を堅牢化する。

Goals

  • GitHub Actions の SHA 固定で改ざんされた tag 経由の侵入を防止
  • bun install の厳格化で lockfile 整合性を担保
  • ワークフローのデフォルト権限を最小化
  • 新規依存と既知 CVE の検査を PR 必須化
  • Actions 自体のバージョン更新を Dependabot で自動化

Scope

.github/workflows/*.yml

  • サードパーティ Actions を commit SHA に固定(oven-sh/setup-bun, softprops/action-gh-release
  • GitHub 公式 Actions も SHA 固定(ポリシー統一)
  • bun-version: latest を具体バージョン(1.3.14)に固定
  • bun install --frozen-lockfile を CI で強制
  • CI の GITHUB_TOKENcontents: read 既定化
  • Dependency Review job を PR チェックに追加

.github/dependabot.yml

  • package-ecosystem: github-actions を追加し週次更新
  • package-ecosystem: npm を root と各 package で追加(既存ならスキップ)

Out of scope

  • Sigstore/cosign 署名と build provenance(次フェーズ)
  • 本番 host の egress allowlist(運用領域)

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions