Installation¶
Install¶
Check the installation:
Python and boto3 versions¶
- Python 3.9 or newer (tested on 3.9 to 3.14).
- boto3 1.36.0 or newer (installed automatically). On Python 3.9 pip installs the newest boto3 that still supports 3.9.
boto3 1.36.0 knows resource control policies and the three custom policy checks. Access Analyzer may add resource types later. If a requested value is newer than your boto3, the tool exits with code 2 and tells you what to upgrade:
Private package repositories¶
Development install¶
git clone https://github.com/velez94/validate-aws-policies.git
cd validate-aws-policies
pip install -e ".[dev]" # tests, ruff, mypy
pip install -e ".[docs]" # zensical, to build this site
AWS prerequisites¶
Credentials¶
Use any method the AWS SDK supports. With named profiles:
aws configure sso # IAM Identity Center
aws configure --profile my-profile # access keys
validate-aws-policies -d ./policies -p my-profile
Profile resolution follows boto3: --profile, then profile in a config file, then
AWS_PROFILE, then the default credential chain. The region comes from the profile or
AWS_REGION.
IAM permissions¶
Policy validation is free. Grant only what you use:
| Feature | Permissions |
|---|---|
| Validation (always) | access-analyzer:ValidatePolicy |
--check-no-new-access |
access-analyzer:CheckNoNewAccess |
--check-access-not-granted |
access-analyzer:CheckAccessNotGranted |
--check-no-public-access |
access-analyzer:CheckNoPublicAccess |
--upload |
s3:PutObject on the reports bucket |
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"access-analyzer:ValidatePolicy",
"access-analyzer:CheckNoNewAccess",
"access-analyzer:CheckAccessNotGranted",
"access-analyzer:CheckNoPublicAccess"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::my-reports-bucket/AccessAnalyzer/*"
}
]
}
Cost
Custom policy checks are billed per API call and are off unless you enable them. See what custom checks cost and the Access Analyzer pricing page.
Shell completion¶
The tool uses argcomplete.