---
title: CloudTrail logs should be encrypted at rest using KMS CMKs
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > CloudTrail logs should be encrypted at
  rest using KMS CMKs
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# CloudTrail logs should be encrypted at rest using KMS CMKs
 
## Description{% #description %}

AWS CloudTrail trails should encrypt log files at rest using server-side encryption with AWS Key Management Service keys (SSE-KMS). A trail is considered compliant when it has a KMS key ID defined, so only users with both S3 read permissions and KMS decrypt permissions on the key can access the logs.

## Remediation{% #remediation %}

In the [CloudTrail console](https://console.aws.amazon.com/cloudtrail), select the trail, edit its storage settings, enable **Log file SSE-KMS encryption**, and select a customer managed KMS key located in the same region as the S3 bucket. Alternatively, run `aws cloudtrail update-trail --name <trail-name> --kms-key-id <cloudtrail-kms-key>`, then apply a key policy that allows CloudTrail to use the key with `aws kms put-key-policy`, as described in the [CloudTrail SSE-KMS encryption guide](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html).

## References{% #references %}

- [Encrypting CloudTrail log files with AWS KMS keys (SSE-KMS)](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html)
- [Configure AWS KMS key policies for CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create-kms-key-policy-for-cloudtrail.html)
- [CIS Amazon Web Services Benchmarks](https://www.cisecurity.org/benchmark/amazon_web_services)
