Giter Club home page Giter Club logo

aws-iam-policy-generator's Introduction

aws-iam-policy-generator

NOFORN Presents: AWS IAM Policy Generator

generator.py

python script to generate minified AWS IAM policies from a list of all known IAM actions

Requirements

  • Python >= 3.7

The IAM actions list

It's one action per line, plain text format: files/all-actions.txt

The base reference list is sourced from: rvedotrc/aws-iam-reference

Why?

You can add as many inline policies as you want to an IAM user, role, or group. But the total aggregate policy size (the sum size of all inline policies) per entity cannot exceed the following limits:

  • User policy size cannot exceed 2,048 characters.
  • Role policy size cannot exceed 10,240 characters.
  • Group policy size cannot exceed 5,120 characters.

Note: IAM does not count white space when calculating the size of a policy against these limitations.

Usage

./generator.py --help
usage: generator.py [-h] -s SERVICES

NOFORN Presents: AWS IAM Policy Generator

optional arguments:
  -h, --help            show this help message and exit
  -s SERVICES, --services SERVICES
                        The command separated list of AWS Services by their
                        service prefix.

Example

One Service

./generator.py -s ec2
Great Success
AWS IAM policy generated: policy.json

Two or More Services

./generator.py -s ec2,s3
Great Success
AWS IAM policy generated: policy.json

Troubleshooting

Error: IAM Actions are missing for the service

./generator.py -s ec3
Error: IAM Actions are missing for the service: ec3
Traceback (most recent call last):
  File "./generator.py", line 46, in <module>
    _actions = sorted(actions[service])
KeyError: 'ec3'

Resolution: Add missing IAM Actions to files/all-actions.txt and re-run the generator.

References

aws-iam-policy-generator's People

Contributors

coxauto-kennyg avatar vincentclee avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kennyg codezninja

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.