How do you manage Trivy false positives and accepted risks?
IntermediateProductionImage Security & Hardening
Answer
Use a .trivyignore file with CVE IDs, each with an expiry and justification comment, or VEX documents stating "not affected". Keep it in the repo so exceptions are reviewed in PRs.
# CVE-2024-XXXX not reachable, no network parsing, review 2026-03-01 exp:2026-03-01
CVE-2024-XXXX
Rescan on a schedule since the DB changes daily.
More on Image Security & Hardening
Why should containers not run as root, and how do you enforce it?BeginnerWhat is a distroless image and what are the trade-offs?BeginnerHow do you scan an image with Trivy and fail a CI build on serious findings?BeginnerWhich `docker run` flags make up a hardened runtime baseline?BeginnerWhat does `no-new-privileges` protect against?BeginnerHow should secrets be handled in container workloads?Beginner