All Projects → open-policy-agent → Conftest

open-policy-agent / Conftest

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

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to Conftest

opa-kafka-plugin
Open Policy Agent (OPA) plug-in for Kafka authorization
Stars: ✭ 46 (-97.75%)
Mutual labels:  open-policy-agent, openpolicyagent, rego
k8s-opa-boilerplate
Boilerplate example of managing OPA with kustomize
Stars: ✭ 14 (-99.32%)
Mutual labels:  open-policy-agent, rego
pre-commit-opa
Pre-commit git hooks for Open Policy Agent (OPA) and Rego development
Stars: ✭ 53 (-97.41%)
Mutual labels:  openpolicyagent, rego
awesome-opa
A curated list of OPA related tools, frameworks and articles
Stars: ✭ 316 (-84.56%)
Mutual labels:  open-policy-agent, openpolicyagent
Predictive Horizontal Pod Autoscaler
Horizontal Pod Autoscaler built with predictive abilities using statistical models
Stars: ✭ 132 (-93.55%)
Mutual labels:  hacktoberfest
Homebrew Openjdk
AdoptOpenJDK HomeBrew Tap
Stars: ✭ 1,798 (-12.16%)
Mutual labels:  hacktoberfest
Zebrunner
Zebrunner is a Test Automation Management Tool
Stars: ✭ 131 (-93.6%)
Mutual labels:  hacktoberfest
Docker Influxdb Grafana
A Docker container which runs InfluxDB and Grafana ready for persisting data
Stars: ✭ 130 (-93.65%)
Mutual labels:  hacktoberfest
Boop
A scriptable scratchpad for developers. In slow yet steady progress.
Stars: ✭ 2,425 (+18.47%)
Mutual labels:  hacktoberfest
Rawcms
RawCMS is the headless CMS written in asp.net core build for developers that embraces API first technology. Please give us a feedback!
Stars: ✭ 132 (-93.55%)
Mutual labels:  hacktoberfest
Email Outlook Message Perl
Email::Outlook::Message Perl module for reading Outlook .msg files
Stars: ✭ 131 (-93.6%)
Mutual labels:  hacktoberfest
Picsum Photos
Lorem Ipsum... but for photos.
Stars: ✭ 1,751 (-14.46%)
Mutual labels:  hacktoberfest
V by example
Learn V by Example
Stars: ✭ 131 (-93.6%)
Mutual labels:  hacktoberfest
Gadfly.jl
Crafty statistical graphics for Julia.
Stars: ✭ 1,724 (-15.78%)
Mutual labels:  hacktoberfest
Mentorship Backend
Mentorship System is an application that matches women in tech to mentor each other, on career development, through 1:1 relations during a certain period of time. This is the backend of this system.
Stars: ✭ 132 (-93.55%)
Mutual labels:  hacktoberfest
Showmethexaml
A WPF component making it easy to show the corresponding XAML for WPF custom styles and controls
Stars: ✭ 130 (-93.65%)
Mutual labels:  hacktoberfest
Simplebluetoothlibrary
Android library for simplifying bluetooth usage.
Stars: ✭ 131 (-93.6%)
Mutual labels:  hacktoberfest
Pesy
Project configuration for esy
Stars: ✭ 132 (-93.55%)
Mutual labels:  hacktoberfest
Umodbus
Python implementation of the Modbus protocol.
Stars: ✭ 129 (-93.7%)
Mutual labels:  hacktoberfest
Shuffle
Shuffle every song in existence from YouTube
Stars: ✭ 131 (-93.6%)
Mutual labels:  hacktoberfest

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 How do I write policies in the Open Policy Agent documentation.

Here's a quick example. Save the following as policy/deployment.rego:

package main

deny[msg] {
  input.kind == "Deployment"
  not input.spec.template.spec.securityContext.runAsNonRoot

  msg := "Containers must not run as root"
}

deny[msg] {
  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?

For discussions and questions join us on the Open Policy Agent Slack in the #opa-conftest channel.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].