feat(docker): block vulnerable images at PR time, not at release time - #40
Merged
Conversation
Adds docker-smoke-build.yml: the PR-time Dockerfile smoke build now optionally scans with Trivy and fails the check on a CRITICAL vulnerability with a known fix. This is now the ONLY place the pipeline blocks on vulnerabilities. docker-release.yml/release-train.yml's scan_image becomes report-only (SARIF still uploads every time) — a CVE published after a PR already merged cleanly no longer fails an unrelated release train run later. Factors the report+upload+block steps into a new trivy-scan composite action, shared by both workflows via block_on_critical, instead of duplicating the same three Trivy steps in two files.
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
docker-smoke-build.yml: the PR-time Dockerfile smoke build now optionally scans with Trivy (scan_image: true) and fails the check on a CRITICAL vulnerability that has a known fix. This is now the only place in the pipeline that blocks on vulnerabilities.docker-release.yml/release-train.yml'sscan_imagebecomes report-only — the SARIF still uploads on every run, but the blocking step is removed. A CVE published after a PR already merged cleanly no longer fails an unrelated release train run for code nobody touched.trivy-scancomposite action, shared by both workflows via ablock_on_criticalinput, instead of duplicating the same three Trivy steps across two files.Why: a follow-up from the earlier Trivy work — "avoid failing the docker build workflow when we've already merged to develop, for example." Blocking at PR time gives the same protection (a known-vulnerable image never reaches
main) without the surprise of an unrelated release failing later for a CVE that surfaced after the merge.Consumed by
gardenia-api,gardenia-web,nestjs-template, andcookidoo-mcp(companion PRs rewiring theirdocker.ymlto calldocker-smoke-build.ymlwithscan_image: true).Test plan
yaml.safe_load)Docker Buildcheck actually scans and blocks on a CRITICALGenerated by Claude Code