IAM AWS Permissions Evaluator
Project description
IAM APE
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:GetAccountAuthorizationDetails
permissions.
Alternatively, have the json output fromaws iam get-account-authorization-details
saved 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file iam_ape-1.1.1.tar.gz
.
File metadata
- Download URL: iam_ape-1.1.1.tar.gz
- Upload date:
- Size: 293.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6590691d018f2cb6e8a3ec0d7daeabcc01ad52586a596d62aec1b3b36cde9c2d |
|
MD5 | 85809d8076afa98a7f05d3233f2cd2c8 |
|
BLAKE2b-256 | 9282fb9f562d1b4b4f7f64764eef0ca9b46abf3109da6c5cd54dc7f87ae5e129 |
File details
Details for the file iam_ape-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: iam_ape-1.1.1-py3-none-any.whl
- Upload date:
- Size: 292.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b9754e9792a0f23e700d0b381e97c4784271eb1dcd8def92f6b3d91a91ea758 |
|
MD5 | dbf2c5b6e03db66e790268acf7669720 |
|
BLAKE2b-256 | 625c41bb894b8407b125fa0a3fe6fffeca2e70a96dc7c8f51abc1ed147f96339 |