Vulnerability Discovery and Analysis
A tester has a repository of Terraform files and Kubernetes manifests and wants Trivy to flag misconfigurations without any running infrastructure. Which command should the tester run?
Show the answer
Correct answerD. trivy config ./repo
AWhy not this: trivy image targets a container image for packages and vulnerabilities, not IaC files in a directory.
BWhy not this: trivy sbom reads an existing SBOM file to find vulnerable packages; it does not check IaC settings.
CWhy not this: trivy k8s scans a live cluster through a kubeconfig, which this scenario does not have.
DWhy this is right: trivy config checks IaC files such as Terraform and Kubernetes manifests for misconfigurations.
The trivy config subcommand scans IaC files such as Terraform and Kubernetes manifests for misconfigurations, so nothing needs to be running. The trivy k8s subcommand is tempting but needs a live cluster to scan.