Checkov

3.2.513 · active · verified Sat Mar 28

Checkov is an open-source static code analysis tool that performs security and compliance scanning for Infrastructure as Code (IaC) and Software Composition Analysis (SCA). It identifies misconfigurations and vulnerabilities in various IaC frameworks (e.g., Terraform, CloudFormation, Kubernetes, Dockerfiles, Bicep, Serverless) and scans container images and open-source packages for Common Vulnerabilities and Exposures (CVEs). Actively maintained by Prisma Cloud, Checkov has a frequent release cadence, often with multiple patch versions released monthly.

Warnings

Install

Imports

Quickstart

The primary way to use Checkov is via its command-line interface. This quickstart demonstrates how to scan a directory containing Infrastructure as Code (IaC) files, a specific file, or a Terraform plan in JSON format. The `--directory` and `--file` flags are fundamental for specifying scan targets.

checkov --directory ./my-iac-code
# Example: Scan a Terraform directory
# checkov --directory /path/to/my/terraform/configs

# Example: Scan a specific Kubernetes manifest file
# checkov --file /path/to/my/k8s/deployment.yaml

# Example: Scan a Terraform plan JSON, ensuring multiline output for better line numbers
# terraform init
# terraform plan -out tf.plan
# terraform show -json tf.plan | jq '.' > tf.json
# checkov --file tf.json

view raw JSON →