How does Trivy get its vulnerability data, and how do you run it air-gapped?
AdvancedConceptTool Internals and Comparisons
Answer
Trivy does not query NVD at scan time. It downloads a prebuilt database (trivy-db, an OCI artifact on ghcr.io/aquasecurity, rebuilt every few hours from distro advisories, GitHub advisories and NVD) into its cache, plus a separate Java DB for JAR identification. Scanning is a local lookup of detected packages against that DB.
For air-gapped or rate-limited environments, mirror the DB into an internal registry and point Trivy at it:
trivy image --download-db-only --db-repository registry.internal/trivy-db
trivy image --skip-db-update --skip-java-db-update --offline-scan app:1.4.2
In CI we cache the DB directory between jobs, which also avoids GHCR rate limits (TOOMANYREQUESTS).
More on Tool Internals and Comparisons
Which scan targets and scanners does Trivy support?IntermediateHow does Falco capture system calls?AdvancedHow does OPA evaluate a Rego policy? Give an example.IntermediateWhat are the ways to deploy OPA, and what are decision logs?AdvancedHow does Vault achieve high availability with integrated storage?AdvancedWhat are Vault secrets engines and auth methods? What changes in KV v2?Intermediate