Add Trivy filesystem scan to GitHub Actions#83
Conversation
- Add .github/workflows/trivy.yml with SHA-pinned aquasecurity/trivy-action@v0.35.0 - Scan for CRITICAL,HIGH severity vulnerabilities in filesystem mode - Upload SARIF results to GitHub Security tab - Update code-security.md to include Trivy in required controls - Update github-required-checks.md to add trivy-fs-scan for develop and main Co-authored-by: seonghobae <8172694+seonghobae@users.noreply.github.com> Agent-Logs-Url: https://github.com/seonghobae/bandscope/sessions/000af55a-1d33-44d3-9af0-1276cf1be7d1
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
Cache: Disabled due to Reviews > Disable Cache setting Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit릴리스 노트
Walkthrough새 GitHub Actions 워크플로우 Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant GH as GitHub Actions
participant Runner as Actions Runner (ubuntu-latest)
participant Trivy as Trivy Scanner
participant SARIF as SARIF Upload (Security Tab)
Dev->>GH: push / open PR targeting develop/main
GH->>Runner: dispatch trivy-fs-scan job
Runner->>Trivy: run fs scan (scan-ref='.', severities=CRITICAL,HIGH)
Trivy-->>Runner: write `trivy-results.sarif` and return exit code (1 on findings)
Runner->>SARIF: upload `trivy-results.sarif` via github/codeql-action/upload-sarif [if: always()]
SARIF-->>GH: SARIF processed in Security tab
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/trivy.yml:
- Around line 23-30: The Trivy scan step ("Run Trivy filesystem scan" using
aquasecurity/trivy-action) currently sets severity: CRITICAL,HIGH but misses the
SARIF filtering and fail-on-severity behavior; update the Trivy action step to
add limit-severities-for-sarif: true so the SARIF output is restricted to
CRITICAL/HIGH and add exit-code: '1' so the step fails when those severities are
found (keep existing keys like scan-type, scan-ref, format and output
unchanged).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: cd50e862-9a7b-44e9-84b8-dfc6c2eb7e77
📒 Files selected for processing (3)
.github/workflows/trivy.ymldocs/security/code-security.mddocs/security/github-required-checks.md
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Ensures the SARIF upload contains only CRITICAL/HIGH findings (no noise from lower severities) and the job fails fast when vulnerabilities are detected. Addresses CodeRabbit review comment on PR #83.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
All requested changes implemented in commit d370e10: added limit-severities-for-sarif: true and exit-code: '1' to trivy.yml
Adds Trivy filesystem vulnerability scanning to the CI pipeline, scanning lockfiles and dependencies for CRITICAL/HIGH severity issues with results surfaced in the GitHub Security tab.
Changes
.github/workflows/trivy.yml— New workflow:fsscan on push/PR todevelop/main, SARIF upload to Security tab. Pinned toaquasecurity/trivy-action@v0.35.0(57a97c7...) — the only uncompromised release post CVE-2026-33634 supply chain attack.docs/security/code-security.md— Added Trivy to required controls list.docs/security/github-required-checks.md— Addedtrivy-fs-scanas intended required check for bothdevelopandmain.Notes
All actions are commit-SHA pinned per repo dependency policy. Reuses the same
actions/checkoutandcodeql-action/upload-sarifSHAs already in use by existing workflows.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.