Skip to main content

aws-access-analyzer-validator

A tool to validate existing identity and resource policies across regions and supported AWS services with AWS IAM Access Analyzer.

This tool

  • discovers resource and identity policies attached to resources of supported AWS services (see below) in all commercial regions
  • validates these policies with AWS IAM Access Analyzer ValidatePolicy API
  • generates a report with Access Analyzer findings

See examples/sample_report.md for an example.

Usage

  1. Install from PyPI (Python 3.10+ required):
pip install aws-access-analyzer-validator
  1. Execute the tool:
aws-access-analyzer-validator -o report.md
  1. Open report.md to see analysis results.

Arguments

aws-access-analyzer-validator supports the following arguments:

  • --regions - A comma separated list of regions to limit policy validation to. For example, --regions eu-west-1,eu-north-1 limits validation to policies in eu-west-1 and eu-north-1 regions. Global resources (IAM, S3) are scanned regardless of region limitations.

  • --excluded-regions - A comma separated list of regions to exclude from policy validation. For example, --regions eu-west-1,eu-north-1 excludes resources in eu-west-1 and eu-north-1 regions from policy validation. Default: me-south-1 to skil a defunct region by default.

Supported Services / Resources

aws-access-analyzer-validator validates policies from the following services:

  • AWS Identity and Access Management (IAM)
    • Inline policies of IAM users
    • Inline policies of IAM groups
    • Inline policies and trust policy of IAM roles
    • Managed IAM Policies (customer managed)
  • Amazon S3 bucket policies
  • Amazon SQS queue policies
  • Amazon SNS topic policies
  • Amazon Elastic Container Registry (ECR) repository policies

Required Permissions

This tool requires the following permissions to operate:

  • accessanalyzer:ValidatePolicy
  • ecr:DescribeRepositories
  • ecr:GetRepositoryPolicy
  • iam:GetAccountAuthorizationDetails
  • s3:GetBucketPolicy
  • s3:ListAllMyBuckets
  • sns:GetTopicAttributes
  • sns:ListTopics
  • sqs:GetQueueAttributes
  • sqs:ListQueues

Here's an IAM policy that grants the required privileges:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "PermissionsForAAValidator",
            "Effect": "Allow",
            "Action": [
                "access-analyzer:ValidatePolicy",
                "ecr:DescribeRepositories",
                "ecr:GetRepositoryPolicy",
                "iam:GetAccountAuthorizationDetails",
                "s3:GetBucketPolicy",
                "s3:ListAllMyBuckets",
                "sns:GetTopicAttributes",
                "sns:ListTopics",
                "sqs:GetQueueAttributes",
                "sqs:ListQueues"
            ],
            "Resource": "*"
        }
    ]
}

Development

Requires Python and uv. Useful commands:

# Run integration tests (requires admin-level AWS credentials)
make test

# Run linters
make -k lint

# Format code
make format

# Deploy test resources (requires AWS CLI and admin level AWS credentials)
make deploy-test-resources

# Delete test resources
make delete-test-resources

Credits

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aws_access_analyzer_validator-0.6.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aws_access_analyzer_validator-0.6.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file aws_access_analyzer_validator-0.6.0.tar.gz.

File metadata

  • Download URL: aws_access_analyzer_validator-0.6.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aws_access_analyzer_validator-0.6.0.tar.gz
Algorithm Hash digest
SHA256 c82477d17ba88e0bfae1cf3c6509712d7e06236e310bb31b5033f58729381494
MD5 fa2a77e53243de0c54ea899e058efa87
BLAKE2b-256 404d12bed74f832653cff121e48f4b1f11eaaca7da38592b014280b08241d583

See more details on using hashes here.

File details

Details for the file aws_access_analyzer_validator-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: aws_access_analyzer_validator-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for aws_access_analyzer_validator-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9cfc3095e26bb3eed35c6a8a52baa4ccace8c1c4a3f592d69ac5b4e36c3d2f9
MD5 2ac2f0ca7e479971cfc0420d2496e2f2
BLAKE2b-256 425d4516fe4928b265c05541d6f391052a840c4e96b10fe9f1d616a61c0d5995

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page