Interview Prep/DevSecOps/Container image and IaC scanning

The image scan reports zero vulnerabilities for a distroless image that you know is outdated

AdvancedTroubleshootingContainer image and IaC scanning
Answer

Likely causes → The scanner did not detect an OS package database (stripped image, scratch base, or custom base without /var/lib/dpkg/status.d or apk db) so it found no packages to match.

Diagnose →

trivy image --list-all-pkgs -f json myapp:1.4 | jq '.Results[] | {Target, Type, n: (.Packages|length)}'
syft myapp:1.4 -o table | head

Fix → Use a base that keeps package metadata (Google distroless and Chainguard images do), or generate an SBOM at build time from the source and scan that.

Prevent → Treat "0 packages detected" as a failure, not a pass.

All DevSecOps questions

More on Container image and IaC scanning