Created
November 22, 2023 22:20
-
-
Save ahmetozer/a5fe06131c874fccc3a3246ed1e28d40 to your computer and use it in GitHub Desktop.
AWS Cloud Trail Events to IAM actions
This file contains 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 | |
f = open('event.json') | |
data = json.load(f) | |
actions = {} | |
for i in data['Records']: | |
service=i["eventSource"].split(".")[0] | |
action=i["eventName"] | |
if service not in actions: | |
actions[service]=[] | |
if action not in actions[service]: | |
actions[service].append(action) | |
f.close() | |
for s in actions: | |
for a in actions[s]: | |
print(s+":"+a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment