Skip to main content

Policy Testing OPA Ecosystem Projects

These projects from the OPA ecosystem help with or support running of tests on Rego code.

Regal

Regal is a useful step to use when testing Rego policies to ensure code is correct and free of common errors. See the README to get started.

View Details

Conftest

Conftest supports unit testing of policy and has a number of extra language features for working with configuration files. The functionality is documented here.

View Details

Vulnetix

Vulnetix ships with 250+ built-in Rego rules spanning SCA, IaC, container, secrets, SAST, license and SBOM checks, and lets teams extend coverage with their own policy-as-code rule repositories via the --rule flag. See the Code Scanner docs for details.

View Details

raygun

Raygun makes it easier to test Rego code in a "real-world" facsimile.

View Details

rego-test-assertions

The rego-test-assertions library contains various assertion functions, which will print the expected result vs. the outcome to the console on failure.

View Details

GitHub Action for OPA Rego Test

GitHub Action for OPA Rego Policy Tests automates testing for your OPA (Open Policy Agent) Rego policies, generates a report with coverage information, and posts the test results as a comment on your pull requests, making it easy for your team to review and approve policies.

View Details