Skip to main content
Cloud DevOps Solutions
Get a quote Talk to an engineer

DevSecOps and secrets

Checkov Infrastructure as Code Scanning: Policy, Baselines and Pipeline Rollout

Checkov is an open source static analysis tool that scans infrastructure as code, including Terraform, CloudFormation, Kubernetes manifests, Helm and Dockerfiles, for misconfigurations before deployment. We add it to pull requests, tune policies to your standards, baseline existing findings and enforce a gate only on new risk.

Key takeaways

  • Checkov catches misconfigurations in code before they reach your cloud account, such as public buckets or open security groups.
  • A baseline of existing findings plus a gate on new ones is what makes adoption realistic on an established estate.
  • Skips must carry a reason inline, so exceptions are reviewable in the pull request that introduces them.
  • It checks what is written in code. Values only known at apply time, drift, and runtime state can escape it.
  • Custom policies encode your own standards, but each one is code you must maintain and test.

What teams use Checkov for

Terraform pull request checks

Plans or source are scanned on every pull request so risky settings are caught by the author while the change is still fresh.

Kubernetes manifest and Helm review

Rendered manifests are checked for privileged containers, missing resource limits, host access and similar pod security issues.

Compliance mapped checks

Built-in policies reference common benchmarks, giving a starting point for evidence when auditors ask how infrastructure changes are reviewed.

Organisation specific guardrails

Custom policies enforce rules such as mandatory tags, approved regions or required encryption keys.

Dockerfile and secret detection

Dockerfiles and configuration files are checked for risky instructions and for some embedded credentials.

What Checkov is and why teams adopt it

Checkov is an open source static analysis tool from Prisma Cloud (Palo Alto Networks) that reads infrastructure as code and flags settings that are known to be risky: a storage bucket without encryption, a security group open to the internet, a Kubernetes container running as root. Because it works on files, it can run on a laptop or in a pull request in seconds and needs no cloud access.

Teams adopt it because fixing a misconfiguration in a pull request costs minutes, while finding it in production through an incident or an audit costs far more. The problem is that on an established codebase the first scan returns hundreds or thousands of findings, and a tool that fails every build is removed within a week. Our Checkov consulting is aimed at that exact moment: getting signal without stalling delivery. We describe the delivery side in Terraform security scanning with Checkov.

How we run Checkov in production

Where it runs

We use three points. A pre-commit hook gives fast local feedback. The pull request pipeline is the main control, with results annotated on the diff. A scheduled scan of the default branch catches new policies and updated rules against old code. For Terraform we usually scan the JSON plan in the pull request, because resolved values give fewer false results:

terraform plan -out tfplan
terraform show -json tfplan > tfplan.json

checkov -f tfplan.json \
  --framework terraform_plan \
  --baseline .checkov.baseline \
  --soft-fail-on MEDIUM \
  --output cli --output sarif

The baseline file records current findings so only new ones fail the check. Flag names and severity handling vary between versions and between the open source and platform editions, so we validate the command against the release you pin. In GitHub Actions the SARIF output feeds code scanning, and the same step works in GitLab CI or Atlantis workflows.

Policy selection

The default policy library is broad, which is useful and noisy at once. We enable the frameworks relevant to your cloud, review the checks that fire most, and either fix, skip with a reason or tune them. Checks tied to a specific compliance benchmark are kept where an auditor is likely to ask. Custom policies, written in Python or YAML, encode things the library cannot know, such as required tags, approved regions or mandatory encryption keys. Each custom policy gets a test, because an untested policy that wrongly blocks production changes is worse than none.

Rolling out without blocking developers

  1. Report only for two weeks. Publish findings grouped by check so everyone sees the top offenders.
  2. Fix the dangerous few. Public storage, open admin ports and unencrypted databases get addressed first.
  3. Baseline the rest. Existing findings go in the baseline and a burn-down backlog.
  4. Fail on new high-severity findings only. Medium and low findings are shown but do not block.
  5. Keep skips cheap but visible. A skip needs a check ID and a reason. Code owners approve it as part of normal review.

This approach keeps the review path fast, which is what developers care about, while making the security posture improve monotonically.

Tuning findings

Typical tuning decisions include skipping checks that duplicate controls elsewhere (for example, a logging check where a central account-level trail exists), scoping checks to production paths, and excluding test fixtures and examples. We also look for module-level fixes: when twenty findings come from one internal module, correcting the module removes all twenty. That is a strong argument for reusable Terraform modules with secure defaults.

Cost, capacity and day-2 operations

Because scans run in seconds, there is no capacity planning to speak of, but the pipeline design still matters. Scanning plans needs credentials to produce them, so we run plan generation with read-only roles and keep the scanner itself credential-free.

The tool is free, and compute cost is negligible. The real cost is attention: policy upkeep, reviewing skips, and handling upgrades that change check IDs or severities. We pin versions, upgrade on a schedule in report-only mode first, and diff the results so a new release does not suddenly fail every pull request. Skips are audited periodically against a list kept in the repository.

