ci: add Trivy security scan to PR pipeline - #75
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughChangesThe pull request adds a composite Trivy action, integrates it into pull request checks, and adds Trivy CI scanning
Estimated code review effort: 4 (Complex) | ~30–60 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow as GitHub Actions workflow
participant Action as Trivy composite action
participant Maven as Maven dependency resolver
participant Trivy as Trivy scanner
Workflow->>Action: Run local vulnerability scan
Action->>Maven: Resolve dependencies offline when pom.xml exists
Action->>Trivy: Scan filesystem and Dockerfile base images
Trivy-->>Action: Return vulnerability findings
Action-->>Workflow: Print findings and return failure for HIGH or CRITICAL vulnerabilities
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/steps/trivy/action.yml:
- Around line 47-68: Update the image-processing loop to emit a GitHub Actions
::warning:: annotation before continuing for unresolved image references
containing “$”. Replace the plain “skip ${img}” output in the trivy failure
branch with a corresponding ::warning:: annotation that identifies the image and
scan failure, while preserving the existing skip behavior.
In @.github/workflows/test.yml:
- Around line 99-102: Update the actions/checkout@v4 step under the “Checkout”
workflow step to set persist-credentials to false, while preserving the existing
pull request head SHA ref and read-only scanning behavior.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0558fe2a-5c56-4df7-a9c5-5d7e78ef268e
📒 Files selected for processing (3)
.github/steps/trivy/action.yml.github/workflows/test.yml.trivyignore
…s for skipped scans
Adds a Trivy-based PR security gate:
Summary by CodeRabbit
New Features
Configuration