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.
More on IAM Advanced, STS and Multi-Account
Explain the IAM policy evaluation logic.AdvancedHow does cross-account access evaluation differ from same-account?AdvancedHow does `sts:AssumeRole` work, step by step?IntermediateWhat is the difference between AssumeRole, AssumeRoleWithWebIdentity and AssumeRoleWithSAML?IntermediateWhat is a permission boundary and when would you use one?IntermediateWhat do Service Control Policies do and not do?Intermediate