A security analyst needs to let an external vendor (AWS account 555566667777) read data from a set of internal resources in your AWS account. You created an IAM role called VendorReadRole with a policy that allows the required API calls. However, when the vendor tries to access, CloudTrail shows the call fails at AssumeRole with: "Not authorized to perform: sts:AssumeRole".
What is the most appropriate fix?
Trap 1: Attach the same allow policy to the vendor account’s existing IAM…
Even if the vendor user can call sts:AssumeRole, your role still must trust that principal. Without trust, the AssumeRole request is denied.
Trap 2: Replace the AssumeRole call with GetCallerIdentity so the vendor…
GetCallerIdentity does not grant access to the internal resources. The vendor still needs a trusted identity and proper permissions.
Trap 3: Enable MFA on the vendor’s IAM user and require MFA for your role…
MFA requirements affect the authorization flow but do not solve the root cause. The trust policy must first allow the vendor to assume the role.
- A
Add an allow statement for the vendor in the role’s trust policy to permit sts:AssumeRole from the vendor account (and include any required ExternalId condition).
AssumeRole is blocked unless the role trust policy allows the vendor principal. The role’s permissions policy alone cannot permit assumption.
- B
Attach the same allow policy to the vendor account’s existing IAM user so the user can call sts:AssumeRole directly into your role.
Why wrong: Even if the vendor user can call sts:AssumeRole, your role still must trust that principal. Without trust, the AssumeRole request is denied.
- C
Replace the AssumeRole call with GetCallerIdentity so the vendor can infer permissions without assuming the role.
Why wrong: GetCallerIdentity does not grant access to the internal resources. The vendor still needs a trusted identity and proper permissions.
- D
Enable MFA on the vendor’s IAM user and require MFA for your role using condition keys in the permissions policy.
Why wrong: MFA requirements affect the authorization flow but do not solve the root cause. The trust policy must first allow the vendor to assume the role.