100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Containers, Docker & Kubernetes
25 minintermediate

Image vulnerability scanning — Trivy, SBOM generation and CVE lifecycle

Container image vulnerability scanning is not a one-time audit — it is a continuous operational practice, because a CVE disclosed tomorrow against OpenSSL will affect every image built today that includes OpenSSL, without any change to the image itself. Trivy, Grype, and Snyk solve this by separating two concerns: the Software Bill of Materials (SBOM), which catalogues every package, library, and binary present in the image, and the vulnerability database, which maps package versions to known CVEs. A scanner generates the SBOM once from the image's layer contents and then queries the vulnerability database — updated daily from NVD, GitHub Advisory Database, and OS vendor advisories — to correlate known CVEs against the installed packages. Understanding this two-phase architecture explains why the same scan run on the same unchanged image can return different results on different days, why generating and storing the SBOM separately from the scan is valuable, and why the `--ignore-unfixed` flag is a business risk decision rather than a technical optimisation.

Analogy🏏Cricket
🏏 Think of it like cricket: The Pod-ReplicaSet-Deployment hierarchy maps precisely onto the three levels of IPL franchise team management. A Pod is a single player on the field at a given moment — the smallest unit of participation, carrying its own identity and fulfilling a specific role in the current game. A ReplicaSet is the franchise's match-day playing XI contract — it specifies that exactly eleven players matching a specific profile must always be on the field; if one is injured and leaves, the team management immediately sends a substitute of the same profile to restore the count. A Deployment is the franchise's season-long team strategy — it manages how the playing XI evolves between matches: when a new batting approach is adopted, the Deployment replaces the old XI with the new one in a controlled rolling substitution rather than swapping all eleven players simultaneously and disrupting team cohesion. Just as the franchise director does not manage individual players directly — the playing XI contract (ReplicaSet) handles the count and the season strategy (Deployment) handles the transitions — you never manage Pods directly in production; the Deployment manages the transition and the ReplicaSet maintains the count. This reveals why the three-level hierarchy exists rather than one omnibus 'workload' object: each level solves one specific problem, and composing three focused abstractions produces better separation of concerns than one object that conflates scheduling, scaling, and update management.
Lesson 4 of 33
0% complete