Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
conftest — Write tests against structured configuration data using the Open Policy Agent Rego query language | Kitploit
Tools/GitHubGitHub/open-policy-agent/conftest
Cloud Infrastructure SecurityStatic AnalysisConfiguration AuditingDevSecOpsMisconfiguration
GitHubopen-policy-agent/conftest

conftest

Write tests against structured configuration data using the Open Policy Agent Rego query language

View Repository
3.2k35513h 9m agoReviewed by Kitploit

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
Website

Conftest

Go Report Card Netlify

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:

root@kitploit:~
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:

root@kitploit:~
$ 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.

Download Tool