How do you protect against the confused deputy problem when AWS services assume your roles?
AdvancedProductionIAM Best Practices
Answer
Add aws:SourceArn and/or aws:SourceAccount conditions to trust policies and resource policies that grant access to service principals. That way, the service can only act on your behalf for requests originating from your resource, not another customer's. For third-party SaaS roles, require an sts:ExternalId that the vendor generates per customer.
"Condition": {"StringEquals": {"aws:SourceAccount": "111122223333"},
"ArnLike": {"aws:SourceArn": "arn:aws:sns:eu-west-1:111122223333:alerts"}}
More on IAM Best Practices
What does least privilege look like in practice, not in theory?BeginnerWhat are the IAM rules you enforce for humans?BeginnerHow do you design Identity Center permission sets for many teams?IntermediateHow does ABAC with Identity Center work, and when is it worth it?AdvancedWhen do you use permission boundaries in production?IntermediateHow do you remove long-lived access keys from an existing estate?Intermediate