Repository navigation
Add container image vulnerability scan workflow - #173
Open
jordanpadams wants to merge 1 commit into
Open
jordanpadams wants to merge 1 commit into
jordanpadams wants to merge 1 commit into
Conversation
jordanpadams
requested review from
viviant100
and
a lite review from Copilot
November 12, 2026 19:07
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the workflow adding container image vulnerability scanning, SARIF reporting, and failure gating.
No open issues 🎉
What changed in this PR
Adds a GitHub Actions workflow that builds docker/Dockerfile and scans the resulting container image with Trivy for fixable high and critical OS or language-library vulnerabilities.
Changes:
- Runs on Docker-related pull requests, pushes to
main, weekly schedules, and manual dispatches. - Builds images with the current base image and scans for vulnerabilities.
- Uploads SARIF results and applies a vulnerability failure gate.
| File | Description |
|---|---|
| .github/workflows/container-scan.yaml | Defines conditional container image building, Trivy vulnerability scanning, SARIF reporting, and vulnerability failure handling. |
Review effort: Lite
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
.github/workflows/container-scan.yaml, which buildsdocker/Dockerfileand scans the image with Trivy for known vulnerabilities in OS packages and language libraries. Dependabot does not cover OS-level packages (Debian/Ubuntu/Alpine), so this is the CI-side check for the findings AWS ECR/Inspector reports after an image is pushed.Behavior
mainthat touchdocker/**, weekly on a schedule (to catch CVEs published after the last build), and on manual dispatch.pull: trueso the scan reflects the current base image.CRITICALandHIGHfindings that have a fix available (ignore-unfixed: true).exit-codeto'0'in the "Vulnerability Gate" step for report-only.docker/Dockerfiledoes not exist, so repos created from this template without Docker are unaffected.Notes
aquasecurity/trivy-actionis pinned to the commit forv0.36.0rather than a tag. Dependabot'sgithub-actionsecosystem (already configured) keeps the pin current.dependabot.ymlalready includes thedockerecosystem for/docker/, which opens PRs to bump the base image. No change needed there.Testing
Workflow YAML parses. The template has no
docker/Dockerfile, so the scan steps are skipped here; the first real run happens in a repo that adds one.