Skip to main content

ASAI can find the available actions, conditions, and other useful IAM information for AWS services.

Project description

AWS Service Authorization Information (ASAI) v0.3.1

PyPI

ASAI can find the available actions, conditions, and other useful IAM information for AWS services.

This was written to make building detailed IAM policies with regional permissions boundaries less tedious.

Features

  • Search or list all AWS services
  • List all regional or global AWS services
  • Create a list of available IAM actions, wildcarding common prefixes
  • Display all available IAM actions for a service
  • Print all IAM information for a service.

Usage

Generate Policy Scaffolds

The policy command will help you generate policy scaffolds you can tailor to fit your needs.

Policy scaffolds are valid JSON, but not valid IAM policies. They demonstrate all of the possible options a service's IAM policy could employ. You must tailor the resulting scaffolds to create valid IAM policies.

Sample Output

The fields below have been truncated for readability. For a complete example which includes all possible services, see tests/expected/policy-all.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Amazon Comprehend",
            "Effect": "Allow",
            "Action": [
                "comprehend:BatchDetectDominantLanguage",
                "comprehend:BatchDetectEntities",
                ...
            ],
            "Resource": [
                "arn:${Partition}:comprehend:${Region}:${AccountId}:${ResourceType}/${ResourceName}"
            ],
            "Condition": {
                "SomeCondition-IYzBf": {
                    "aws:RequestTag/${TagKey}": "...some value..."
                },
                "SomeCondition-UYQWo": {
                    "comprehend:ModelKmsKey": "...some value..."
                },
                ...
            }
        },
        {
            "Sid": "Amazon Elastic File System",
            "Effect": "Allow",
            "Action": [
                "elasticfilesystem:Backup",
                "elasticfilesystem:ClientMount",
                ...
            ],
            "Resource": [
                "arn:${Partition}:elasticfilesystem:${Region}:${Account}:${ResourceType}/${ResourcePath}"
            ],
            "Condition": {...}
        },
        ...
    ]
}

Command details

asai policy [OPTIONS]

  Generate an IAM policy scaffold using specified services.

  When multiple service options are specified, they will be combined into a
  single policy.

  If `--group` is set, then the policy will contain multiple statements for each
  parameter. eg: Setting `--prefix ssm --prefix ec2 --all-global --search
  container` will result in four statements, one for SSM, one for EC2, one for
  all global services, and one for "container" search results. These will
  *not* be de-duped.

  If no service options are specified, a policy scaffold with all services
  will be created. Using `--group` here will result in each service getting its own
  policy statement.

  Options:
    -p, --prefix TEXT  Specific service prefix. Can be used multiple times.
    --all-global       Include all global services in policy scaffold.
    --all-regional     Include all global services in policy scaffold.
    -s, --search TEXT  Include all search results. Can be used multiple times.
    --wildcard         Wildcard the actions list of all specified services.
    --group            Group services by parameter.
    --help             Show this message and exit.

Service Information

The service and services commands will display prefix names and other information about particular services.

Command Subcommand Description
services all List all service prefixes.
global List all services which aren't tied to specific regions.
no-arn List all services which don't have an ARN format.
regional List all services which are tied to specific regions.
search Search for a service by name or prefix.
service actions List a service's actions.
actions-wildcard List a service's actions, wildcarding common prefixes.
arn-format Display a service's ARN format description.
arn-regex Display a service's ARN Regex string.
info Print all available service information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asai-0.3.1.tar.gz (193.3 kB view details)

Uploaded Source

Built Distribution

asai-0.3.1-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file asai-0.3.1.tar.gz.

File metadata

  • Download URL: asai-0.3.1.tar.gz
  • Upload date:
  • Size: 193.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for asai-0.3.1.tar.gz
Algorithm Hash digest
SHA256 b565b171be27acd0dd0af3bc64af4880f976332af2af74661931515634721d4f
MD5 43403a088a160f41b9de42f30784ee37
BLAKE2b-256 bd427b49f396f01aa9e89881e727e1d2d77a4716f64c4c989df49c006377c526

See more details on using hashes here.

File details

Details for the file asai-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: asai-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for asai-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0e788f0cc012f2fba5f09f1c3dc58d0df2fe610978ed76db1c12da0a47422f
MD5 eb15a0b6fefb948666db3ebaa1ab20c1
BLAKE2b-256 c1ee9ffe9247649a8e4e6596e294f3bb15bb5ec5409f14abf4e624e9c90d8da3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page