A software-as-a-service (SaaS) provider manages AWS accounts using AWS Organizations. The security team is setting up an organization-wide trail in AWS CloudTrail to consolidate log delivery into a centralized Amazon S3 bucket in a dedicated Logging account. They require all consolidated logs to be encrypted at rest using an AWS Key Management Service (AWS KMS) key.
Which configuration is required to successfully deliver the encrypted logs from all accounts to the centralized S3 bucket?
- Configure the S3 bucket policy in the Logging account to allow the s3:PutObject and s3:GetBucketAcl actions for the cloudtrail.amazonaws.com service principal with a condition matching the organization ID. Create a customer managed KMS key in the Logging account with a key policy that grants the kms:GenerateDataKey* and kms:DescribeKey permissions to the CloudTrail service principal with a condition matching the organization ARN.Answer
- BConfigure the S3 bucket policy in the Logging account to allow the s3:PutObject and s3:GetBucketAcl actions for the cloudtrail.amazonaws.com service principal with a condition matching the organization ID. Enable default S3 bucket encryption using the AWS-managed KMS key for S3 (aws/s3) in the Logging account, and configure the trail to use this key.
- CCreate a customer managed KMS key in the Logging account with a key policy that grants the kms:GenerateDataKey* and kms:DescribeKey permissions to the CloudTrail service principal. Create an IAM role in the Logging account that allows the CloudTrail service principal to write to the S3 bucket, and rely on IAM delegation for member accounts without modifying the S3 bucket policy.
- DCreate a customer managed KMS key in the Logging account with a key policy that grants the kms:GenerateDataKey* and kms:DescribeKey permissions to the CloudTrail service principal. Attach a Service Control Policy (SCP) to the root of the AWS Organization that explicitly grants the s3:PutObject permission on the centralized S3 bucket to the CloudTrail service principal for all OUs.
Answer
Configure the S3 bucket policy in the Logging account to allow the s3:PutObject and s3:GetBucketAcl actions for the cloudtrail.amazonaws.com service principal with a condition matching the organization ID. Create a customer managed KMS key in the Logging account with a key policy that grants the kms:GenerateDataKey* and kms:DescribeKey permissions to the CloudTrail service principal with a condition matching the organization ARN.
The correct answer provides the necessary resource-based policies to authorize cross-account CloudTrail log delivery and KMS encryption. Specifically, the S3 bucket policy must allow the cloudtrail.amazonaws.com service principal to write objects and read ACLs, restricted to the organization ID. In addition, because logs from member accounts are delivered to a centralized bucket, an AWS-managed KMS key cannot be used since its policy cannot be modified to permit cross-account access. Therefore, a customer managed KMS key must be created, and its key policy must allow the CloudTrail service principal to generate data keys on behalf of the organization's accounts.
Step-by-Step Solution
Key Concept
Centralized cross-account logging with encryption using AWS KMS customer managed keys and S3 bucket policies in a multi-account organization.
Estimated Time:2m 30s