Created
June 24, 2020 10:11
-
-
Save ritesh/4dbcef60ce9afd45d7b3075d9caf2691 to your computer and use it in GitHub Desktop.
List of IAM actions via the policy editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm policies.js | |
rm service_actions.txt | |
curl -s https://awsiamconsole.s3.amazonaws.com/iam/assets/js/bundles/policies.js -O && node -e "app={}; EnvInfo ={}; _ = {has: function() {return false;}, extend: function(){},};require('./policies.js'); console.log(JSON.stringify(app));" | jq .PolicyEditorConfig.serviceMap > service_actions.txt | |
python iam_actions.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
with open('service_actions.txt') as f: | |
a = json.loads(f.read()) | |
for k, v in a.items(): | |
prefix = (v['StringPrefix']) | |
for action in v['Actions']: | |
print (prefix + ":" + action) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment