An enterprise wants to centralize API activity logs across all AWS accounts in their AWS Organization. A solutions architect configures an organization trail in the management account to deliver logs to a centralized Amazon S3 bucket located in a dedicated security account. The S3 bucket uses Amazon S3 managed keys (SSE-S3) for encryption. Although the organization trail is successfully created, the operations team reports that no log files are being delivered to the S3 bucket. Which of the following is the most likely cause of this issue?
- The S3 bucket policy in the security account does not grant write permissions to the CloudTrail service principal for the organization path structure.Cevap
- BThe S3 bucket policy in the security account only grants access to local IAM users, under the assumption that member accounts automatically inherit write access through AWS Organizations.
- CThe unified CloudWatch agent on the management account has not been configured with the correct log file path pattern to match the rotated CloudTrail log files.
- DThe default AWS managed key (aws/s3) is being used to encrypt the S3 bucket, preventing CloudTrail from performing cross-account encryption due to key policy restrictions.
Cevap
The S3 bucket policy in the security account does not grant write permissions to the CloudTrail service principal for the organization path structure.
AWS CloudTrail delivers logs to S3 using its service principal (cloudtrail.amazonaws.com). When centralizing logs from an organization trail into a bucket located in another account, the destination S3 bucket policy must explicitly permit the CloudTrail service principal to perform the s3:PutObject action on the path corresponding to the AWS Organization's logs (typically prefixed with AWSLogs/o-organizationid/). Without this permission, CloudTrail will be blocked from writing to the bucket.
Adım Adım Çözüm
Anahtar Kavram
Cross-account log centralization with AWS CloudTrail and S3 bucket policies