
From Detection to Action: Automating IAM Access Analyzer with Cloud Custodian
Cloud governance needs more than detecting missing security controls. A merged Cloud Custodian enhancement adds policy-driven management of external-access analyzers, helping teams turn a missing-control finding into an automated action.
A security policy can identify a missing control—but someone still has to close the gap.
Cloud Custodian pull request #11178 , merged on October 17, 2026, adds the
set-access-analyzer action for AWS accounts.Here’s what Cloud Custodian does, why this capability matters, and what the contribution enables.
What is Cloud Custodian?
Cloud Custodian is an open-source tool for managing cloud resources through policies written in YAML. It supports AWS, Azure, and Google Cloud.
A policy brings together three building blocks:
- Resources: what to inspect, such as AWS accounts or Amazon EC2 instances.
- Filters: which resources match a condition.
- Actions: what to do with those resources.
This lets teams express governance requirements as version-controlled configuration instead of maintaining a separate script for every check. Policies can support security controls, tagging standards, and cost management. Depending on the configuration, they can run periodically or respond to cloud events. Cloud Custodian overview
What problem does it solve?
As cloud environments grow, repeating manual checks becomes difficult.
Which resources are missing required tags? Which instances should stop outside working hours? Which accounts are missing a security control?
Cloud Custodian provides a common way to define these rules, identify matching resources, and take supported actions. Teams can review policy changes in Git and use dry runs to inspect matches before executing actions. Cloud Custodian documentation
This change focuses on one specific security-control gap: missing IAM Access Analyzer external-access analyzers.
Why IAM Access Analyzer matters
IAM Access Analyzer external-access analyzers examine supported resource-based policies to identify access from outside a configured account or organization—the analyzer’s “zone of trust.”
For example, findings can help teams investigate resources shared with another AWS account or the public.
A finding does not necessarily mean the access is wrong. Some sharing is intentional. The value is making that access visible so teams can review it. AWS IAM Access Analyzer documentation
What the new action adds
Cloud Custodian already had an account-level Access Analyzer filter. The missing piece was an action to create an external-access analyzer.
The new
set-access-analyzer action closes that gap. It supports account and organization external-access analyzers, with optional tags and archive rules at creation.It also handles existing resources conservatively: an analyzer of the requested type is preserved, even if its name differs. A non-active analyzer produces a warning rather than being silently replaced.
Explicit deletion is supported too, with name and type checks. Deleting an analyzer permanently removes its findings, so this is an operation to use deliberately. Merged implementation
An example policy
The merged contribution includes this pattern for detecting missing active account-level coverage and invoking the new action:
policies: - name: enable-missing-access-analyzer resource: aws.account filters: - not: - type: access-analyzer key: "[type, status]" value: [ACCOUNT, ACTIVE] actions: - type: set-access-analyzer enabled: true analyzer-name: custodian-external-access analyzer-type: ACCOUNT tags: Owner: SecurityOne important boundary: an existing non-active analyzer is not automatically repaired or replaced. It needs investigation. This action manages external-access analyzers, not unused-access or internal-access analyzers.
The action operates in the policy’s account and Region. Organization analyzers also require the appropriate administrator setup and trusted access beforehand. Use a Cloud Custodian version containing the merged change; merging a PR does not by itself confirm that the change is available in your installed release. Implementation and prerequisites
Before running it, review the required IAM permissions in the implementation and test the policy in a non-production environment. Validate the policy and use a dry run to inspect matches first; a dry run does not execute or verify the creation action.
How this contribution matters
The practical benefit is closing the gap between detecting a missing security control and provisioning it through the same policy workflow.
- Less separate automation: teams can create a missing external-access analyzer without maintaining an additional provisioning script for this step.
- Repeatable governance: the intended configuration can be reviewed in Git and applied through Cloud Custodian’s existing account and Region execution workflows.
- Conservative handling of existing resources: repeated runs preserve an analyzer of the requested type, including its existing tags and archive rules, rather than replacing it.
- Clearer operational signals: non-active analyzers produce warnings that direct attention to investigation instead of silently attempting replacement.
The result is a more complete policy-as-code workflow for establishing external-access visibility. It does not automatically remove public access, rewrite permissions, or resolve Access Analyzer findings; teams still need to review findings and address unintended access.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article