feat(security-container-scan): always produce table alongside JSON/SARIF#47
Merged
Conversation
Grype now always emits all three formats — JSON for tooling (our own aggregator parses this), SARIF for GitHub code scanning, and a plain- text table for humans reviewing the artifact. No opt-in flag: the extra Grype run is ~15-30s and well worth removing the per-branch conditional from every caller. New `report-table` input (default `grype-results.txt`) and matching `report_table` output. `upload-artifact` bundles all three files; `if-no-files-found: ignore` defensively tolerates partial output if Grype fails mid-run. Co-Authored-By: Claude Opus 4.7 (1M context) <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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
report-tableinput (defaultgrype-results.txt) and matchingreport_tableoutput.generate-tableconditional that callers would otherwise need — table is cheap enough (one extra Grype run, ~15-30s; DB cache keeps it fast after the first call) that unconditional is cleaner.Motivation
PR reviewer feedback on the first rollout: downloading the per-service artifact and then
jqing the JSON was not an obvious workflow. A plain-text table lets reviewers download and read directly.JSON is kept because our aggregator (
security-container-scan-aggregate) parses.matches[]from Grype's native JSON; rewriting it to consume SARIF would lose Critical/High granularity without a CVSS-score mapping shim, and would drop Grype-specific fields (fix.versions,relatedVulnerabilities,matchDetails) that future features are likely to want.Changes
.github/actions/security-container-scan/action.ymlreport-tableinput (defaultgrype-results.txt)report_tableoutput-o tableGrype pass (previously absent)upload-artifactpath list with the table file; addif-no-files-found: ignoreas defence against partial output from a crashed Grype run.github/actions/security-container-scan/README.mdTest plan
pre-commitall hooks pass (actionlint/shellcheck/yaml)bare-metal-manager-restPR #418 (ci: Add Grype container vulnerability scan to build-push-service infra-controller-rest#418), confirm the per-service artifact now containsgrype-results.txtalongside.json/.sarif🤖 Generated with Claude Code