> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-s3-bucket-encrypted-with-customer-managed-key-cmk-is-not-enabled-for-regular-rotation.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS S3 bucket encrypted with Customer Managed Key (CMK) is not enabled for regular rotation

### Synopsis

| Field               | Value                                                                                       |
| ------------------- | ------------------------------------------------------------------------------------------- |
| Rule Type           | Detection                                                                                   |
| Finding Type        | AWS S3 bucket encrypted with Customer Managed Key (CMK) is not enabled for regular rotation |
| Finding ID          | 60000833                                                                                    |
| Generates a Finding | This detection rule also generates a finding                                                |
| Severity            | Low                                                                                         |
| Category            | CONFIGURATION                                                                               |
| Cloud Providers     | AWS                                                                                         |
| Platform Module     | CSPM                                                                                        |
| Asset Types         | S3\_BUCKET                                                                                  |
| ATT\&CK Tactic      | TA0040 (TA0040)                                                                             |
| ATT\&CK Technique   | T1486 (T1486)                                                                               |

### Description

AWS S3 buckets encrypted with Customer Managed Keys (CMKs) lacking regular rotation pose a significant security risk. Failure to rotate these keys extends the potential window of exposure for sensitive data should a compromise occur.

AWS S3 utilizes CMKs to encrypt data at rest. However, if a CMK is compromised, an attacker could decrypt data stored within the bucket for an extended period if key rotation is not enabled. This lack of rotation increases the risk of data breaches and compliance violations.

The impact of this misconfiguration includes prolonged exposure of sensitive data, potentially leading to data breaches, financial losses, reputational damage, and regulatory penalties. Regular CMK rotation mitigates this risk by limiting the impact of any compromise to a shorter timeframe.

Implement a regular schedule for CMK rotation. Establish a process to automate key rotation and monitor for successful completion. Use strong key management practices, and regularly audit the CMK rotation configuration to ensure its effectiveness.

### Remediation

**Manual steps:**

S3 Bucket - This issue identifies an Amazon S3 bucket that uses a Customer Managed Key (CMK) for encryption but does not have key rotation enabled. This can lead to prolonged exposure of sensitive data and potential compliance violations. Key rotation ensures that even if a key is compromised, the data remains secure with a new key:

1. **Log in to the AWS Console and navigate to the 'S3' service.**
2. **Click on the S3 bucket reported in the alert.**
3. **Click on the 'Properties' tab.**
4. **Under the 'Default encryption' section, click on the KMS key link in 'Encryption key ARN'.**
5. **Under the 'Key rotation' tab on the navigated KMS key window, Enable 'Automatically rotate this CMK every year'.**
6. **Click on Save.**

**Note:** Carefully review and test these steps before implementing them in your environment. Enabling key rotation may impact existing applications or services that rely on the old key. Ensure you have appropriate backup and recovery procedures in place before making any changes.

**CLI code:**

S3 Bucket - This command enables automatic key rotation for the KMS key identified by the provided key ID. This ensures that the key is rotated periodically, reducing the risk of data exposure if the key is compromised:

```bash
aws kms enable-key-rotation --key-id ${entity} --region ${entity}
```

**Terraform code:**

S3 Bucket - This code will enable automatic key rotation for the KMS key used by the S3 bucket:

```hcl
resource "aws_kms_key" "s3_bucket_kms_key" {
  # Replace with the actual ARN of the KMS key used by the S3 bucket
  arn = "arn:aws:kms:us-east-1:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab"

  enable_key_rotation = true
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-s3-bucket-encrypted-with-customer-managed-key-cmk-is-not-enabled-for-regular-rotation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
