Skip to content

chore(security): 🔒 anchore/sbom-action による SBOM 定期生成と Dependency Graph 登録 - #197

Merged
genzouw merged 1 commit into
mainfrom
feature/security-sbom-983600822631910968
Jun 6, 2026
Merged

genzouw merged 1 commit into
mainfrom
feature/security-sbom-983600822631910968

Conversation

@genzouw

@genzouw genzouw commented Jun 5, 2026

Copy link
Copy Markdown
Owner

背景

対象リポジトリは Node.js / TypeScript (Bun) スタックであり、既に gitleakstrivy などの事前コミット/CI スキャン、さらには .husky.gitattributes を使った堅牢なシークレット漏洩対策が導入されています。しかし、定期監査の観点で依存関係の全体像(SBOM)を把握し、サプライチェーンリスクを可視化する仕組みが不足していました。

現状認識(事前調査結果のサマリー)

  • 既存防御策: gitleaks.yml, trivy.yml, trufflehog.yml, codeql.yml, .husky/pre-commit, .gitattributes での漏洩ブロック等、多層防御が導入済み
  • 未カバー領域: サプライチェーン・セキュリティの可視化(SBOM の生成・管理)
  • 直近の漏洩リスク兆候: 特になし(既存の防御機能が正常に作動している)

このPRで導入・強化するもの

  • 対象: 新規ワークフロー .github/workflows/sbom.yml およびドキュメント docs/security/leak-prevention.md の更新
  • ツール名とバージョン: anchore/sbom-action (v0.17.9)
  • 期待される効果: 依存パッケージの SBOM(SPDX形式)を自動生成し、GitHub Dependency Graph に連携させることで、サプライチェーン起因の脆弱性を可視化し、有事の際に素早くリスクを特定できるようにする

検知漏れリスクと補完策

  • 検知できないケース: コンパイル済みバイナリなどで動的に取得される依存関係
  • 補完策: 既存の trivy.yml との組み合わせによる多角的なスキャン継続

マージ前に必要な手動作業(チェックリスト)

レビュアーは PR をマージする前に必ず以下を実施してください。
本 PR の CI は手動作業完了を前提に通る設計です。

  • リポジトリの設定(Settings > Code security and analysis)から「Dependency graph」機能が有効になっていることを確認する。

マージ後の確認手順

  • マージ後、main への push によって SBOM Generation ワークフローが正常終了することを確認する
  • リポジトリの Insights > Dependency graph に依存パッケージが正しくリストアップされているか確認する

ロールバック手順

万が一 CI に影響が出る場合は、.github/workflows/sbom.yml を削除する PR を作成・マージしてください。

参考情報

  • 公式ドキュメント: https://github.com/anchore/sbom-action
  • 比較検討した他案: trivy による SBOM 生成も可能ですが、GitHub Dependency Submission API への統合には専用のアクション (anchore/sbom-action) が最も親和性が高いため採用しました。

PR created automatically by Jules for task 983600822631910968 started by @genzouw

Summary by CodeRabbit

  • Chores

    • ソフトウェア部品表(SBOM)の自動生成ワークフローを追加しました。毎週定期実行され、GitHub Dependency Graphにアップロードされます。
  • Documentation

    • サプライチェーン・セキュリティ監視に関するドキュメントを更新しました。

…h 登録

- `.github/workflows/sbom.yml` を追加し、リポジトリの SBOM を生成して GitHub Dependency Graph にアップロードする処理を自動化しました
- サプライチェーンセキュリティを強化し、脆弱性検知の基盤を向上させました
- `docs/security/leak-prevention.md` に運用スケジュールを追記しました

Co-authored-by: genzouw <29957+genzouw@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

本プルリクエストは、リポジトリのサプライチェーン・セキュリティを強化することを目的としています。既存のシークレット漏洩対策に加え、SBOM (Software Bill of Materials) の自動生成と GitHub Dependency Graph への連携機能を導入することで、依存関係の可視化と脆弱性管理の向上を図ります。

Highlights

  • SBOM 生成ワークフローの導入: anchore/sbom-action を利用した新しい GitHub Actions ワークフロー (.github/workflows/sbom.yml) を追加し、毎週月曜日に SBOM を自動生成して GitHub Dependency Graph に登録するようにしました。
  • セキュリティドキュメントの更新: docs/security/leak-prevention.md を更新し、新たに導入されたサプライチェーン・セキュリティ監視の仕組みについて記載しました。
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/sbom.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Looking for one thing? Review this PR in Change Stack to search files, summaries, diffs, and code without losing your place.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f6c5997e-3a71-44eb-bb00-fddf667a5586

📥 Commits

Reviewing files that changed from the base of the PR and between 984ac1a and 2d7b98f.

📒 Files selected for processing (2)
  • .github/workflows/sbom.yml
  • docs/security/leak-prevention.md

📝 Walkthrough

Walkthrough

GitHub Actions ワークフロー .github/workflows/sbom.yml を追加し、毎週月曜(JST 07:00)と push 時に SBOM を自動生成して GitHub Dependency Graph にアップロードするパイプラインを構築。docs/security/leak-prevention.md にこのワークフローの運用内容を記載した。

Changes

SBOM 生成パイプラインの追加

Layer / File(s) Summary
SBOM 生成ワークフローの定義
.github/workflows/sbom.yml
anchore/sbom-action(SHA ピン)で SPDX JSON フォーマットの SBOM を生成し GitHub Dependency Graph にアップロード。push・手動実行・毎週スケジュール(月曜 JST 07:00)のトリガー、concurrency による重複実行キャンセル制御、contents: write 権限設定を含む。
セキュリティドキュメント更新
docs/security/leak-prevention.md
SBOM 生成ワークフローの定期実行(毎週月曜日)とリポジトリ全体の SBOM 自動生成、Dependency Graph 連携の仕様をドキュメント化。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • genzouw/monopo#100: docs/security/leak-prevention.md に security monitoring 関連の内容を追加する同じファイルへの更新。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、SBOM の定期生成と Dependency Graph への登録という主要な変更を明確に示しており、変更内容と完全に関連している。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/security-sbom-983600822631910968

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 added github-actions Pull requests that update GitHub Actions code docs labels Jun 5, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

このプルリクエストでは、docs/security/leak-prevention.md にサプライチェーン・セキュリティ監視(SBOM生成)に関する説明が追加されています。レビューでは、ドキュメント内で言及されている sbom.yml ワークフローファイルがこの変更に含まれていないため、整合性を確保するために該当ファイルを追加するよう指摘されています。

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/security/leak-prevention.md
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@genzouw
genzouw merged commit 98ac78e into main Jun 6, 2026
23 checks passed
@genzouw
genzouw deleted the feature/security-sbom-983600822631910968 branch June 6, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs github-actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant