A SysOps Administrator is configuring a new AWS CloudTrail trail to deliver log files to an Amazon S3 bucket. The trail is configured to encrypt the log files using a customer managed key in AWS Key Management Service (AWS KMS). However, the administrator notices that log files are not appearing in the S3 bucket, and CloudTrail reports delivery errors.
Which of the following actions must the administrator take to allow CloudTrail to successfully deliver the encrypted log files? (Select two.)
- Configure the Amazon S3 bucket policy to grant the AWS CloudTrail service principal (cloudtrail.amazonaws.com) the s3:PutObject permission for the target log prefix.Answer
- Configure the KMS key policy to grant the AWS CloudTrail service principal (cloudtrail.amazonaws.com) the kms:GenerateDataKey* and kms:DescribeKey permissions.Answer
- CAdd a policy statement to the KMS key policy that allows the Amazon S3 service principal (s3.amazonaws.com) to perform kms:GenerateDataKey* and kms:Decrypt actions.
- DAttach an IAM policy to the administrator's IAM identity granting the iam:PassRole permission to pass the KMS key to the CloudTrail service.
Answer
To resolve the delivery issues, the SysOps Administrator must configure the Amazon S3 bucket policy to grant the AWS CloudTrail service principal (cloudtrail.amazonaws.com) the s3:PutObject permission, and configure the KMS key policy to grant the AWS CloudTrail service principal the kms:GenerateDataKey* and kms:DescribeKey permissions.
To successfully deliver encrypted logs, CloudTrail must have permissions on both the destination S3 bucket and the custom KMS key. The S3 bucket policy must allow the CloudTrail service principal to upload logs via the s3:PutObject action. Simultaneously, since CloudTrail encrypts the logs before delivery, the KMS key policy must grant the CloudTrail service principal the kms:GenerateDataKey* and kms:DescribeKey permissions.
Step-by-Step Solution
Key Concept
AWS CloudTrail log delivery relies on resource-based policies (S3 bucket policy and KMS key policy) to grant the CloudTrail service principal the necessary permissions to write to S3 and encrypt logs using customer managed KMS keys.