Skip to content

security: Actions/Docker/依存の固定(提案・自動生成) - #441

Draft
kaitoyama wants to merge 1 commit into
mainfrom
security/supply-chain-hardening
Draft

security: Actions/Docker/依存の固定(提案・自動生成)#441
kaitoyama wants to merge 1 commit into
mainfrom
security/supply-chain-hardening

Conversation

@kaitoyama

Copy link
Copy Markdown

Important

これは自動生成された「対応提案」PR です。
CI/サプライチェーンのハードニングを進めやすくするために機械的に変更を加えています。
変更内容が正しいか・CI が通るかは必ずメンテナご自身でご確認ください。 誤検出や、このリポジトリの文脈では不要な変更が含まれている可能性があります。不要なものは部分的に revert/close いただいて構いません。

traPtitech org 全体のセキュリティ監査に基づく提案です。

適用した変更

✅ GitHub Actions を commit SHA で固定(49 箇所)

タグ(@v6 等)は可変で付け替えられ得るため、不変な commit SHA に固定しました。# vX コメントを残しているので Dependabot / Renovate は引き続き自動更新できます

  • actions/checkout, actions/setup-node, actions/upload-artifact, actions/download-artifact, actions/github-script, docker/*, softprops/action-gh-release, shimataro/ssh-key-action, qodo-ai/pr-agent

✅ Docker ベースイメージを digest 固定(2 箇所)

  • node:22.12.0-alpine@sha256:51eff88a...
  • caddy:2.4.6-alpine@sha256:15e576e7...

✅ package.json を厳密バージョンに固定(22 依存)

^ レンジを外し、現在の package-lock.json で解決されているバージョンに固定しました(npm ci はそのまま通ります)。

  • ⚠️ 現在オープン中の Dependabot PR(依存 bump 群)とコンフリクトする可能性があります。取り込み順序はメンテナのご判断にお任せします。レンジ運用を継続したい場合はこの変更だけ revert いただいて構いません。

⚠️ 要確認:pull_request_target + cache(自動変更していません)

自動監査では .github/workflows/preview.yaml が「pull_request_target でキャッシュを使用(cache poisoning リスク)」としてフラグされました。しかし内容を精査したところ、既に適切に緩和されていると判断したため変更していません

  • genApi ジョブの cache: npm … checkout に ref: 指定がなく**ベースブランチ(信頼されたコード)**を取得しているため、攻撃者 PR がキャッシュを汚染できない
  • build-preview-imagecache-from: ...:buildcache読み取り専用(cache-to なし) で、共有キャッシュへの書き込み=汚染経路がない。かつ未信頼コードは Docker 内でビルドしている

この認識が正しいか、念のためご確認ください。

  • 上記の pull_request_target + cache の緩和状況の認識が正しいことを確認した

確認のお願い

  • CI(lint / type-check / build)が通ることを確認した
  • npm ci が通ることを確認した
  • Dependabot のオープン PR との取り込み順序を確認した

参考


🤖 この PR は traPtitech org セキュリティ監査の一環として自動生成されました。

- GitHub Actions を commit SHA で固定(49 箇所)
- node/caddy イメージを digest 固定
- package.json を lockfile 解決バージョンに固定(npm ci 互換)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 58b28b7d-66cc-462d-b945-26edbc161c61

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/supply-chain-hardening

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Preview (prod) → https://441-prod.portfolio-preview.trapti.tech/
Preview (dev) → https://441-dev.portfolio-preview.trapti.tech/
⚠️ このページは悪意のある改ざんを受けている可能性があります。 (特に fork 先からの PR の場合は必ず) 変更内容を確認してからアクセスするようにしてください

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant