Profile Applicability:

  • Level 1

Description:

Amazon Athena is an interactive query service that makes it easy to analyze data stored in Amazon S3 using SQL. The results of queries executed in Athena can be saved to Amazon S3 for further processing or analysis.

Encryption at rest ensures that data stored in Amazon S3 (including query results) is encrypted when written to the storage, thereby protecting the data from unauthorized access. By enabling encryption at rest for Athena query results, data remains protected both while at rest and during transfer, ensuring secure storage and compliance with data protection regulations.

This SOP ensures that encryption at rest is enabled for Athena query results stored in Amazon S3, improving security and meeting compliance requirements.

Rationale:

Enabling encryption at rest for Amazon Athena query results is important for:

  • Data Security: Protects query results from unauthorized access by encrypting them when stored in Amazon S3.

  • Compliance: Helps meet regulatory compliance requirements like PCI-DSS, HIPAA, and SOC 2, which require encryption of data-at-rest.

  • Best Practices: Ensures the security of sensitive data and adheres to security best practices by keeping all data encrypted, reducing the risk of data breaches.

Impact:

Pros:

  • Enhanced Data Security: Ensures all Athena query results are encrypted at rest, protecting sensitive data from unauthorized access.

  • Compliance: Meets various regulatory and compliance requirements for encrypting data-at-rest.

  • Reduced Risk: Minimizes the risk of data breaches by securing stored query results.

Cons:

  • Performance Overhead: Encryption at rest may introduce slight performance overhead when storing and retrieving data from S3, though it is typically negligible.

  • Key Management: If using SSE-KMS, additional management of KMS keys is required, including key rotation and permissions.

Default Value:

By default, Amazon Athena does not enable encryption at rest for query results stored in Amazon S3 unless explicitly configured. S3-managed keys (SSE-S3) or AWS KMS keys (SSE-KMS) must be configured to ensure encryption.

Pre-requisite:

  • AWS IAM Permissions:

    • athena:UpdateWorkgroup

    • athena:GetWorkgroup

    • s3:PutObject

    • s3:GetObject

    • kms:DescribeKey (if using SSE-KMS)

  • AWS CLI installed and configured.

  • Basic knowledge of Amazon Athena, Amazon S3, and SSE-S3 or SSE-KMS encryption.

Remediation:

Test Plan:

Using AWS Console:

  1. Sign in to the AWS Management Console.

  2. Navigate to Amazon Athena under Services.

  3. Go to Workgroups.

  4. Select the workgroup for which you want to verify encryption settings.

  5. In the Workgroup Details section, look for Query Results Configuration:

    • Ensure the Output Location is set to an S3 bucket.

    • Check the Encryption settings:

      • If SSE-S3 or SSE-KMS is enabled, it will be shown under the encryption options.

      • If encryption is not enabled, it will show None or will not specify an encryption setting.

  6. Ensure that encryption is enabled for query results stored in Amazon S3.

Using AWS CLI:

To describe the Athena workgroup and check if encryption at rest is enabled, run:

aws athena get-workgroup --workgroup <workgroup-name> --query 'WorkGroup.QueryResultsConfiguration'

  1. Review the OutputLocation and EncryptionConfiguration fields:

    • If SSE-S3 or SSE-KMS is specified, encryption is enabled.

    • If None is specified, encryption is not enabled.

Example output:

{

    "WorkGroup": {

        "QueryResultsConfiguration": {

            "OutputLocation": "s3://your-athena-query-results-bucket/",

            "EncryptionConfiguration": {

                "EncryptionOption": "SSE-KMS",

                "KmsKeyId": "arn:aws:kms:us-east-1:123456789012:key/abcd1234"

            }

        }

    }

}

Implementation Steps:

Using AWS Console:

  1. Sign in to the AWS Management Console and navigate to Amazon Athena.

  2. In the Athena Dashboard, go to Workgroups and select the workgroup to modify.

  3. In the Query Results Configuration section, enable S3 encryption:

    • For SSE-S3, select the default S3-managed encryption.

    • For SSE-KMS, select KMS encryption and specify the KMS key to use for encryption.

  4. Save the changes to ensure encryption at rest is applied for Athena query results.

Using AWS CLI:

To enable SSE-KMS encryption for Athena query results, run:

aws athena update-workgroup \

  --workgroup <workgroup-name> \

  --configuration-updates '{"ResultConfigurationUpdates": {"OutputLocation": "s3://your-athena-query-results-bucket/", "EncryptionConfiguration": {"EncryptionOption": "SSE-KMS", "KmsKeyId": "<kms-key-id>"}}}

To enable SSE-S3 encryption, run:

aws athena update-workgroup \

  --workgroup <workgroup-name> \

  --configuration-updates '{"ResultConfigurationUpdates": {"OutputLocation": "s3://your-athena-query-results-bucket/", "EncryptionConfiguration": {"EncryptionOption": "SSE-S3"}}}'

To verify the changes, run:

aws athena get-workgroup --workgroup <workgroup-name> --query 'WorkGroup.QueryResultsConfiguration'

  1. Ensure that EncryptionConfiguration is set to SSE-KMS or SSE-S3.

Backout Plan:

If enabling encryption causes issues (e.g., performance degradation or job failures):

  1. Identify the affected workgroup.

To disable encryption, run:

aws athena update-workgroup \

  --workgroup <workgroup-name> \

  --configuration-updates '{"ResultConfigurationUpdates": {"EncryptionConfiguration": {"EncryptionOption": "None"}}}'

  1. Verify that encryption has been disabled and that the Athena workgroup is functioning correctly.

Note :

  • KMS Key Management: If using SSE-KMS, ensure the KMS key used for encryption is properly managed and accessible to only authorized users or roles.

  • Cost Considerations: Be aware that enabling SSE-KMS may incur additional costs for KMS key management, especially if you use customer-managed keys.

  • Retention and Monitoring: Set appropriate log retention policies for CloudWatch logs or S3 bucket logs to optimize costs and ensure compliance.

References:

CIS Controls Mapping:

Version

Control ID

Control Description

IG1

IG2

IG3

v8

3.4

Encrypt Data on End-User Devices – Ensure data encryption during file system access.

v8

6.7

Implement Application Layer Filtering and Content Control – Ensure appropriate content filtering is applied to sensitive files.

v8

6.8

Define and Maintain Role-Based Access Control – Implement and manage role-based access for file systems.

v8

14.6

Protect Information Through Access Control Lists – Apply strict access control to file systems.