A SysOps Administrator is setting up an organization trail in AWS CloudTrail to aggregate API activity logs from all member accounts into a centralized Amazon S3 bucket named company-audit-logs in the organization's management account (account ID 111122223333). The administrator creates the S3 bucket and configures the following bucket policy statement to authorize log delivery:
{
"Sid": "AWSCloudTrailWrite",
"Effect": "Allow",
"Principal": {"Service": "cloudtrail.amazonaws.com"},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::company-audit-logs/AWSLogs/111122223333/*",
"Condition": {
"StringEquals": {
"s3:x-amz-acl": "bucket-owner-full-control"
}
}
}
After enabling the organization trail, the administrator discovers that log files are successfully delivered for the management account, but log delivery fails for all member accounts with an access denied error. What action should the administrator take to resolve this issue?
- Modify the S3 bucket policy's Resource parameter to target arn:aws:s3:::company-audit-logs/AWSLogs/o-organizationid/*, replacing o-organizationid with the ID of the organization.Answer
- BAdd a condition block to the existing S3 bucket policy statement that checks for "StringEquals": {"aws:PrincipalOrgID": "o-organizationid"} while maintaining the original Resource path.
- CCreate a cross-account IAM role in each member account that allows s3:PutObject permissions to the bucket, and configure the organization trail to assume this role for log delivery.
- DCreate separate statements in the S3 bucket policy for each member account, specifying arn:aws:s3:::company-audit-logs/AWSLogs/member-account-id/* as the Resource for each member account.