SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free Learning Roadmaps

TrivyNotes

Key takeaways, tips, and important points to remember

📄
Last updated Aug 2026
Expert Content

Trivy Key Notes

Scan Targets Quick Reference

CommandTarget

|---|---|

`trivy image`Container image (local or registry)
trivy fsLocal filesystem/directory
trivy repoRemote Git repository
trivy configIaC (Terraform, K8s manifests, Dockerfiles, CloudFormation)
trivy k8sLive Kubernetes cluster (already-running workloads)
trivy sbomAn existing SBOM file, checked against the vuln DB

Scanner Types

ScannerChecks For

|---|---|

`vuln`Known CVEs in OS packages and language dependencies
misconfigIaC/manifest misconfigurations (default rules + custom Rego)
secretAccidentally-committed credentials
licenseDependency license compliance

Severity Levels

UNKNOWN < LOW < MEDIUM < HIGH < CRITICAL

CI gating commonly filters to HIGH,CRITICAL to avoid noise from lower-severity findings.

CI Gating Essentials

--severity HIGH,CRITICAL    # filter to what matters for blocking
--exit-code 1                # make Trivy's exit status reflect findings
                               # (default: always exits 0, purely informational)

Key Files

FilePurpose

|---|---|

`.trivyignore`Suppress specific findings — document reason + review date per entry
Custom .rego policyExtend misconfiguration checks with org-specific rules
VEX documentStandardized, portable exploitability-status claims

SBOM Formats

CycloneDX   — widely used, tool-agnostic
SPDX        — another widely-adopted standard format

Air-Gapped Workflow

1. On a connected machine: trivy image --download-db-only --cache-dir <dir>
2. Transfer <dir> through an approved internal channel
3. On the air-gapped machine: trivy image --skip-db-update --cache-dir <dir>
4. Repeat periodically -- offline DB does NOT auto-update

Why Results Can Change on an Unchanged Image

Trivy's vulnerability DB updates over time. A new CVE affecting an
ALREADY-INSTALLED package can be discovered and added to the
database after the image was originally scanned clean -- the image
didn't change, the database's knowledge did.

Trivy Operator (Kubernetes-native continuous scanning)

Runs as a controller, auto-scanning on deploy + periodic re-scans
Results exposed as native K8s CRDs: VulnerabilityReport, ConfigAuditReport
kubectl get vulnerabilityreports -A
Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
Up Next
📝
TrivyPYQ
Previous Year Questions with detailed solutions
Also Worth Exploring
← Back to all Trivy modules
CheatsheetsPYQ