Skip to content

feat(docker): block vulnerable images at PR time, not at release time - #40

Merged
JSisques merged 1 commit into
mainfrom
claude/docker-scan-split
Jul 17, 2026
Merged

feat(docker): block vulnerable images at PR time, not at release time#40
JSisques merged 1 commit into
mainfrom
claude/docker-scan-split

Conversation

@JSisques

Copy link
Copy Markdown
Contributor

Summary

  • Add 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's scan_image becomes 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.
  • Factor the report + SARIF-upload + block steps into a new trivy-scan composite action, shared by both workflows via a block_on_critical input, instead of duplicating the same three Trivy steps across two files.
  • README: two-tier table explaining why blocking moved to PR time, new "Docker Smoke Build" usage section, updated "Docker image vulnerability scanning" section, new "Trivy Scan" composite-action doc.

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, and cookidoo-mcp (companion PRs rewiring their docker.yml to call docker-smoke-build.yml with scan_image: true).

Test plan

  • YAML validated locally (yaml.safe_load)
  • Merge this first, then confirm a consumer PR's Docker Build check actually scans and blocks on a CRITICAL

Generated by Claude Code

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.
@JSisques
JSisques merged commit 5aa71b2 into main Jul 17, 2026
2 checks passed
@JSisques
JSisques deleted the claude/docker-scan-split branch July 17, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants