A SysOps administrator wants to automate the remediation of Amazon S3 buckets that are accidentally configured with public write permissions. The administrator creates an Amazon EventBridge rule that triggers when a PutBucketPolicy API call is logged in AWS CloudTrail. The target of this rule is the AWS Systems Manager Automation document AWS-DisableS3BucketPublicWrite. When testing the setup by making a bucket public, the remediation fails to execute. Which configuration action is required to resolve this issue?
- Attach the iam:PassRole permission to the EventBridge IAM role to allow it to pass the Systems Manager execution role to the Systems Manager service.Answer
- BModify the trust relationship of the EventBridge execution role to allow sts:AssumeRole to the S3 service, which removes the need for any role-passing permissions.
- CReconfigure the EventBridge rule to send the CloudTrail event to an Amazon SNS topic, which can directly trigger the Systems Manager Automation document.
- DEnable detailed monitoring on the S3 bucket to increase the CloudTrail event logging frequency so that EventBridge can detect the changes.
Answer
Attach the iam:PassRole permission to the EventBridge IAM role to allow it to pass the Systems Manager execution role to the Systems Manager service.
The correct action is to attach the iam:PassRole permission to the EventBridge IAM role. When EventBridge initiates a Systems Manager Automation document that runs with an execution role, it must pass that role to Systems Manager. Without the iam:PassRole permission, the operation fails authorization and the automation fails to start.
Step-by-Step Solution
Key Concept
IAM PassRole requirement for service-to-service automation triggering