# Compliance as code packages control checks as deployable rule bundles, and most cloud bundles report rather than block

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

Compliance as code means expressing control checks as files a machine can deploy and run. AWS Config conformance packs bundle Config rules and remediation actions, Azure Policy ships regulatory compliance initiatives, and the ComplianceAsCode project publishes host hardening content. Read on 16 Nov 2026, this page separates those bundles from guardrails that block.

## Four kinds of bundle exist, and they differ in where they run

Cloud Custodian's documentation also has a Compliance as Code section; see [Cloud Custodian](/engines/cloud-custodian/) for the engine.

| Bundle | What AWS, Microsoft or the project says | Runs against |
| --- | --- | --- |
| AWS Config conformance pack | A collection of AWS Config rules and remediation actions, deployed as a single entity in an account and Region or across an organization; authored as a YAML template | AWS resource configuration |
| Azure Policy regulatory compliance initiative | Built-in initiative definitions listing controls and compliance domains by responsibility (Customer, Microsoft, Shared); the feature is marked Preview | Azure resources |
| AWS Control Tower control groups | Controls are grouped by objective, framework, service and group, with a Frameworks category of industry-standard compliance frameworks | AWS accounts in an OU |
| ComplianceAsCode content | Security automation content in SCAP, Bash, Ansible and other formats; repository topics include pci-dss, stig and security-hardening | Hosts and configurations |

## A bundle that reports does not stop the change that breaks it

AWS says Config rules implement Control Tower's detective controls, which detect noncompliance after a resource exists and alert through a dashboard. Preventive controls are the ones implemented with service control policies and resource control policies. A conformance pack of Config rules is on the reporting side, though AWS also lets a pack carry remediation actions.

This is the point where compliance as code meets the subject of this site. A pack that says an S3 bucket is public tells you after the fact. A guardrail such as [Deny changes to S3 Block Public Access at bucket level](/guardrails/aws-rcp-deny-bucket-public-access-block-changes/) prevents the change. The split is explained in [preventive vs detective controls](/guides/preventive-vs-detective-controls/).

## Azure's initiative structure carries the compliance mapping inside the policy file

Microsoft documents that an initiative definition is JSON that groups related policy definitions so they can be assigned as one item. It also contains policy groups, a property that belongs to the Regulatory Compliance (Preview) feature. The mapping from policy to control therefore lives in the initiative file itself.

The built-in initiatives page lists items by standard, including a HITRUST/HIPAA initiative and PCI DSS v4. Microsoft says the controls map to the corresponding compliance standard, and that existing compliance standard initiatives are being updated to support Regulatory Compliance. Assigning one is the same act as assigning any policy: it can start in audit and later be enforced, as in [Azure Policy as a guardrail](/guides/azure-policy-as-a-guardrail/).

## Four questions decide whether a bundle fits a guardrail program

The questions are this page's own checklist, built from the documented behavior above.

- Does the bundle block, or only report? Read the effect or the control type, not the bundle name.
- Does it cover accounts that are not enrolled? AWS says detective controls apply to enrolled accounts only.
- Can it be tried first? Azure assignments can use DoNotEnforce, and Config rules can be deployed and read before remediation is attached.
- Who owns an exception, and when does it end? See [guardrail exceptions and waivers](/guardrail-exceptions-and-waivers/).

## Passing the rules is evidence about configuration, not proof that a control is met

A rule bundle checks the settings its authors encoded. A control statement in a standard may need an interview, a log review or a process. Which framework control each rule satisfies is a mapping job that this page does not cover.

What a team can do with a bundle is keep the checks in version control, run them on a schedule and keep each result. For the engines that run such checks, see [policy as code tools](/policy-as-code-tools/), and for the layer of rules that block, see the [library](/library/) and the [method](/method/).

## Related pages

- [Policy as code tools: five engines by the same eight fields](/policy-as-code-tools/)
- [Open Policy Agent: fields, version and testing](/engines/open-policy-agent/)
- [HashiCorp Sentinel: fields, version and testing](/engines/hashicorp-sentinel/)
- [All of them](/guides/)

## Sources

- AWS Config: conformance packs: https://docs.aws.amazon.com/config/latest/developerguide/conformance-packs.html (read 16 Nov 2026)
- Microsoft: regulatory compliance in Azure Policy: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/regulatory-compliance (read 16 Nov 2026)
- Microsoft: initiative definition structure: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/initiative-definition-structure (read 16 Nov 2026)
- Microsoft: built-in initiatives: https://learn.microsoft.com/en-us/azure/governance/policy/samples/built-in-initiatives (read 16 Nov 2026)
- AWS Control Tower: proactive controls: https://docs.aws.amazon.com/controltower/latest/controlreference/proactive-controls.html (read 10 Nov 2026)
- AWS Control Tower: detective controls: https://docs.aws.amazon.com/controltower/latest/controlreference/detective-controls.html (read 10 Nov 2026)
- GitHub: ComplianceAsCode/content: https://github.com/ComplianceAsCode/content (read 16 Nov 2026)
- Cloud Custodian: quick start: https://cloudcustodian.io/docs/quickstart/index.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/compliance-as-code/
