ci: Actionsのセキュリティチェックを追加 - #6
Merged
Merged
Conversation
zizmor でワークフローの静的解析を行う。現状 findings はゼロのため緑のまま導入できる。 落ちたときの対処手順は日本語でジョブサマリに出力する。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
何をする PR か
GitHub Actions のワークフロー自体に潜むセキュリティ上の問題を検査する zizmor を、CI に追加します。
なぜ必要か
ワークフローには、書き方によって次のような穴ができます。
v1の中身がすり替わって任意のコードが動くcheckoutの資格情報を残している.git/configに残り、後続ステップや外部ツールから読めるpermissions:が広い${{ }}をrun:に直書き先日 org 全体を調べたところ 62リポジトリで354件の指摘がありました。機械的に直せるものを修正して166件まで減らしましたが、新しく書いたワークフローで同じ問題が再発するのを防ぐ仕組みがありません。これを CI で止められるようにします。
このリポジトリの状態
現在 findings はゼロです。そのため、このまま入れても CI は緑のままです。以降、新たに問題のある書き方が入ったときだけ落ちます。
設定について
.github/配下が変わったときだけ実行します(通常の開発では動きません)permissions: {}を宣言し、ジョブにはcontents: readだけ与えていますadvanced-security: false)。SARIF モードは finding があっても失敗しないため、ゲートとして機能する annotations モードを使っています# zizmor: ignore[ルール名]で個別に除外できますすでに
acme-deliveryで同じ構成が動いており、それに合わせています。🤖 Generated with Claude Code