An IAM role trusts rolesanywhere.amazonaws.com for IAM Roles Anywhere. The account has two trust anchors, one for the production CA and one for a lab CA. Only workloads with certificates authenticated through the production trust anchor may obtain the role's credentials. What should be added to the role's trust policy?
Show the answer
Correct answerB. An aws:SourceArn condition equal to the production trust anchor's ARN
AWhy not this: A lab CA could issue a certificate with the same common name, so the subject alone does not prove the issuing trust anchor.
BWhy this is right: aws:SourceArn identifies the trust anchor that authenticated the certificate, so only production-anchored sessions match.
CWhy not this: A boundary caps the role's permissions but does not control which trust anchor can be used to obtain them.
DWhy not this: The role is assumed by the Roles Anywhere service, so the workload's network address is not the deciding attribute.
When IAM Roles Anywhere issues a session, aws:SourceArn is set to the trust anchor used in CreateSession, so an aws:SourceArn condition limits the role to certificates validated by the production trust anchor. A subject name condition can be satisfied by a lab certificate with the same name, and a permissions boundary limits permissions rather than who can assume the role.