CheckOps
Conftest
Conftest is an Apache-2.0 CLI from the Open Policy Agent project for writing Rego tests against structured configuration such as Kubernetes YAML, Terraform, Dockerfiles and JSON.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
Conftest is a utility for writing tests against structured configuration data. The policies are written in Rego, the Open Policy Agent language, and Conftest runs them against files such as Kubernetes manifests, Tekton pipelines, Terraform code, Serverless configs, Dockerfiles or any JSON, YAML, HCL, TOML, INI or XML document.
It exists to make OPA easy to use in CI. Instead of wiring the OPA engine into a pipeline yourself, you place policies in a policy/ directory and run conftest test deployment.yaml. Rules named deny, violation or warn produce failures or warnings with readable messages, and the exit code fails the build when a deny rule matches.
Conftest understands many file formats out of the box, can parse multiple files together, and can pull shared policies from OCI registries, Git or HTTP so one central policy repository serves many projects. It also has a verify command that runs Rego unit tests for the policies themselves.
In the quality loop, Conftest is a lightweight release gate for configuration. It catches problems like containers running as root, missing resource limits or unapproved base images before anything is applied to a cluster or cloud account.
The source code is at open-policy-agent/conftest on GitHub under the Apache-2.0 licence, with about 3,300 stars; the most recent commit was on 11 November 2026.
Features
- Many formats: YAML, JSON, HCL, TOML, INI, XML, Dockerfile, CUE and more.
- deny and warn rules: Distinguish hard failures from advisory warnings.
- Policy sharing:
conftest pullfetches policies from OCI registries, Git or HTTP. - Policy tests:
conftest verifyruns unit tests for Rego rules. - Multiple outputs: Table, JSON, TAP, JUnit and GitHub annotations for CI.
- Namespaces: Organise policies by namespace and select them per run.
Pros
- Simple CI integration: One binary and one command per check.
- Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 11 November 2026.
- Community: About 3,300 GitHub stars.
Cons
- Rego required: Teams still need to learn OPA’s language.
- Static only: It checks files, not live cluster state.
- Policy authoring: No large built-in rule set; you write or import rules.
Usage and Links (Example)
# policy/deployment.rego
cat > policy/deployment.rego <<'R'
package main
deny contains msg if {
input.kind == "Deployment"
not input.spec.template.spec.securityContext.runAsNonRoot
msg := "Containers must not run as root"
}
R
conftest test k8s/deployment.yaml
conftest test --output junit k8s/ > conftest.xml
Resources:
Pricing
Conftest is free and open source under the Apache-2.0 licence.
Recommended for?
- Teams already using OPA who want the same rules in CI.
- Platform teams enforcing configuration standards across many repositories.
- Projects with mixed config formats that need one checking tool.
Conclusion
Conftest is the quickest way to bring policy-as-code into a pipeline. It keeps OPA’s power while hiding most of the integration work.
If your team can invest in a small Rego policy library, Conftest gives you a fast, format-agnostic gate for configuration changes.
On CheckOps, Conftest is filed under the Release & CI gates and Security testing stages. Related tools listed here include Open Policy Agent, Checkov, KICS, Kyverno, KubeLinter and Hadolint. Which one fits best depends mostly on your stack, your team’s size and skills, and whether you prefer to run tools yourself or pay for a managed service. This page reflects the official website, documentation and repository as they stood on 11 November 2026.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with Conftest side by side.
OOpen Policy AgentOpen Policy Agent (OPA) is an Apache-2.0, CNCF-graduated general-purpose policy engine that evaluates Rego policies for Kubernetes, CI pipelines, APIs, Terraform and more.Compare with Conftest
CCheckovCheckov is an Apache-2.0 static analysis tool for infrastructure as code (Terraform, CloudFormation, Kubernetes, Helm, Dockerfile and more) that also does SCA for images and open-source packages.Compare with Conftest
KKICSKICS (Keeping Infrastructure as Code Secure) is Checkmarx's Apache-2.0 open-source scanner for security vulnerabilities, compliance issues and misconfigurations in infrastructure-as-code.Compare with Conftest
KKyvernoKyverno is an Apache-2.0, CNCF policy engine for Kubernetes that validates, mutates, generates and cleans up resources using YAML and CEL policies, with a CLI for testing policies in CI.Compare with Conftest
KKubeLinterKubeLinter is StackRox's Apache-2.0 static analysis tool that checks Kubernetes YAML files and Helm charts against best practices for security and production readiness.Compare with Conftest
HHadolintHadolint is a GPL-3.0 Dockerfile linter written in Haskell that checks best practices and validates inline bash in RUN instructions using ShellCheck.Compare with Conftest