This will allow the ability to map boto3 SDK calls to the IAM permission(s) that is needed. The JSON could then be parsed for use.
- Iterate through each AWS service and its SDK calls
- Attempt each SDK call and capture AccessDenied errors
- Extract required IAM permission from the error
- Temporarily add the permission to the IAM role
- Retry the SDK call:
- If successful: Record the permission, remove it, move to next call
- If failed: Add next required permission, retry from step 5
- Repeat for all SDK calls and services
-
Install dependencies:
pip install boto3
-
Run the script:
python aws_permission_mapper.py
-
Choose to map a single service or all services
-
Results are saved to a JSON file