A SysOps Administrator is configuring automated remediation to restart an AWS CloudTrail trail if it is stopped. The administrator creates an Amazon EventBridge rule that triggers on the `StopLogging` API call. The target of this rule is set to trigger an AWS Systems Manager Automation execution of the `AWS-ConfigureCloudTrail` document. The administrator configures the target to use an IAM service role named `SSMAutomationExecutionRole`, which has the necessary `cloudtrail:StartLogging` permissions and a trust policy allowing `ssm.amazonaws.com` to assume it. When the rule is triggered, the automation fails to start, and the EventBridge dead-letter queue reports an authorization error. Which configuration change will resolve this issue?
- AModify the central logging Amazon S3 bucket policy to grant the `s3:PutObject` permission to the EventBridge service principal (events.amazonaws.com).
- BReconfigure the EventBridge rule to target an Amazon SNS topic, and subscribe the Systems Manager Automation document directly to the SNS topic to trigger remediation.
- Attach an IAM policy to the role used by the EventBridge rule to execute the target, granting the `iam:PassRole` permission for the `SSMAutomationExecutionRole` ARN.Answer
- DModify the trust policy of the `SSMAutomationExecutionRole` to allow the EventBridge service principal (events.amazonaws.com) to assume the role instead of Systems Manager.
Answer
Attach an IAM policy to the role used by the EventBridge rule to execute the target, granting the `iam:PassRole` permission for the `SSMAutomationExecutionRole` ARN.
The correct action is to attach an IAM policy to the role used by the EventBridge rule to execute the target, granting the `iam:PassRole` permission for the `SSMAutomationExecutionRole` ARN. When Amazon EventBridge triggers an AWS Systems Manager Automation that runs using a customer-specified execution role, the principal triggering the event must have permission to pass that role to Systems Manager. The `iam:PassRole` permission ensures that the EventBridge service is authorized to delegate the specified execution role to Systems Manager.
Step-by-Step Solution
Key Concept
Delegating IAM roles to AWS services using the PassRole permission during event-driven automated remediation.
Estimated Time:1m 30s