Understanding AWS role assumption
In AWS, role assumption lets one role temporarily impersonate another by requesting short-lived credentials via AWS STS. It is a secure way to delegate access without passing around secret keys. In AWS, a Trust Policy on the target role defines which identities are allowed to assume it.Example AWS to AWS trust policy
AWS to AWS trust policy
Example GCP to AWS trust policy
GCP to AWS trust policy
Interpreting the trust policy
The Trust Policy that is attached to the target role will include 2 conditions.Condition 1: scoping the permission to the intended principal
- For AWS to AWS this looks like:
AWS principal condition
- For GCP to AWS this looks like:
GCP principal condition
Condition 2: preventing the confused deputy problem (ExternalId)
- For AWS to AWS this looks like:
AWS ExternalId condition
- For GCP to AWS this looks like:
GCP audience condition