Interview Prep/DevSecOps/Container image and IaC scanning

Trivy fails the build on 14 HIGH/CRITICAL CVEs in the base image, all with "Fixed Version" empty

BeginnerTroubleshootingContainer image and IaC scanning
Answer

Likely causes → The distro has not shipped patches (status affected / will_not_fix), so no upgrade will clear them and the gate blocks forever.

Diagnose →

trivy image --severity HIGH,CRITICAL --format json myapp:1.4 \
  | jq -r '.Results[].Vulnerabilities[]? | select(.FixedVersion==null or .FixedVersion=="") | "\(.VulnerabilityID) \(.PkgName) \(.Status)"'

Fix → Gate only on fixable issues and track the rest:

trivy image --ignore-unfixed --severity HIGH,CRITICAL --exit-code 1 myapp:1.4

Consider a slimmer base (distroless, Chainguard/Wolfi, -slim) to drop unused packages entirely.

Prevent → Policy: block on fixable HIGH/CRITICAL, report unfixable, rebuild images weekly so patches land automatically.

All DevSecOps questions

More on Container image and IaC scanning