turbot/steampipe-mod-aws-compliance

Control: 1 Athena workgroups should be encrypted at rest

Description

This control checks if an Athena workgroup is encrypted at rest. The control fails if an Athena workgroup isn’t encrypted at rest.

In Athena, you can create workgroups for running queries for teams, applications, or different workloads. Each workgroup has a setting to enable encryption on all queries. You have the option to use server-side encryption with Amazon Simple Storage Service (Amazon S3) managed keys, server-side encryption with AWS Key Management Service (AWS KMS) keys, or client-side encryption with customer managed KMS keys. Data at rest refers to any data that's stored in persistent, non-volatile storage for any duration. Encryption helps you protect the confidentiality of such data, reducing the risk that an unauthorized user can access it.

Remediation

To enable encryption at rest for Athena workgroups, see Edit a workgroup in the Amazon Athena User Guide. In the Query Result Configuration section, select Encrypt query results.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.foundational_security_athena_1

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.foundational_security_athena_1 --share

SQL

This control uses a named query:

select
name as resource,
case
when coalesce(managed_query_results_enabled, false) then 'ok'
when encryption_option in ('SSE_S3','SSE_KMS','CSE_KMS') then 'ok'
else 'alarm'
end as status,
case
when managed_query_results_enabled and managed_query_results_kms_key is not null then name || ' MQR enabled with customer-managed KMS key ' || managed_query_results_kms_key || '.'
when managed_query_results_enabled then name || ' MQR enabled (encrypted with AWS-owned key).'
when encryption_option in ('SSE_KMS','CSE_KMS') then name || ' classic results ' || encryption_option || ' with KMS ' || coalesce(result_configuration_kms_key,'(unspecified)') || '.'
when encryption_option = 'SSE_S3' then name || ' classic results SSE_S3.'
else name || ' no result encryption configured.'
end as reason
, region, account_id
from
aws_athena_workgroup;

Tags