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

What is the confused deputy problem and how does ExternalId solve it?

AdvancedConceptIAM Advanced, STS and Multi-Account
Answer

A third-party SaaS that assumes a role in your account could be tricked by another customer into using their role ARN for your resources. The vendor generates a unique ExternalId per customer, you place it in the trust policy condition, and the vendor must pass it on AssumeRole.

"Condition": {"StringEquals": {"sts:ExternalId": "7b1f-customer-unique-id"}}

For AWS-service-to-service calls the equivalent protection is aws:SourceArn and aws:SourceAccount conditions (for example on SNS topic or S3 bucket policies for CloudTrail/Config).

aws All AWS questions Roadmap: AWS core services

More on IAM Advanced, STS and Multi-Account