-
Notifications
You must be signed in to change notification settings - Fork 2
add trivy scanning #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
add trivy scanning #242
Conversation
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds Trivy vulnerability scanning into the Docker image build pipeline and uploads scan results to GitHub’s Security tab.
- Introduce a scheduled workflow triggering the reusable build that now includes Trivy scanning
- Update the reusable build to grant
security-events: write, tag images with the raw ref name, run Trivy, and upload SARIF results - Propagate
security-events: writepermission to other build-update workflows
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/scheduled.yaml | New scheduled workflow dispatching the reusable build workflow |
| .github/workflows/build.yaml | Added security-events permission, raw tagging, Trivy scan + upload steps |
| .github/workflows/build-update-gitops.yaml | Propagate security-events: write permission |
| .github/workflows/build-update-gitops-pr-branch.yaml | Propagate security-events: write permission |
Comments suppressed due to low confidence (3)
.github/workflows/build.yaml:65
- If your SARIF template lives in this repository, use a relative path (e.g.,
./contrib/sarif.tpl) instead of the@-prefixed syntax, which refers to files inside the action itself.
template: '@/contrib/sarif.tpl'
.github/workflows/build.yaml:70
- [nitpick] Consider using the dedicated
actions/upload-sarif@v3action for uploading SARIF files—it's lighter-weight and focused solely on uploading results.
uses: github/codeql-action/upload-sarif@v3
.github/workflows/build.yaml:61
- Add an
exit-code: 1option under the Trivy action’swithblock so the build fails automatically when high or critical vulnerabilities are detected.
with:
Add trivy to build docker image
Upload results to the security tab in GitHub