Skip to content

fix: GitHub Actionsワークフローのセキュリティ指摘事項を修正#28

Merged
eai04191 merged 2 commits intomainfrom
fix/zizmor-workflow-security
Apr 8, 2026
Merged

fix: GitHub Actionsワークフローのセキュリティ指摘事項を修正#28
eai04191 merged 2 commits intomainfrom
fix/zizmor-workflow-security

Conversation

@eai04191
Copy link
Copy Markdown
Member

@eai04191 eai04191 commented Apr 8, 2026

issue

なし(zizmorスキャンで検出されたセキュリティ指摘事項の対応)

変更内容

  • actions/checkoutpersist-credentials: falseを追加(全reusableワークフロー)
  • 呼び出し元ワークフローに最小権限のpermissionsを追加(デプロイ用にはid-token: writeも付与)
  • secrets: inheritを明示的なsecrets指定に変更
  • .github/zizmor.ymlを追加しsecrets-outside-envをdisable(GitHub Environment設定が必要なため別途対応)

確認したこと

  • zizmor .github/workflows/No findings to reportを確認

スクリーンショット

なし

補足事項

  • secrets-outside-envはリポジトリ側でEnvironmentを作成しsecretsを移行する必要があるため、zizmor設定でdisableとした

PR時のセルフチェック

  • 関数や変数の命名は一目で分かるものになってますか?
  • コメントは適切な量で、誰が見ても分かるコメントになってますか?
  • PR内容に関するテストは書きましたか?
  • PR内容に付随する各種ドキュメントは一緒に修正しましたか?
  • IssueをCloseする場合、完了の定義は満たせていますか?

by Claude Code Badge

Copilot AI review requested due to automatic review settings April 8, 2026 10:35
- actions/checkoutにpersist-credentials: falseを追加(artipacked対策)
- 呼び出し元ワークフローにpermissions: contents: readを追加(excessive-permissions対策)
- secrets: inheritを明示的なsecrets指定に変更(secrets-inherit対策)
- zizmor設定ファイルを追加しsecrets-outside-envをdisable(Environment設定が必要なため)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@eai04191 eai04191 force-pushed the fix/zizmor-workflow-security branch from 6af4a70 to a7099c5 Compare April 8, 2026 10:36
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

zizmor の指摘事項に対して、ワークフローの権限・シークレット取り扱いを最小権限化する対応がまとまっていて良いです。GitHub Actions のセキュリティ設定を改善し、意図しない権限付与やシークレット露出リスクを下げるPRです。

Changes:

  • reusable ワークフローの actions/checkoutpersist-credentials: false を追加
  • 呼び出し元ワークフローで permissions: { contents: read } を明示し、secrets: inherit を明示的な secrets 渡しに変更
  • .github/zizmor.yml を追加し、secrets-outside-env ルールを disable

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/zizmor.yml zizmor のルール設定を追加し、特定指摘の運用上の暫定対応を反映
.github/workflows/on-push-to-main.yml 呼び出し元の権限最小化と secrets の明示的受け渡しに変更
.github/workflows/on-pull_request.yml 呼び出し元の権限最小化(contents read)を明示
.github/workflows/_reusable_lambda_rie_test.yml checkout の認証情報永続化を無効化
.github/workflows/_reusable_deploy.yml checkout の認証情報永続化を無効化
.github/workflows/_reusable_check.yml checkout の認証情報永続化を無効化
.github/workflows/_reusable_cdk_synth.yml checkout の認証情報永続化を無効化

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

reusable側でOIDC認証に必要なid-token: writeが呼び出し元で許可されていないと
aws-actions/configure-aws-credentialsが失敗するため追加

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@eai04191 eai04191 merged commit db0e112 into main Apr 8, 2026
3 checks passed
@eai04191 eai04191 deleted the fix/zizmor-workflow-security branch April 8, 2026 10:40
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.

2 participants