Skip to content
SPECIFICTION
Get listed

cfn-nag vs Conftest

cfn-nag

github.com

Conftest

conftest.dev

Side by side

Figurecfn-nagConftest
Price fromFreeFree
Free planYesYes
Free trial——
Open source——
Windows—Yes
macOSYesYes
LinuxYesYes
Self-hostedYes—
Plans published11
Spec score · Infrastructure Testing Tools8.0 (#9)8.4 (#4)
Spec score · Infrastructure as Code Security Software7.9 (#14)8.4 (#7)
Purposecfn-nag scans CloudFormation templates for patterns that may indicate insecure infrastructure.Conftest is a utility for writing tests against structured configuration data.
SupportThe project directs users to submit bug reports and feature requests through its GitHub issue tracker.Questions and discussions are directed to the Open Policy Agent Slack channel `#opa-conftest`.

Plans

cfn-nag

  • cfn-nagFree

cfn-nag pricing →

Conftest

  • Open-source ConftestFree

Conftest pricing →

In their own words

cfn-nag

cfn-nag is free, MIT-licensed software that scans AWS CloudFormation templates for patterns that may indicate insecure infrastructure. It checks for overly permissive IAM policies and security-group rules, disabled access logging or encryption, and password literals. The scanner accepts JSON, .template, YAML, and YML files, and recursively processes subdirectories when given a directory. Results print to standard output, with JSON output available; failures return a non-zero exit code while warnings return success. Installation is documented through RubyGems and Homebrew, with Ruby 2.5 or later required for gem installation. A Dockerfile and Docker Hub image are provided. cfn-nag can run in GitHub Actions and AWS CodePipeline. Profiles, deny lists, per-resource suppressions, and custom rules support policy tailoring. Static analysis needs supplied parameter values to assess them and does not inspect false Fn::If outcomes by default.

Visit github.com

Conftest

Conftest is a free utility for testing structured configuration data, designed for use in CI environments. It uses the Open Policy Agent Rego language to express policies, then evaluates deny, violation, and warning rules within namespaces. Configuration can be read from individual files, directories, multiple files, or standard input. Supported inputs include Kubernetes-style YAML, JSON, HCL and HCL2, Dockerfiles, Terraform-related data, JSONnet, TOML, and XML. Results can be output as plaintext, JSON, TAP, table, JUnit, GitHub, Azure DevOps, or SARIF; the GitHub outputter can annotate test results in workflows. The `conftest verify` command runs policy unit tests. Policies can be pulled from HTTPS URLs, Git repositories, and OCI registries, or pushed to compatible OCI registries. Plugins extend the CLI, with downloads available from sources including OCI, Git, HTTP/HTTPS, Mercurial, and cloud storage. Pre-commit hooks support policy workflows, and integrations are documented for CircleCI, GitHub Actions, and Tekton. Conftest is available for Linux, macOS, and Windows.

Visit conftest.dev