Phase 2a: add --severity flag for image vulnerability scan scope#119
Merged
Conversation
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
Adds a
--severityflag to choose which severity levels the image vulnerability scan(Trivy) reports, replacing the previously hardcoded
CRITICAL,HIGHat the CLI call sites.First of the Phase 2 (CI primitives) sequence.
Changes
--severity <levels>: comma-separated severity levels. Resolution precedence is--severity>DOCKSEC_DEFAULT_SEVERITYenv >CRITICAL,HIGHdefault.error and exits non-zero.
accepted a
severityparameter).Scope / non-breaking note
--severitycontrols the Trivy image vulnerability scan. Compose staticmisconfiguration findings are a curated rule set and are always reported regardless of
this flag, so compose output is unchanged.
Testing
ruff check .passes.pytest: 104 passed (+2: invalid value rejected; valid value normalized and passedto the scan call).
--severity, env override,and invalid-value rejection.