A lightweight, security-focused BDD test framework for Terraform that enables compliance and negative testing for infrastructure-as-code.
terraform-compliance is a lightweight, open-source test framework that uses behavior-driven development (BDD) to validate Terraform infrastructure-as-code for security and compliance. It enables negative testing by checking Terraform plans against predefined policies, ensuring configurations meet standards before deployment. The tool focuses on preventing misconfigurations in cloud resources by translating security requirements into readable test scenarios.
DevOps engineers, security teams, and infrastructure developers who use Terraform to manage cloud infrastructure and need to enforce compliance and security policies in their CI/CD pipelines.
Developers choose terraform-compliance because it provides a free, open-source alternative to HashiCorp Sentinel for policy enforcement, with a BDD approach that makes tests accessible to both technical and non-technical stakeholders. Its pre-deploy validation and easy integration into existing workflows help catch security issues early without slowing down development.
a lightweight, security focused, BDD test framework against terraform.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Specifically validates Terraform code against security standards and custom policies, preventing misconfigurations like unencrypted S3 buckets, as shown in the README examples.
Runs tests on Terraform plans before deployment, catching issues early in the development cycle to avoid costly post-deployment fixes.
Uses Gherkin syntax in .feature files, making tests accessible to both developers and non-technical stakeholders like security teams, bridging communication gaps.
Designed to run in pipelines or git hooks for automated compliance checks, with portable installation via pip or Docker as highlighted in the README.
Allows tests to be stored in separate repositories, enabling independent management by security teams without modifying Terraform code.
Exclusively works with Terraform, making it incompatible with other IaC tools, which limits its utility in multi-tool environments.
The README admits potential slowness and recommends faster parsing options, indicating it can be a bottleneck in fast-paced CI/CD setups.
Requires familiarity with Gherkin syntax and BDD principles, which might be a barrier for teams not already using these practices.
Only checks policies during the planning phase, missing runtime issues that could arise after infrastructure is deployed.
terraform-compliance is an open-source alternative to the following products: