open-policy-agent/conftest
open-policy-agent/conftest has 3,297 GitHub stars and 365 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-06 18:43 UTC. Last push 2026-11-02.
Write tests against structured configuration data using the Open Policy Agent Rego query language
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalConftest
Conftest helps you write tests against structured configuration data. Using Conftest you can write tests for your Kubernetes configuration, Tekton pipeline definitions, Terraform code, Serverless configs or any other config files.
Conftest uses the Rego language from Open Policy Agent for writing the assertions. You can read more about Rego in the Policy Language section in the Open Policy Agent documentation.
Here's a quick example. Save the following as policy/deployment.rego:
package main
deny contains msg if {
input.kind == "Deployment"
not input.spec.template.spec.securityContext.runAsNonRoot
msg := "Containers must not run as root"
}
deny contains msg if {
input.kind == "Deployment"
not input.spec.selector.matchLabels.app
msg := "Containers must provide app label for pod selectors"
}
Assuming you have a Kubernetes deployment in deployment.yaml you can run Conftest like so:
$ conftest test deployment.yaml
FAIL - deployment.yaml - Containers must not run as root
FAIL - deployment.yaml - Containers must provide app label for pod selectors
2 tests, 0 passed, 0 warnings, 2 failures, 0 exceptions
Conftest isn't specific to Kubernetes. It will happily let you write tests for any configuration files in a variety of different formats. See the documentation for installation instructions and more details about the features.
Want to contribute to Conftest?
- See DEVELOPMENT.md to build and test Conftest itself.
- See CONTRIBUTING.md to get started.
For discussions and questions join us on the Open Policy Agent Slack
in the #opa-conftest channel.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,417 starspublic-apis/public-apis
A collective list of free APIs
496,752 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
437,885 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,065 stars