> 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-athena-workgroup-data-encryption-at-rest-not-configured.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS Athena Workgroup data encryption at rest not configured

### Synopsis

| Field               | Value                                                       |
| ------------------- | ----------------------------------------------------------- |
| Rule Type           | Detection                                                   |
| Finding Type        | AWS Athena Workgroup data encryption at rest not configured |
| Finding ID          | 60000869                                                    |
| Generates a Finding | This detection rule also generates a finding                |
| Severity            | Medium                                                      |
| Category            | CONFIGURATION                                               |
| Cloud Providers     | AWS                                                         |
| Platform Module     | CSPM                                                        |
| Asset Types         | AMAZON\_ATHENA\_WORKGROUP                                   |
| ATT\&CK Tactic      | TA0040 (TA0040)                                             |
| ATT\&CK Technique   | T1486 (T1486)                                               |

### Description

AWS Athena workgroups lacking data encryption at rest pose a significant security risk. Data stored in these workgroups is vulnerable to unauthorized access and potential data breaches if encryption is not properly configured.

Athena workgroups allow for isolating queries and configuring query result locations, including encryption settings. However, the default setting lacks encryption at rest, and client-side configurations can override workgroup settings. This misconfiguration exposes sensitive data stored in query results to potential attackers who might gain unauthorized access.

Without data encryption at rest, sensitive information within Athena workgroup query results could be compromised, leading to data breaches, regulatory violations, and reputational damage. Encrypting data at rest ensures confidentiality and integrity, even if an attacker gains access to the underlying storage.

To mitigate this risk, configure encryption at rest for all AWS Athena workgroups and enable the 'override client-side settings' option. This ensures that data is always encrypted, regardless of client-side configurations.

### Remediation

**Manual steps:**

Amazon Athena Workgroup - This remediation address the AWS Athena workgroups that are not configured with data encryption at rest. By default, Athena workgroup query run results are not encrypted at rest, and client-side settings can override the workgroup settings. This can lead to unauthorized access and potential data breaches:

1. Sign in to the AWS Management Console and open the Amazon Athena console.
2. Under the navigation bar, click on Workgroups.
3. Select the alerted workgroup. Click on 'Edit'.
4. For Athena-based engines, under 'Query result configuration', enable 'Encrypt query results'.
5. Select 'Encryption type' based on the requirements. Make sure to set 'Minimum encryption'.
6. Under 'Settings', enable 'Override client-side settings'.
7. For Apache Spark-based engines, under 'Calculation result settings', enable 'Encrypt query results'.
8. Select 'Encryption type' based on the requirements.
9. Click on 'Save changes'.

**Note:** Carefully review and test these steps before implementing them in your production environment. Enabling encryption at rest may impact performance and cost. Ensure that the KMS key you choose has appropriate permissions and is backed up.

**CLI code:**

Amazon Athena Workgroup - This command updates the Athena workgroup configuration to enable encryption at rest for query results. It sets the encryption option to 'SSE\_S3', which uses server-side encryption by Amazon S3. It also enforces the workgroup configuration to override client-side settings, ensuring that all queries within the workgroup use the specified encryption option:

```bash
aws athena update-work-group --work-group ${entity} --configuration-updates '{"EnforceWorkGroupConfiguration": true, "ResultConfigurationUpdates": {"EncryptionConfiguration": {"EncryptionOption": "SSE_S3"}}, "EngineVersion": {"SelectedEngineVersion": "Athena"}}' --region ${entity}
```

**Terraform code:**

Amazon Athena Workgroup - This Terraform code modifies the existing 'aws\_athena\_workgroup' resource to enforce data encryption at rest for all queries within the workgroup. It sets the 'enforce\_workgroup\_configuration' attribute to 'true', ensuring that the workgroup's encryption settings override any client-side settings. Additionally, it configures the 'encryption\_configuration' block within the 'result\_configuration' to specify the encryption method ('SSE\_KMS') and the KMS key ARN for encrypting query results:

```hcl
# Configure the Athena workgroup to enforce encryption at rest
resource "aws_athena_workgroup" "example" {
  name = "example"

  configuration {
    enforce_workgroup_configuration    = true
    # ... other configurations

    result_configuration {
      output_location = "s3://${entity}/output/"

      encryption_configuration {
        encryption_option = "SSE_KMS"
        kms_key_arn       = ${entity}
      }
    }
  }
}
```


---

# 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-athena-workgroup-data-encryption-at-rest-not-configured.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.
