Interview Prep/DevSecOps/Container image and IaC scanning

`.trivyignore` entries are ignored and the build still fails on the same CVE

BeginnerTroubleshootingContainer image and IaC scanning
Answer

Likely causes → The file is not in the working directory Trivy runs from, the ID differs (GHSA vs CVE alias), or the YAML .trivyignore.yaml format is used without --ignorefile.

Diagnose →

pwd; ls -la .trivyignore
trivy image --ignorefile ./.trivyignore myapp:1.4 --debug 2>&1 | grep -i ignore

Fix → Pass the path explicitly and match the ID Trivy prints. Add an expiry:

# Not reachable, see SEC-142
CVE-2024-45337 exp:2026-12-31

Prevent → Every ignore line needs a ticket reference and an expiry date; CI fails when an expiry has passed.

All DevSecOps questions

More on Container image and IaC scanning