A company uses AWS CloudTrail and wants to ensure that logs are encrypted at rest using a customer-managed KMS key. The CloudTrail trail is configured to deliver logs to an S3 bucket. After enabling SSE-KMS on the S3 bucket, the logs are not being delivered. What is the most likely cause?
For CloudTrail to encrypt log files with a customer managed KMS key, the key policy must grant the CloudTrail service principal (cloudtrail.amazonaws.com) permissions for kms:GenerateDataKey and kms:Decrypt. If these permissions are missing, CloudTrail cannot generate the data key needed to encrypt the logs, and log delivery will fail or produce unencrypted logs. This is the exact cause described in the question, making it the correct answer.
Why this answer
CloudTrail requires explicit permissions in the KMS key policy to use the key for encrypting log files. Even if SSE-KMS is enabled on the S3 bucket, CloudTrail must have `kms:GenerateDataKey` and `kms:Decrypt` permissions granted via the key policy. Without these, CloudTrail cannot encrypt the logs, causing delivery to fail.
Exam trap
The trap here is that candidates often assume enabling SSE-KMS on the S3 bucket is sufficient, overlooking that CloudTrail must also be explicitly authorized in the KMS key policy to use the key for encryption operations.
How to eliminate wrong answers
Option A is wrong because CloudTrail fully supports SSE-KMS with customer-managed KMS keys; it is a common and documented configuration. Option B is wrong because CloudTrail can use a KMS key from a different AWS account as long as the key policy grants cross-account permissions, and the question does not indicate a cross-account scenario. Option C is wrong because the S3 bucket policy is not the primary issue here; the logs are not being delivered due to encryption failure, not a write permission denial, and CloudTrail typically has the necessary S3 write permissions via its service principal.