How do Checkov and Trivy differ?
IntermediateProductionTesting and Policy as Code
Answer
Both scan IaC for misconfigurations. Checkov (Prisma Cloud) has a large policy library, supports custom Python and YAML policies and can scan the plan JSON, which resolves variables and modules. Trivy absorbed tfsec and covers images, filesystems and IaC in one tool. We pick one as the gate, scan plan output for accuracy and manage suppressions in code.
terraform show -json tfplan > plan.json
checkov -f plan.json --framework terraform_plan
More on Testing and Policy as Code
How do you test infrastructure code, and what does the testing pyramid look like?BeginnerWhat does the static-analysis layer catch?BeginnerWhat does tflint do, and how is it configured?BeginnerHow does `terraform test` work?BeginnerHow do mock providers work in `terraform test`?AdvancedWhen do you use Terratest instead of `terraform test`?Intermediate