Trivy
An open-source scanner that finds vulnerable packages, secrets and misconfigurations in repositories, container images, Kubernetes manifests and Terraform.
In more detail
trivy fs reads lockfiles in a repository, trivy image reads the packages inside an image and trivy config checks manifests and infrastructure code. --severity and --exit-code turn a scan into a gate.
Examples
trivy image --exit-code 1 --severity HIGH,CRITICAL registry.example/app@sha256:deadbeefThe course runs trivy image with --severity HIGH,CRITICAL and --exit-code 1 against the exact image digest, so high or critical findings fail the pipeline before promotion.Related terms
- software composition analysis — Finding the open-source packages in your software and checking their exact versions against known vulnerability advisories.
- .trivyignore — A file listing vulnerability IDs for Trivy to ignore, optionally with an exp: date after which the waiver stops applying.
- severity level — A label for how serious a finding is, such as LOW, MEDIUM, HIGH or CRITICAL, often used as the threshold at which a pipeline blocks or an alert fires.
- four Cs of cloud native security — A layered model of Kubernetes security: Cloud, Cluster, Container and Code, where each layer sits inside and depends on the one before it.
- image scanning — Checking the packages inside an image against lists of known vulnerabilities.
- digest — A SHA-256 hash of an image's manifest that identifies its exact content and can never be moved to other bytes.
- security gate — An automated check in a pipeline that stops a change going further when it fails, usually by exiting with a non-zero code.
Taught in
- Scanning Code, Dependencies And Containers — Microsoft Azure DevOps Engineer Expert (AZ-400) Exam Prep
- Two Hours, Sixteen Tasks: A CKS Plan — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Minimal Base Images: Less To Attack — Certified Kubernetes Security Specialist (CKS) Exam Prep
- SBOMs: Knowing What You Ship — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Scan Reports: Triage, Gates And Cleanup — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Mock Exam: Seventeen Security Tasks Against The Clock — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Software Composition Analysis with Trivy — Cloud Security & DevSecOps Engineering
- Supply Chain Security: SBOMs & Cosign Signing — Cloud Security & DevSecOps Engineering
- Not As Root, Not In Plain Sight: Pod Security And Secrets — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Pinned For Stability: Images, Registries And Code — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Who Built This Image? Supply Chain And Registries — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Which Benchmark, And Who Checked It? Compliance And Frameworks — Kubernetes and Cloud Native Security Associate (KCSA) Exam Prep
- Container Security: Minimal Bases And Non Root — Application Security & Threat Modeling for Engineers
- Image Scanning And Trivy — Application Security & Threat Modeling for Engineers
- Root, But Not That Root: Default Engine Security And Image Scanning — Docker Certified Associate (DCA) Exam Prep
References
Certification courses
- AZ-400 course and practice exam: Microsoft Azure DevOps Engineer Expert
- CKS course and practice exam: Certified Kubernetes Security Specialist
- KCNA course and practice exam: Kubernetes and Cloud Native Associate
- KCSA course and practice exam: Kubernetes and Cloud Native Security Associate
- DCA course and practice exam: Docker Certified Associate