
Mitigate the Confused Deputy Problem in AWS
Access resources of an AWS account by 3rd party AWS account in a cross-account connection
Think of a situation at a bank. You are a customer, and based on your instructions the bank teller handles tasks for your account, like deposits or withdrawals. One day Mr. Unknown walks into the bank pretending to be you. They tell the teller, "Do the money transfer from this customer’s account to mine." If the teller doesn’t confirm the person’s identity, they might accidentally send your money to the wrong person's account.
- Create an IAM Role for Cross-Account access and this IAM role is assumed by this 3rd party only
- Create a Trust Policy by adding the 3rd party's account Id to the Principal object of the policy
- Give the permissions in the policy for accessing the service
- Share this role ARN with the 3rd party
- 3rd party will authenticate with AWS
- Assume the Role provided by your account
- Access your AWS account
Is there any way the Other Customer can access your account using a third-party account?
So one of the solutions is to create an ExternalId attached to the Account Id and change the Trust policy to explicitly assign the ExternalId.