What does a good trust policy for cross-account access look like?
IntermediateProductionIAM Best Practices
Answer
Trust a specific role ARN, not the whole account root, unless you deliberately delegate the decision to the other account's admins. Add conditions such as aws:PrincipalOrgID, MFA for humans, and sts:ExternalId for third parties.
{
"Effect": "Allow",
"Principal": {"AWS": "arn:aws:iam::444455556666:role/ci-deployer"},
"Action": ["sts:AssumeRole", "sts:TagSession"],
"Condition": {"StringEquals": {"aws:PrincipalOrgID": "o-abc123xyz"}}
}
More on IAM Best Practices
What does least privilege look like in practice, not in theory?BeginnerWhat are the IAM rules you enforce for humans?BeginnerHow do you design Identity Center permission sets for many teams?IntermediateHow does ABAC with Identity Center work, and when is it worth it?AdvancedWhen do you use permission boundaries in production?IntermediateHow do you remove long-lived access keys from an existing estate?Intermediate