Honest limits

  • Static only. Checkov cannot see console-created resources, drift, or values that exist only at apply time.
  • False positives and negatives. Complex module composition and dynamic expressions can confuse any static scanner.
  • No runtime view. For behaviour inside clusters see Falco; for known vulnerabilities see Trivy.
  • Edition differences. Some features and policy sets belong to the commercial platform, so check what the open source version provides before relying on it.
  • Not a substitute for design review. A passing scan does not mean the architecture is sound.

When to choose something else

If you want a single binary for images and IaC, Trivy’s configuration scanning may be enough. If you already use Open Policy Agent for Kubernetes admission, extending it to Terraform plans with Conftest keeps one policy language. If your estate is mostly hand-built in consoles, start with posture management and our ClickOps to Terraform migration path before scanning code that does not yet exist.

Working with us

We begin with a baseline scan and a short readout of the top causes, then wire the gate into your pipeline and train reviewers on skips. Book a consultation to scope it.

Official documentation: www.checkov.io

How we work with Checkov

  1. 01

    Inventory the code and risk

    We map which repositories hold Terraform, Kubernetes and CloudFormation, and which environments carry the most risk.

  2. 02

    Run a baseline scan

    A first scan in report-only mode shows the real volume of findings and groups them by check, so we can see what drives the noise.

  3. 03

    Choose the policy set

    We enable relevant frameworks, disable checks that do not fit your architecture with written reasons, and add custom checks where needed.

  4. 04

    Integrate with pull requests

    Checkov runs in CI, annotates the pull request with SARIF or inline comments, and fails only on new findings above the agreed severity.

  5. 05

    Manage exceptions

    Inline skip comments with justification are standard, reviewed by code owners, and periodically audited.

  6. 06

    Pair with runtime and drift checks

    We combine the scan with drift detection and cloud posture tools so what is deployed is also checked, not just what is written.

Checkov compared with the alternatives

We recommend the tool that fits your team, not the one we know best. Here is when each option makes sense.

OptionChoose it when
CheckovCheckov is an open source static analysis tool that scans infrastructure as code, including Terraform, CloudFormation, Kubernetes manifests, Helm and Dockerfiles, for misconfigurations before deployment.
Trivy config scanningChoose it if you already run Trivy for images and want one scanner and one binary, accepting a smaller policy library and less depth for some resources.
tfsec (now part of Trivy)Choose Trivy's IaC scanning rather than a standalone tfsec for new setups, since the project has been folded into it.
Open Policy Agent with ConftestChoose it if you want to write all your policy in Rego against plan output and share one policy language with Kubernetes admission control.
Terraform Cloud or Sentinel policiesChoose them if your workflow already runs in HashiCorp's platform and you prefer policy enforcement integrated with plans and applies.
Cloud posture management (CSPM)Choose it in addition when you need continuous checks of deployed resources across accounts, which static scanning cannot provide.

Tools we use alongside Checkov

TerraformOpenTofuTerragruntKubernetesHelmAWS CloudFormationGitHub ActionsGitLab CIpre-commitSARIFOpen Policy AgentTrivyAtlantisInfracost

Frequently asked questions

What does Checkov scan?
Checkov scans infrastructure as code files for security and compliance misconfigurations. It supports Terraform and plan files, CloudFormation, Kubernetes manifests, Helm charts, Dockerfiles, ARM and Bicep templates and others, and can also detect some secrets. It reads code statically, so it does not need cloud credentials or to deploy anything.
Should we scan Terraform source or the plan?
Scanning source is simple and fast, but variables and module outputs may be unresolved. Scanning the JSON plan sees resolved values, which can reduce false results and catch issues created by module composition. Many teams scan both: source on every commit for speed, and the plan in the pull request pipeline for accuracy.
How do we adopt Checkov on an existing estate without a wall of failures?
Create a baseline of current findings and fail the pipeline only on new ones. Fix the highest-risk existing items first, such as public storage and open administration ports, then work down the rest on a schedule. Switching on a failing gate for all legacy findings on day one nearly always causes the gate to be removed.
How do we skip a check properly?
Add an inline skip comment next to the resource with the check ID and a short reason, so the exception is visible in code review and version history. Avoid global skips unless a check never applies to your architecture. Review skips periodically, because a reason that was valid a year ago may no longer hold.
Checkov or Trivy for IaC scanning?
Both find common misconfigurations. Checkov has a larger set of dedicated IaC policies, graph-based checks that relate resources to each other and a mature custom policy framework. Trivy is attractive when you want one tool across images and configuration. We often compare them on your repositories and choose based on signal and maintenance effort.
Can Checkov replace cloud security posture tools?
No. Checkov checks what is written in code before deployment. It cannot see resources created in the console, drift from the declared state or runtime behaviour. A posture tool or regular drift detection covers the deployed estate. The two together close the gap that either leaves alone.

Talk to an engineer about Checkov

Book a free 30-minute call. We review your current setup and tell you honestly whether and how we can help.

Written by Saddique Khan, DevOps / SRE / Cloud Consultant Engineer. Last updated 2026-10-09.