You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Production-ready Python SDK implementing all 37 IAM Access Analyzer APIs for AWS security automation.
Overview
AWS IAM Access Analyzer helps identify resources shared with external entities and unused permissions. This solution provides a comprehensive Python SDK with:
Complete API Coverage - All 37 IAM Access Analyzer APIs
Multi-Region Support - Scan all 28 commercial AWS regions
Organization Support - Organization-wide security scanning
Production Ready - Retry logic, rate limiting, health checks
CI/CD Integration - Built-in policy validation for pipelines
Security Dashboard - Visual reporting and JSON export
# Check version
access-analyzer --version
# Verify AWS connectivity
access-analyzer health
Run Your First Scan
# Single region scan
access-analyzer scan
# Output as JSON
access-analyzer scan --json
Usage Guide
CLI Commands
Command
Description
access-analyzer health
Check AWS credentials and permissions
access-analyzer scan
Run security scan
access-analyzer validate <path>
Validate IAM policies
access-analyzer dashboard
Show security dashboard
Scan Options
# Single region (default: us-east-1 or AWS_DEFAULT_REGION)
access-analyzer scan
# Specific region
access-analyzer scan --region eu-west-1
# All 28 commercial AWS regions
access-analyzer scan --all-regions
# Organization-level (from management account)
access-analyzer scan --org
# All regions + organization
access-analyzer scan --all-regions --org
# JSON output for automation
access-analyzer scan --json
access-analyzer scan --all-regions --json
Policy Validation
# Validate single policy
access-analyzer validate policy.json
# Validate directory of policies
access-analyzer validate ./policies/
# Use in CI/CD (exits with code 1 on failure)
access-analyzer validate ./policies/ ||exit 1
Security Dashboard
# Display dashboard
access-analyzer dashboard
# Export to JSON
access-analyzer dashboard --export report.json
# Specific region
access-analyzer dashboard --region ap-southeast-1
Python SDK
fromaccess_analyzerimportAccessAnalyzerClient, health_check# Verify connectivitystatus=health_check()
print(status) # {'status': 'healthy', 'checks': {...}}# Initialize clientclient=AccessAnalyzerClient()
# Single region scanresults=client.full_scan()
print(f"External: {results['summary']['external_count']}")
print(f"Unused: {results['summary']['unused_count']}")
# Multi-region scanclient=AccessAnalyzerClient(regions=['us-east-1', 'eu-west-1', 'ap-southeast-1'])
results=client.full_scan_all_regions()
# All commercial regionsresults=AccessAnalyzerClient.scan_all_commercial_regions()
# Organization-level (from management account)results=client.full_scan(use_org=True)
# Validate a policyfindings=client.validate_policy({
"Version": "2012-10-17",
"Statement": [{"Effect": "Allow", "Action": "s3:*", "Resource": "*"}]
})
# Check for public access ($0.002/call)result=client.check_no_public_access(policy, 'AWS::S3::Bucket')
# Check dangerous actions not granted ($0.002/call)result=client.check_access_not_granted(policy, ['iam:*', 's3:*'])
# All 28 commercial AWS regions supportedclient=AccessAnalyzerClient(regions=AccessAnalyzerClient.ALL_REGIONS)
results=client.full_scan_all_regions()
Organization Support
# From AWS Organizations management accountclient=AccessAnalyzerClient()
ifclient.is_org_management_account():
results=client.full_scan(use_org=True) # Scans all member accounts