# 3.5 Ensure CloudTrail Logs Are Encrypted at Rest Using KMS CMKs (Automated)

- Source: https://support.icompaas.com/support/solutions/articles/62000233159-3-5-ensure-cloudtrail-logs-are-encrypted-at-rest-using-kms-cmks-automated-
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [AWS CIS V.4 Level 1 Benchmarks](https://support.icompaas.com/support/solutions/62000112671) › [CIS Control 3](https://support.icompaas.com/support/solutions/folders/62000169197)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

## **Profile Applicability:**

**Level 2**

## **Description**

AWS CloudTrail records AWS API calls and logs them to an S3 bucket. Encrypting CloudTrail logs with AWS Key Management Service (KMS) CMKs provides additional security and access control for sensitive log data. By enabling CloudTrail SSE-KMS encryption, you ensure that only authorized users can decrypt and access logs, reducing the risk of unauthorized access.

## Rationale:

-   Encrypting CloudTrail logs with SSE-KMS ensures confidentiality, integrity, and access control.
-   Prevents unauthorized access to CloudTrail logs by enforcing IAM policies and KMS key policies.
-   Protects against log tampering and data breaches.
-   Helps meet compliance requirements for SOC 2, PCI-DSS, HIPAA, ISO 27001, and CIS benchmarks.

Without KMS encryption, CloudTrail logs are only protected by S3 bucket permissions, making them more vulnerable to unauthorized access.

## Impact:

-   Adds an extra layer of security by encrypting logs with CMKs.
-   Enforces fine-grained access control via IAM & KMS policies.
-   Helps with compliance audits and security best practices.

##   

## Default Value:

-   CloudTrail logs are NOT encrypted with KMS by default.
-   CloudTrail logs are encrypted using S3 server-side encryption (SSE-S3) by default, but not with customer-managed KMS CMKs.

## Pre-Requisites:

IAM permissions required:

-   cloudtrail:UpdateTrail
    
-   kms:CreateKey
    
-   kms:PutKeyPolicy
    
-   kms:DescribeKey
    
-   kms:ListKeys
    
-   kms:GenerateDataKey
    
-   kms:Decrypt
    

AWS CLI installed for automation.

## Remediation:

## Test Plan:

## Using AWS Console

Step 1: Check If CloudTrail Logs Are Encrypted with KMS

1.  Log in to the AWS Management Console
    
2.  Navigate to CloudTrail Console → [AWS CloudTrail](https://console.aws.amazon.com/cloudtrail)
    

![](https://support.icompaas.com/assets/kb/71d2d819465fa1d7.png)

3.  Click Trails in the left navigation pane
    

       ![](https://support.icompaas.com/assets/kb/d395fc28a5c3a346.png)

4.  Select a Trail
    

   ![](https://support.icompaas.com/assets/kb/4421645ee56f48c8.png)

5.  Click Edit under General details
    

 ![](https://support.icompaas.com/assets/kb/68218b7b5967445a.png)

6.  Under S3 Section, ensure:
    
    -   Log file SSE-KMS encryption is enabled
        
    -   A KMS Key is selected
        

                ![](https://support.icompaas.com/assets/kb/69496dc044e90794.png)

7.  Repeat for all AWS Regions
    

Using AWS CLI

Step 1: List All CloudTrails and Check Encryption Status

aws cloudtrail describe-trails --query 'trailList\[\*\].\[Name, KmsKeyId\]'
\[
    \["MyTrail", "arn:aws:kms:us-east-1:123456789012:key/abcdef-1234-5678-9101"\]
\]

## Implementation steps:

## Using AWS Console

Step 1: Enable SSE-KMS Encryption on CloudTrail Logs

1.  Log in to the AWS Management Console
    
2.  Navigate to CloudTrail Console → [AWS CloudTrail](https://console.aws.amazon.com/cloudtrail)
    

![](https://support.icompaas.com/assets/kb/72d2ea6986703e38.png)

3.  Click Trails in the left navigation pane
    

       ![](https://support.icompaas.com/assets/kb/652720da0f7d3677.png)

4.  Click on a Trail  
              ![](https://support.icompaas.com/assets/kb/23f6bff73f02be5d.png)          
    
5.  Under S3 Section, click the Edit button
    

  ![](https://support.icompaas.com/assets/kb/ff836e198cc3db3c.png)

6.  Click Advanced Settings 
    

![](https://support.icompaas.com/assets/kb/cd8c9849b7f90a12.png)

7.  Select an existing KMS CMK from the KMS Key ID dropdown
    
    -   Ensure the CMK is in the same AWS region as the S3 bucket
        

               **![](https://support.icompaas.com/assets/kb/c6d1267d5c0c81a3.png)**

8.  Click Save
    

**![](https://support.icompaas.com/assets/kb/df2ddd8558447933.png)**

## **Using AWS CLI**

**Step 1: Create a KMS Key for CloudTrail**

aws kms create-key --description "CloudTrail Log Encryption Key"

**Step 2: Assign a Key Policy to Allow CloudTrail to Use the KMS Key**

**Create a JSON file (cloudtrail-kms-policy.json):**

{
    "Id": "CloudTrailKMSPolicy",
    "Version": "2012-10-17",
    "Statement": \[
        {
            "Sid": "Allow CloudTrail access",
            "Effect": "Allow",
            "Principal": {
                "Service": "cloudtrail.amazonaws.com"
            },
            "Action": "kms:GenerateDataKey\*",
            "Resource": "\*",
            "Condition": {
                "StringLike": {
                    "kms:EncryptionContext:aws:cloudtrail:arn": \[
                        "arn:aws:cloudtrail:\*:123456789012:trail/\*"
                    \]
                }
            }
        }
    \]
}

**Step 3: Attach the Key Policy to the KMS Key**

aws kms put-key-policy --key-id <KMS-Key-ID> --policy file://cloudtrail-kms-policy.json

**Step 4: Enable KMS Encryption on CloudTrail**

aws cloudtrail update-trail --name MyTrail --kms-key-id <KMS-Key-ID>

## **Backout Plan:**

**If enabling KMS encryption causes issues:** **Disable KMS Encryption via AWS CLI**

 aws cloudtrail update-trail --name MyTrail --no-kms-key-id

**Remove KMS Key Policy via AWS CLI**

 aws kms delete-key --key-id <KMS-Key-ID>

**Ensure disabling encryption is justified before proceeding.**

##   

## **References:**

-   **[](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html)**[](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html)[AWS CloudTrail KMS Encryption](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html)[](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html)**[](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html)**
    
-   **[](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/update-trail.html)**[](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/update-trail.html)[AWS CLI Reference (CloudTrail KMS Encryption)](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/update-trail.html)[](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/update-trail.html)**[](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/update-trail.html)**
    
-   **[](https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html)**[](https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html)[AWS KMS Best Practices](https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html)[](https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html)**[](https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html)**[](https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html)**[cs](https://docs.aws.amazon.com/kms/latest/developerguide/best-practices.html)**
    

## **CIS Controls Mapping:**

<table style="border:none;border-collapse:collapse;font-family:&quot;Helvetica Neue&quot;"><colgroup style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"><col style="font-family:&quot;Helvetica Neue&quot;"></colgroup><tbody style="font-family:&quot;Helvetica Neue&quot;"><tr style="height:40pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:22.0799%"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><strong><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">CIS Control Version</span></span></span></strong></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.7601%"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><strong><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control ID</span></span></span></strong></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;text-align:justify;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><strong><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-weight:700;font-family:&quot;Helvetica Neue&quot;">Control Description</span></span></span></strong></p></td></tr><tr style="height:40pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:22.0799%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">CIS v8</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.7601%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">3.11</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Encrypt&nbsp;</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">sensitive data at rest</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">&nbsp;using encryption mechanisms like&nbsp;</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">KMS</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">.</span></span></span></p></td></tr><tr style="height:25.75pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:22.0799%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">CIS v8</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.7601%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">8.5</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Implement&nbsp;</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">detailed audit logging</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">&nbsp;with&nbsp;</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">secure storage</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">.</span></span></span></p></td></tr><tr style="height:40pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:22.0799%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">CIS v7</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.7601%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">14.8</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Ensure&nbsp;</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">encryption policies</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">&nbsp;are enforced for&nbsp;</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">log data protection</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">.</span></span></span></p></td></tr><tr style="height:40pt;font-family:&quot;Helvetica Neue&quot;"><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:22.0799%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">CIS v7</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;;font-size:14px;width:13.7601%"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;font-size:14px;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">6.3</span></span></span></p></td><td style="padding:5pt;overflow:hidden;overflow-wrap:break-word;font-family:&quot;Helvetica Neue&quot;"><p dir="ltr" style="line-height:1.38;margin-bottom:0pt;font-family:&quot;Helvetica Neue&quot;;text-align:justify"><span style="font-size:14px"><span style="font-family:Helvetica Neue"><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">Enable&nbsp;</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">detailed security logging</span><span style="color:rgb(0, 0, 0);font-family:&quot;Helvetica Neue&quot;">&nbsp;to track CloudTrail log activities.</span></span></span></p></td></tr></tbody></table>

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
