{"id":13451531,"url":"https://github.com/open-policy-agent/conftest","last_synced_at":"2026-04-15T07:02:35.748Z","repository":{"id":37345692,"uuid":"178249461","full_name":"open-policy-agent/conftest","owner":"open-policy-agent","description":"Write tests against structured configuration data using the Open Policy Agent Rego query language","archived":false,"fork":false,"pushed_at":"2025-05-07T17:01:54.000Z","size":4697,"stargazers_count":2965,"open_issues_count":43,"forks_count":312,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-07T20:34:40.368Z","etag":null,"topics":["kubernetes","open-policy-agent","openpolicyagent","rego","testing"],"latest_commit_sha":null,"homepage":"https://conftest.dev","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-policy-agent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-28T17:12:29.000Z","updated_at":"2025-05-07T15:17:35.000Z","dependencies_parsed_at":"2023-07-13T21:39:06.008Z","dependency_job_id":"ab12697a-2413-4b47-b259-bbd86c5d6bf1","html_url":"https://github.com/open-policy-agent/conftest","commit_stats":{"total_commits":853,"total_committers":114,"mean_commits":7.482456140350878,"dds":0.7995310668229777,"last_synced_commit":"66b0970487d514b3826723e460d7246ac8f1c99b"},"previous_names":["instrumenta/conftest"],"tags_count":85,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-policy-agent%2Fconftest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-policy-agent%2Fconftest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-policy-agent%2Fconftest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-policy-agent%2Fconftest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-policy-agent","download_url":"https://codeload.github.com/open-policy-agent/conftest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227605,"owners_count":22035668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kubernetes","open-policy-agent","openpolicyagent","rego","testing"],"created_at":"2024-07-31T07:00:55.293Z","updated_at":"2026-04-02T22:41:17.383Z","avatar_url":"https://github.com/open-policy-agent.png","language":"Go","funding_links":[],"categories":["Go","Development","Tools and Libraries","Other Awesome Lists","Инструменты","Official projects","Configuration Management","testing","kubernetes","3）参考实现与开源工具（GitHub）","Policy as Code"],"sub_categories":["Time Series","Testing and Troubleshooting","Open Policy Agent (OPA)","IAC Security","Repositories","Harness / 平台工程","Runtime Security"],"readme":"# Conftest\n\n[![Go Report Card](https://goreportcard.com/badge/open-policy-agent/opa)](https://goreportcard.com/report/open-policy-agent/conftest) [![Netlify](https://api.netlify.com/api/v1/badges/2d928746-3380-4123-b0eb-1fd74ba390db/deploy-status)](https://app.netlify.com/sites/vibrant-villani-65041c/deploys)\n\nConftest helps you write tests against structured configuration data. Using Conftest you can\nwrite tests for your Kubernetes configuration, Tekton pipeline definitions, Terraform code,\nServerless configs or any other config files.\n\nConftest uses the Rego language from [Open Policy Agent](https://www.openpolicyagent.org/) for writing\nthe assertions. You can read more about Rego in the [Policy Language](https://www.openpolicyagent.org/docs/policy-language)\nsection in the Open Policy Agent documentation.\n\nHere's a quick example. Save the following as `policy/deployment.rego`:\n\n```rego\npackage main\n\ndeny contains msg if {\n  input.kind == \"Deployment\"\n  not input.spec.template.spec.securityContext.runAsNonRoot\n\n  msg := \"Containers must not run as root\"\n}\n\ndeny contains msg if {\n  input.kind == \"Deployment\"\n  not input.spec.selector.matchLabels.app\n\n  msg := \"Containers must provide app label for pod selectors\"\n}\n```\n\nAssuming you have a Kubernetes deployment in `deployment.yaml` you can run Conftest like so:\n\n```console\n$ conftest test deployment.yaml\nFAIL - deployment.yaml - Containers must not run as root\nFAIL - deployment.yaml - Containers must provide app label for pod selectors\n\n2 tests, 0 passed, 0 warnings, 2 failures, 0 exceptions\n```\n\nConftest 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](https://www.conftest.dev/) for [installation instructions](https://www.conftest.dev/install/) and\nmore details about the features.\n\n## Want to contribute to Conftest?\n\n* See [DEVELOPMENT.md](DEVELOPMENT.md) to build and test Conftest itself.\n* See [CONTRIBUTING.md](CONTRIBUTING.md) to get started.\n\nFor discussions and questions join us on the [Open Policy Agent Slack](https://slack.openpolicyagent.org/)\nin the `#opa-conftest` channel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-policy-agent%2Fconftest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-policy-agent%2Fconftest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-policy-agent%2Fconftest/lists"}