ci: PR-time Trivy image CVE scan (#68)#70
Merged
Merged
Conversation
Adds an `image-scan` job to ci.yml that builds the Dockerfile and runs Trivy against the just-built image, failing the build on fixable CRITICAL/HIGH CVEs. Closes the OS-package half of supply-chain CVE coverage; complements the existing govulncheck source-side scan (#41). The action is pinned by commit SHA (v0.36.0 → ed142fd0673e97e23eac54620cfb913e5ce36c25) with a `# Tracks:` comment mirroring the Dockerfile base-image pin convention (#32). `ignore-unfixed` keeps unactionable CVEs from blocking PRs; `vuln-type: os,library` covers both distroless OS packages and Go-binary content. Job-level `permissions: contents: read` belt-and-suspenders against a future workflow-header widening. Refs #68
Contributor
Author
Code Review: #68Decision: PASS FindingsNone. SummaryClean, minimal implementation that matches the spec exactly. One new job ( Verified:
Security-sensitive checks:
Nice to have (not blocking): the spec's |
- New codebase/68.md describing the image-scan job, the fixable-only failure policy, action-pin convention, and lessons learned. - features/docker-image.md: replace the "no image scanning wiring" deferral with an evergreen CI image scanning section and link to #68. - INDEX.md: extend the Docker image one-liner to name the new scan job. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
What
Adds an
image-scanjob to.github/workflows/ci.ymlthat:pyrycode-relay:${{ github.sha }}.aquasecurity/trivy-action@v0.36.0(pinned by commit SHA) against the just-built image.exit-code: 1) when a fixable CRITICAL or HIGH CVE is detected (ignore-unfixed: true).osandlibraryvuln types — distroless OS packages plus Trivy's Go-binary re-derivation, intentionally overlapping with govulncheck (relay: govulncheck in CI — flag reachable Go vulns at PR time #41).permissions: contents: readas belt-and-suspenders against future workflow-header widening.Issue
Closes #68.
Architecture compliance
Implements
docs/specs/architecture/68-pr-time-trivy-image-cve-scan-in-ci-yml.mdverbatim. New job appended aftersecurity(parallel runner), no other files touched —.trivyignoreis intentionally not seeded per the spec's allow-list policy.The Trivy action is pinned by commit SHA (
ed142fd0673e97e23eac54620cfb913e5ce36c25, trackingv0.36.0) with a# Tracks:comment mirroring the Dockerfile base-image digest-pin convention from #32. Renovate will surface future bumps as PRs.Testing
image-scanjob should pass green against the current Dockerfile.golang:1.16on a throwaway branch) is deliberately not committed — it must not land onmain. The spec is explicit that this is a manual one-off check, not a committed fixture. Not exercised locally for this PR (no Docker on the dev host); CI is the authoritative gate.go vet ./...andgo test -race ./...pass (no Go code touched, run as hygiene).Notes
.trivyignoreadded — none needed during initial wiring. If a false-positive surfaces in CI, it will be addressed per the policy in the spec (inline-comment-per-suppression with CVE id, reason, revisit date).security-events: write.🤖 Generated with Claude Code