Bitzu

SAA-C03 ยท Roles, federation and cross-account access

Cross-account role assumption

Trust policies, sts:AssumeRole across accounts, external ID for third parties and role switching in the console.

Key points

  • The account owning the resources creates a role.
  • Trust policy: who may assume it (another account or a specific principal).
  • Permissions policy: what the role can do.
  • The caller's account must also allow sts:AssumeRole on the role ARN.
  • Third parties serving many customers: sts:ExternalId condition in the trust policy stops the confused deputy problem.
  • People switch roles in the console; code calls AssumeRole.

Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_common-scenarios_third-party.html

Practice questions

Single choice

Which part of an IAM role defines which principals are allowed to assume it?

  1. The permissions policy
  2. The permissions boundary
  3. The trust policy
  4. The session policy
Show answer

Answer: C. The trust policy

The trust policy is the role's resource-based policy that lists the principals allowed to call sts:AssumeRole. The permissions policy only defines what the role can do once assumed.

Select all that apply

A developer in account A must assume a role in account B. What is required for the call to succeed?

  1. The role's trust policy in account B names account A or the developer as principal
  2. A VPC peering connection between the two accounts
  3. An identity-based policy in account A allowing sts:AssumeRole on the role ARN
  4. Both accounts must belong to the same AWS Organization
  5. The developer needs a separate IAM user in account B
Show answer

Answer: A. The role's trust policy in account B names account A or the developer as principal, C. An identity-based policy in account A allowing sts:AssumeRole on the role ARN

Cross-account access needs an allow on both sides: the role's trust policy in B must trust account A (or the developer), and an identity-based policy in A must allow sts:AssumeRole on the role ARN. No network link, shared organization or IAM user in B is needed.

True or false

AWS treats a role's external ID as a secret: once saved, it cannot be viewed again, just like a secret access key.

Show answer

Answer: False

False. The external ID is not a secret; anyone with permission to view the role can see it. Its job is to tie the request to one customer and prevent the confused deputy problem, not to act as a password.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More SAA-C03 topics in this module