IAM Access Analyzer not enabled

Configure an analyzer to review external sharing permissions.

Description

An external IAM Access Analyzer identifies policies on supported resources that grant access outside your zone of trust. Choose an account or organization as that boundary.

Potential impact

Unintended external sharing in a Region can go unnoticed without an analyzer or another review process.

Remediation

Configure AWS::AccessAnalyzer::Analyzer in the required Regions and review its findings. Archive only approved sharing. To revoke actual access, change the resource policy.

Examples

The second excerpt defines an ACCOUNT analyzer. Keep the existing IAM group in the stack if required. The second archive rule matches only the two bucket ARNs, so it can also hide other external-sharing findings for them. Narrow or remove both rules to match approved sharing.

Before

yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Configuration before adding an analyzer
Resources:
  myuseeer:
    Type: AWS::IAM::Group
    Properties:
      Path: "/"

After

yaml
AWSTemplateFormatVersion: "2010-09-09"
Resources:
  Analyzer:
    Type: "AWS::AccessAnalyzer::Analyzer"
    Properties:
      AnalyzerName: MyAccountAnalyzer
      Type: ACCOUNT
      Tags:
        - Key: Kind
          Value: Dev
      ArchiveRules:
        - # Archive findings for approved sharing with an AWS account.
          RuleName: ArchiveTrustedAccountAccess
          Filter:
            - Property: "principal.AWS"
              Eq:
                - "123456789012"
        - # Archive findings for S3 buckets approved for public access.
          RuleName: ArchivePublicS3BucketsAccess
          Filter:
            - Property: "resource"
              Eq:
                - "arn:aws:s3:::docs-bucket"
                - "arn:aws:s3:::clients-bucket"

References