Interview Prep/Terraform/Testing and Policy as Code

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
All Terraform questions Roadmap: Terraform in production

More on Testing and Policy as Code