For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cloudformation-aws-iam-access-analyzer-not-enabled.md.
A documentation index is available at /llms.txt.
IAM Access Analyzer provides continuous monitoring of resource-based policies to detect unintended public or cross-account access. If an AWS::AccessAnalyzer::Analyzer is not defined, these permission issues can go undetected, increasing the risk of data exposure or privilege escalation.
The CloudFormation template must include an AWS::AccessAnalyzer::Analyzer resource. Templates missing this resource will be flagged. Set the Properties.Type to ACCOUNT to monitor a single account or ORGANIZATION to monitor an AWS Organization, and optionally provide an AnalyzerName for identification.
AWSTemplateFormatVersion:2010-09-09Resources:Analyzer:Type:"AWS::AccessAnalyzer::Analyzer"Properties:AnalyzerName:MyAccountAnalyzerType:ACCOUNTTags:- Key:KindValue:DevArchiveRules:- # Archive findings for a trusted AWS accountRuleName:ArchiveTrustedAccountAccessFilter:- Property:"principal.AWS"Eq:- "123456789012"- # Archive findings for known public S3 bucketsRuleName:ArchivePublicS3BucketsAccessFilter:- Property:"resource"Contains:- "arn:aws:s3:::docs-bucket"- "arn:aws:s3:::clients-bucket"