# aws-cloudformation/cloudformation-guard

Guard offers a policy-as-code domain-specific language (DSL) to write rules and validate JSON- and YAML-formatted data such as CloudFormation Templates, K8s configurations, and Terraform JSON plans/configurations against those rules. Take this survey to provide feedback about cfn-guard: https://amazonmr.au1.qualtrics.com/jfe/form/SV_bpyzpfoYGGuuUl0

Repository: https://github.com/aws-cloudformation/cloudformation-guard
Canonical: https://ross.abutalabs.com/products/cloudformation-guard
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: policy-as-code, cloudformation, terraform, k8s, policy-rule-evaluation, governance, security, compliance, cfn-guard
Last push: 2026-08-26T15:44:17+00:00

## Health v2 (maintenance only)
Score: 88/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 67, longevity 100
- inputs: {"age_days": 2273, "days_push": 7, "days_rel": 8, "gap_med": 318.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1385, forks 196 (observed 2026-08-28T04:04:34.819487+00:00)

## What it is
AWS CloudFormation Guard (cfn-guard) is a general-purpose policy-as-code evaluation tool with an expressive DSL for defining rules. It validates JSON- and YAML-formatted structured data such as CloudFormation templates, Terraform JSON plans, and Kubernetes configurations against those policies.

## Use cases
- validate cloudformation templates against security and compliance policies
- check terraform plan  for deployment safety before applying
- enforce organizational rules on kubernetes configurations
- detect live state deviations in terraform state files
- validate cloudformation changesets in ci/cd pipelines to prevent unsafe replacements
- continuously monitor aws config configuration items for policy violations
- shift-left governance checks for infrastructure-as-code

## When to choose
- you need a declarative DSL to write policy rules for JSON/YAML structured data
- you want to enforce security, compliance, or governance checks on IaC before deployment
- you need to gate CloudFormation, Terraform, or Kubernetes changes in CI/CD pipelines
- you want a Rust-based CLI with lambda deployment options for policy evaluation

## When to avoid
- you need policy evaluation for formats other than JSON/YAML structured data
- you rely on Guard 1.0 rules without migrating, since 2.0+ is backward incompatible
- you need runtime runtime enforcement of deployed resources rather than static/config validation

## Facets
- artifact type: cli-tool
- maturity: active
- function: security, testing, configuration-management, cli, parser
- domain: security, cloud-computing, infrastructure-as-code, legal
- platform: windows, cli, rust
- tags: policy-as-code, cloudformation, terraform, kubernetes, governance, compliance, iac-validation, shift-left, devops, linux, macos

## Member repositories
- aws-cloudformation/cloudformation-guard (main) score 88

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:34.819487+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:39:56.461762+00:00, confidence not recorded.
  - readme: https://github.com/aws-cloudformation/cloudformation-guard (fetched 2026-08-28T04:04:34.819487+00:00, sha 00128bddc8ab)
- Data as of 2026-08-30T08:39:29.467469+00:00.
