Interview Prep/AWS/IAM Advanced, STS and Multi-Account

What are the pitfalls of `NotAction` and `NotResource`?

AdvancedConceptIAM Advanced, STS and Multi-Account
Answer

NotAction with Allow means "allow everything except these", which silently grants every future API. NotResource with Allow similarly allows all other resources. They are only safe on Deny statements, where they express "deny everything except".

{"Effect":"Deny","NotAction":["iam:*MFADevice*","sts:GetSessionToken"],"Resource":"*"}

If you see Allow + NotAction in a review, treat it as a red flag.

aws All AWS questions Roadmap: AWS core services

More on IAM Advanced, STS and Multi-Account