IAM AWS Policy Evaluator
APE takes all of your AWS IAM policies attached to a User, Group, or Role object, and presents you with a single policy, summarizing all of their actual permissions. Taking into account permissions, denials, inherited permissions and permission boundaries!
Setup
Requires Python >= 3.9
From PyPI
- Run
pip install iam-ape - Run
iam-ape
From source
- Clone this repository
- Change directory to iam_ape
- Run
python -m pip install . - Run
iam-ape
Usage
Prerequisite
Have aws-cli installed on your machine and a profile with
aws:GetAccountAuthorizationDetailspermissions.
Alternatively, have the json output fromaws iam get-account-authorization-detailssaved to a file.
Before your first run, it's recommended to run
iam-ape --update- this updates APE's database with the most current list of all available AWS IAM actions.
The simplest way to use iam-ape is to simply run iam-ape --arn <your-arn-here>
APE will then attempt to fetch the account authorization details, evaluate your permissions, and output a neatly formatted policy to stdout
The --input flag:
If you don't want to fetch the report every time, you can run aws iam get-account-authorization-details by yourself and save the output to a json file. You can then pass that output to APE using the --input flag.
Additional flags:
-o, --output write the output to file instead of stdout
-f, --format (clean|verbose) output the policy in clean, AWS policy-like JSON format, or a long verbose JSON containing all specific actions allowed to the entity, the denied actions, and the ineffective (allowed in one place, denied in another) permissions.
-p, --profile the AWS CLI profile to use when fetching Account Authorization Details
-u, --update update APE's database with the most current list of all available AWS IAM actions
-v, --verbose set logging level to DEBUG
Important note: the policy created by this tool might not always be compliant with AWS's constraints. For example, if a user is granted ec2:AttachVolume access to arn:aws:ec2:* by one policy, but denied access to arn:aws:ec2:us-east-1:123456789012:instance/i-123456abc, the resulting policy statement will look like this:
{
"Action": "ec2:AttachVolume",
"Resource": "arn:aws:ec2:*",
"NotResource": "arn:aws:ec2:us-east-1:123456789012:instance/i-123456abc"
}
This statement, having both Resource and NotResource together, is not supported by AWS but makes more sense when trying to understand what the effective permissions of a user are.
Roadmap
- Add an option to supply a resource policy and evaluate whether the entity has access to that resource
- Support additional permissions inherited by Role assumption
- Support SCP Policies
Release files for iam-ape 1.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iam_ape-1.1.6.tar.gz | 302.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iam_ape-1.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 604.4 kB
Release files / iam_ape-1.1.6.tar.gz
| Download URL | iam_ape-1.1.6.tar.gz |
|---|---|
| Size | 302.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adff1e35309c00dcbc41d45105c1b384b4a57087fe608edf47755bdf8297e8cc
|
|
BLAKE2b-256 checksum How to use checksums |
4f25609a07315e0e7b7ab84984ea10c10a4f2b099c7007ee521058b1d600bca9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.3 Darwin/24.4.0
|
Release files / iam_ape-1.1.6-py3-none-any.whl
| Download URL | iam_ape-1.1.6-py3-none-any.whl |
|---|---|
| Size | 302.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24df777f4258c98484b84130f9959e83ca4ebcb793b00ba64761cee63b1a7bd0
|
|
BLAKE2b-256 checksum How to use checksums |
94297afe870d2d497c9ed072764351cd543df199c51d2b952e45a117e6d6e7d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.5 CPython/3.13.3 Darwin/24.4.0
|