Ensure CloudTrail logs are encrypted at rest using KMS CMKs

2.7 Logging (AWS CIS Benchmark).

Description

AWS CloudTrail is a web service that records AWS API calls for an account and makes those logs available to users and resources in accordance with IAM policies.

AWS Key Management Service (KMS) is a managed service that helps create and control the encryption keys used to encrypt account data and uses Hardware Security Modules (HSMs) to protect the security of encryption keys.

CloudTrail logs can be configured to leverage server-side encryption (SSE) and KMS customer-created master keys (CMK) to further protect CloudTrail logs.

It is recommended that CloudTrail be configured to use SSE-KMS.

Configure CloudTrail to use SSE-KMS via the AWS Management Console

Step 1. Log in to the AWS Management Console and open the CloudTrail console at https://console.aws.amazon.com/cloudtrail.

Step 2. In the left navigation pane, click on Trails.

Step 3. Click on a Trail.

Step 4. Under the S3 section, click on the edit button (pencil icon).

Step 5. Click on Advanced.

Step 6. Select an existing CMK from the KMS key Id drop-down menu.

Note 1: Ensure the CMK is located in the same region as the S3 bucket.

Note 2: You will need to apply a KMS Key policy on the selected CMK in order for CloudTrail as a service to encrypt and decrypt log files using the CMK provided. Steps are provided here for editing the selected CMK Key policy.

Step 7. Click on Save.

Step 8. You will see a notification message stating that you need to have decrypt permissions on the specified KMS key to decrypt log files.

Step 9. Click on Yes.

Configure CloudTrail to use SSE-KMS via CLI

Run the following command:

aws cloudtrail update-trail --name <trail_name> --kms-id <cloudtrail_kms_key> aws kms put-key-policy --key-id <cloudtrail_kms_key> --policy <cloudtrail_kms_key_policy>