# The rewrite that never ships: homegrown AWS compliance automation vs. the platform

On 13 November 2026 AWS made [AWS Organizations declarative policies](https://aws.amazon.com/about-aws/whats-new/2026/11/security-hub-cspm-org-policies/) the recommended way to manage Security Hub CSPM across an organization. The model they replace, [central configuration](https://docs.aws.amazon.com/securityhub/latest/userguide/central-configuration-intro.html), only arrived in November 2023. Four days later AWS Config added [managed conformance packs](https://aws.amazon.com/about-aws/whats-new/2026/11/aws-config-managed-conformance-packs), which AWS describes this way: "you no longer have to track framework changes or update rules yourself."

Plenty of AWS estates use neither model. Their Security Hub is switched on and tuned by scripts written in 2019 or 2020: a Lambda that enables standards in new accounts, a cron job that disables controls nobody wanted, a Python tool that walks every account and Region to collect compliance status. When someone proposes the managed features, adoption is often queued behind a cleanup of the existing automation.

That rewrite is the problem.

## What AWS has shipped since your scripts were written

Most homegrown governance tooling solves a problem AWS has since turned into a feature. The dates matter, because they show how long a team has been rebuilding something it could have switched on.

| When | AWS feature | The homegrown pattern it replaces |
|---|---|---|
| Nov 2019 / May 2020 | [Config conformance packs](https://aws.amazon.com/about-aws/whats-new/2019/11/introducing-aws-config-conformance-packs) deployed across the organization, later from a delegated administrator | A pipeline that pushes Config rules account by account |
| Aug 2022 | [Config custom rules in CloudFormation Guard](https://aws.amazon.com/about-aws/whats-new/2022/08/build-aws-config-rules-cloudformation-guard), "without needing to develop AWS Lambda functions" | One Lambda function per custom check |
| Nov 2022 | [Config proactive evaluation](https://aws.amazon.com/about-aws/whats-new/2022/11/aws-config-rules-support-proactive-compliance), checking rules before resources are provisioned | Pre-deployment linting scripts |
| Feb 2023 | Security Hub consolidated control findings: one finding per check across standards | Deduplication logic in the reporting tool |
| Jun 2023 | [Security Hub automation rules](https://aws.amazon.com/about-aws/whats-new/2023/06/aws-security-hub-automation-rules) to update or suppress findings | EventBridge rule plus Lambda for suppression |
| Jun 2023 | [Control Tower and Security Hub integration](https://aws.amazon.com/about-aws/whats-new/2023/06/aws-control-tower-account-integration-security-hub) | Scripts that enable detective checks in governed accounts |
| Nov 2023 | Security Hub central configuration: standards, controls and Regions per account or OU | The "enable Security Hub everywhere" Lambda |
| Nov 2023 | [IAM Access Analyzer unused access](https://aws.amazon.com/about-aws/whats-new/2023/11/iam-access-analyzer-inspecting-unused-access), centralised through a delegated administrator | Scripts that scan for stale roles and keys |
| Nov 2024 | Resource control policies (RCPs) in AWS Organizations | Detective checks for resources shared outside the organization |
| Dec 2024 | [Declarative policies](https://aws.amazon.com/about-aws/whats-new/2024/12/aws-declarative-policies), starting with EC2 | Config rules and remediation for settings that should never drift |
| Nov 2025 | [Control Tower controls without a full landing zone](https://aws.amazon.com/about-aws/whats-new/2025/11/aws-control-tower-controls-dedicated-experience): "over 750 managed controls" | A custom control library maintained in a Git repository |
| Nov 2026 | Security Hub CSPM declarative policies | Central configuration, and everything homegrown that imitated it |
| Nov 2026 | Config managed conformance packs, maintained by AWS | Updating framework rule sets by hand |

AWS Organizations now has declarative policy types for Inspector and GuardDuty as well. The direction is consistent. Settings that used to need code are becoming policies attached to the organization tree. The Organizations documentation says declarative policies are "always maintained when the service adds new features or APIs." No internal script comes with that guarantee.

## The rewrite that comes before adoption

A team owns custom governance automation that grew over the years. The code is old, the tests are thin, and parts of it nobody remembers writing. Someone proposes Security Hub central configuration, or conformance packs, or the Control Tower control catalog. The owner agrees in principle and adds a condition: first the existing automation has to be cleaned up and rewritten. The usual justification is technical debt, and it sounds reasonable.

Then the rewrite becomes the project. It produces the same checks in nicer Python, with a new framework, new CI and a new deployment model. The managed feature stays on the backlog, with no date. In three years AWS has changed the recommended model twice, and a multi-quarter rewrite can easily outlast one of those changes.

The rewrite looks like work, and it is work. It fills sprints and produces visible progress, which makes it easy to keep funding. But rewriting code that duplicates a managed service does not reduce technical debt, because the debt is the duplication itself, and a rewrite renews it for another five years.

The incentives keep it going:

- Custom stacks concentrate knowledge in one or two people, and a rewrite keeps it there. Nobody has to intend that for it to happen.
- Few review boards include someone who tracks the AWS release notes closely enough to say "this script is a feature now".
- Platform governance often has no single owner with both the time and the mandate to compare the custom stack with the current catalog.
- Adoption has no date, and the review process never asks for one.

None of this needs bad faith, only a decision with no clear owner.

## What the homegrown stack actually costs

The cost sits where custom code lags the platform.

New controls and standards reach a managed configuration without you. Security Hub CSPM added CIS AWS Foundations Benchmark v5.0.0 in October 2025, and the [standards list](https://docs.aws.amazon.com/securityhub/latest/userguide/standards-reference.html) now includes an AI Security Best Practices standard and NIST SP 800-171. A managed configuration picks these up with a policy change. A script picks them up when someone notices, writes the change, tests it and gets it deployed.

With scripts, new accounts and Regions depend on someone remembering. Declarative policies attached to an OU apply to accounts that join or move into it. A script applies to the accounts it was told about, in the Regions someone hard-coded in 2020.

Auditors ask for evidence. Security Hub standards and Config conformance packs map to named frameworks, CIS, NIST, PCI DSS, and produce scores and findings an auditor already recognises. A custom tool produces a custom report, and someone has to explain it every year.

The bus factor is one. When the one person who knows the code is unavailable, nobody changes the controls. When the owner leaves, the organization inherits a codebase it never chose.

A missed control in a new Region, or an account that never got its baseline, is the kind of misconfiguration that ends up in an incident report. Attackers do not check whether your compliance tooling is mid-rewrite.

## Should I move from Security Hub central configuration to declarative policies?

For a new setup, AWS answers this directly: "If you're setting up multi-account management for the first time, use Security Hub CSPM declarative policies instead of enabling central configuration." Central configuration is not deprecated, and the announcement says it "remains available until you're ready to switch", but it is no longer the recommended path.

For an existing central configuration, plan the move, because the two models are [mutually exclusive](https://docs.aws.amazon.com/securityhub/latest/userguide/orgs-policies-and-central-config.html) and the switch is organization-wide:

> When a Security Hub CSPM declarative policy first governs an account in your organization, Security Hub CSPM disables central configuration for the entire organization. This happens even if the declarative policy governs only a single account.

So the instinctive safe test, one policy on one account, is the one move that turns off central configuration everywhere. Accounts that central configuration governed and no declarative policy covers keep their current settings and become self-managed. The only exception is a policy attached to an OU with no accounts in it. Test in a separate sandbox organization, not in a corner of production.

For the real migration, AWS provides an import tool in the Security Hub console. Only the delegated administrator can use it, only while central configuration is enabled. It creates one declarative policy per configuration policy and attaches each to the same targets; AWS says "to move your full configuration without coverage gaps, use the import tool." Going back is possible: detach every Security Hub CSPM declarative policy, then set `ConfigurationType` to `CENTRAL` with `UpdateOrganizationConfiguration`. While any declarative policy is still attached, that call fails with a `ConflictException`.

If you are on neither model and still run scripts, there is no reason to adopt central configuration now. Go straight to declarative policies.

## Should we replace custom AWS Config rules and Lambda checks with conformance packs?

Mostly, yes. The managed conformance packs announced in November 2026 are built and maintained by AWS for specific frameworks and deploy across Regions without a template per Region. The [sample conformance pack templates](https://docs.aws.amazon.com/config/latest/developerguide/conformancepack-sample-templates.html) already cover CIS, NIST 800-53, NIST CSF, PCI DSS, HIPAA and others. AWS is careful to say they "are not designed to ensure your compliance with a specific governance standard", and that is true of custom rules too.

Keep custom rules for policies that really are yours: a naming convention, an internal data classification tag, a network design rule. Write them in CloudFormation Guard instead of Lambda where possible, deploy them through an organization conformance pack, and use proactive evaluation to catch violations before resources exist. Config charges per rule evaluation and per conformance pack evaluation, so duplicating a managed check with a custom one also means paying twice for the same answer.

## We already have Control Tower. Isn't that enough?

Not by itself. Control Tower governs what it deploys and the controls you enable through it. Security Hub standards, Config rules and conformance packs configured outside it, by hand or by script, are not part of that governance.

Control Tower manages its own Security Hub standard, the [Service-Managed Standard: AWS Control Tower](https://docs.aws.amazon.com/securityhub/latest/userguide/service-managed-standard-aws-control-tower.html), a subset of AWS Foundational Security Best Practices. When you enable one of its Security Hub controls, Control Tower also enables Security Hub CSPM in those accounts and Regions if needed. That standard can only be managed from Control Tower: "Central configuration can't be used to manage Service-Managed Standard: AWS Control Tower." The other standards, FSBP, CIS, NIST, PCI DSS, are configured through Security Hub's own organization mechanism, which is now declarative policies.

Control Tower's [controls](https://docs.aws.amazon.com/controltower/latest/controlreference/control-behavior.html) come in three kinds: preventive controls "implemented using Service Control Policies (SCPs), Resource Control Policies (RCPs), and declarative policies", detective controls "implemented using AWS Config rules", and proactive controls "implemented using AWS CloudFormation hooks". Since November 2025 the catalog of more than 750 controls is available even without a full landing zone, on an existing organization.

Two more points for Control Tower shops:

- Custom baseline configuration for new accounts has official channels: [Account Factory for Terraform](https://docs.aws.amazon.com/controltower/latest/userguide/taf-account-provisioning.html) and [Customizations for Control Tower](https://docs.aws.amazon.com/controltower/latest/userguide/customize-landing-zone.html), both GitOps-style and tied to account lifecycle events. A separate script that configures accounts after Control Tower creates them is a second, unofficial baseline.
- Updating the landing zone is your job. The [documentation](https://docs.aws.amazon.com/controltower/latest/userguide/configuration-updates.html) is blunt: "It is the responsibility of the members of your central cloud administrators' team to keep your landing zone updated." Landing zone 4.0 (November 2025) changed how Control Tower integrates with Config, CloudTrail and other services. Custom scripts written against the old structure may now be configuring things Control Tower does differently.

## Should we finish rewriting our automation before adopting AWS-native controls?

No. Reverse the order.

1. Adopt the managed baseline first: Security Hub CSPM declarative policies for standards and controls, managed or sample conformance packs for frameworks, Control Tower controls where you already run Control Tower, Organizations policies for settings that must never drift.
2. List every custom script and map it to the AWS feature it duplicates. Most will map to something in the table above.
3. Keep custom code only for checks with no managed equivalent, and write those in Guard or as Config custom rules deployed through the organization.
4. Give every script you keep a decommission condition: the AWS feature that would replace it, and a review date.

This produces coverage in weeks instead of quarters, and it leaves the team maintaining a small set of rules that are really specific to the organization.

## Questions for a governance review

These questions are fair in any review of custom governance automation, and they work better than a debate about Python versus policies:

- Which AWS feature does each script duplicate, and when was that feature released?
- What happens, step by step, when a new account is created? And when a new Region is enabled?
- How long after AWS supported CIS v5.0.0 was it enabled across the organization?
- If the owner of a script is unavailable for a month, who can change a control, and how?
- Which part of the rewrite cannot be done by a declarative policy, a conformance pack or a Control Tower control?
- What is the date for adopting the managed feature, and what is the date for switching off the script it replaces?

AWS will ship the next governance feature whether or not the rewrite is finished.

<p class="ai-disclaimer">Drafted with AI assistance from notes I took during real work.</p>
