Security and Compliance

An IAM execution role trusts the scheduler.amazonaws.com service principal so that EventBridge Scheduler can invoke targets. The security team must ensure the service can assume the role only for schedules in the account's Finance schedule group. What should the role's trust policy add?

Show the answer

Correct answerC. aws:SourceArn and aws:SourceAccount conditions matching the Finance schedule group and the account

AWhy not this: An external ID is passed by a third party calling AssumeRole; a service principal assuming the role does not supply one.

BWhy not this: Service principals do not belong to an organization, so this condition does not tie the request to the Finance schedule group.

CWhy this is right: The service passes the schedule group ARN and account as request context, so the trust policy accepts only that group's schedules.

DWhy not this: aws:CalledVia applies when a service makes a request using an IAM principal's credentials; it does not identify the schedule group behind a role assumption.

When a service principal assumes a role on behalf of a resource, aws:SourceArn and aws:SourceAccount identify that resource and its account, which prevents the cross-service confused deputy problem. For EventBridge Scheduler, aws:SourceArn is the schedule group ARN.