feat(ci): add Trivy HIGH/CRITICAL gate before image push (RFC #388 PR-2) - #35
Merged
Merged
Conversation
Belt-and-suspenders security gate inserted between boot-smoke and push-to-GHCR. Fails the publish on any HIGH or CRITICAL CVE in either the OS layer (apt deps) or the Python layer (pip deps). Image never reaches :latest if vulnerable, so no fresh workspace provision can pick up a known-bad layer. Why pre-push: same logic as boot-smoke — anything that fails here never poisons :latest. Catching post-push leaves a window where every fresh provision pulls the vulnerable image. Why HIGH+CRITICAL only with ignore-unfixed=true: medium/low findings are too noisy in practice (~hundreds per Ubuntu base, mostly operationally non-actionable until the next Canonical respin). Promoting those to gate would drown signal in noise. Once Dockerfiles digest-pin their base image (RFC #388 PR-2 second half), this becomes the matched pair: pin avoids surprise base-bumps; Trivy catches if the pinned digest itself accumulates fixable vulns. Applies to all 4 supported template repos automatically since they all consume this reusable workflow (claude-code, hermes, openclaw, codex per PR #2536 prune set). Refs: Molecule-AI/molecule-controlplane#388 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 3, 2026
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
Belt-and-suspenders security gate inserted between boot-smoke and push-to-GHCR in the reusable `publish-template-image.yml`. Fails the publish on any HIGH or CRITICAL CVE in either the OS layer (apt deps) or the Python layer (pip deps). Image never reaches `:latest` if vulnerable, so no fresh workspace provision can pick up a known-bad layer.
Why pre-push
Same logic as boot-smoke — anything that fails here never poisons `:latest`. Catching post-push leaves a window where every fresh provision pulls the vulnerable image. Sequencing: build (load-only) → lint → static-import smoke → boot smoke → Trivy → push.
Why HIGH+CRITICAL only, with `ignore-unfixed: true`
Medium/low findings are too noisy in practice (~hundreds per Ubuntu base, mostly operationally non-actionable until the next Canonical respin). Promoting those to gate would drown signal in noise.
This becomes the matched pair with RFC #388 PR-2's second half (digest-pin `python:3.11-slim` base in each template's Dockerfile, deferred to per-template PRs):
Scope
Applies to all 4 supported template repos automatically since they all consume this reusable workflow (claude-code, hermes, openclaw, codex per PR #2536 prune set).
Test plan
Refs
🤖 Generated with Claude Code