Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dashboard/labs/iam_account_hardening_labs.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
)
ANALYZER_COMMAND = (
f'aws accessanalyzer create-analyzer --analyzer-name {ANALYZER} --type ACCOUNT\n'
f'aws s3api create-bucket --bucket {SHARED_BUCKET}\n'
f'aws s3api delete-public-access-block --bucket {SHARED_BUCKET} # so a public policy can be saved\n'
f'aws s3api put-bucket-policy --bucket {SHARED_BUCKET} --policy file://public-read.json\n'
f'aws iam create-role --role-name {PARTNER_ROLE} --assume-role-policy-document file://partner-trust.json\n'
'aws accessanalyzer list-findings --analyzer-arn <analyzer-arn>'
Expand Down
4 changes: 3 additions & 1 deletion dashboard/labs/iam_machine_identity_labs.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ def handler(event, context):
)
ABAC_COMMAND = (
''.join(f'aws sqs tag-queue --queue-url <{queue}> --tags team={team}\n' for queue, team in QUEUE_TAGS.items())
+ f'aws iam put-role-policy --role-name {ABAC_ROLE} --policy-name {INLINE_POLICY} '
+ f'aws iam create-role --role-name {ABAC_ROLE} --assume-role-policy-document file://abac-trust.json '
'# sts:AssumeRole and sts:TagSession\n'
f'aws iam put-role-policy --role-name {ABAC_ROLE} --policy-name {INLINE_POLICY} '
'--policy-document file://same-team.json # aws:ResourceTag/team = ${aws:PrincipalTag/team}\n'
f'aws sts assume-role --role-arn {ABAC_ROLE_ARN} --role-session-name orders-dev --tags Key=team,Value=orders\n'
f'aws sqs send-message --queue-url <{JOBS_QUEUE}> --message-body hello # same team\n'
Expand Down
Loading