turbot/steampipe-mod-terraform-aws-compliance

Control: SNS topics should be encrypted at rest

Description

To help protect data at rest, ensure that your Amazon Simple Notification Service (Amazon SNS) topics require encryption using AWS Key Management Service (AWS KMS).

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.sns_topic_encrypted_at_rest

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.sns_topic_encrypted_at_rest --share

SQL

This control uses a named query:

select
address as resource,
case
when coalesce(trim(attributes_std ->> 'kms_master_key_id'), '') = '' then 'alarm'
else 'ok'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'kms_master_key_id') is null then ' ''kms_master_key_id'' is not defined'
when coalesce(trim(attributes_std ->> 'kms_master_key_id'), '') <> '' then ' encryption at rest enabled'
else ' encryption at rest disabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_sns_topic';

Tags