feat(docker-release): scan image for vulnerabilities with Trivy - #38
Merged
Conversation
Adds an opt-in scan_image input (default false) to docker-release.yml and release-train.yml. When enabled, builds a linux/amd64-only, load:true copy of the image purely for scanning (the real multi-arch build stays push:false until this passes), uploads a full-severity SARIF report to Security > Code scanning unconditionally, and fails the release only on a CRITICAL vulnerability that has a known fix. Runs on every release channel, before any tag/push happens.
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
scan_imageinput (defaultfalse) todocker-release.ymlandrelease-train.yml.linux/amd64-only,load: truecopy of the image purely for scanning (the real multi-arch image stayspush: falseuntil this passes — multi-arch builds aren'tdocker load-able, so this is the only way to scan locally before publishing). Reuses the same buildx cache as the real build, so the extra build is cheap.severity: CRITICAL, ignore-unfixed: truethat actually fails the job. A CRITICAL with no upstream fix is reported but never blocks — otherwise a single unfixable CVE in a base image would block every future release.security-events: writeto both workflows' permissions (needed for the SARIF upload); documents in README that consumers enablingscan_imagemust grant it explicitly too.Consumed by
gardenia-api,gardenia-web,nestjs-template, andcookidoo-mcp(companion PRs opting in on both their release-train and manual release workflows).nestjs-kithas no Docker release, so it's unaffected.Test plan
yaml.safe_load)Generated by Claude Code