turbot/steampipe-mod-terraform-aws-compliance

Control: Amazon SQS queues should be encrypted at rest

Description

This control checks whether Amazon SQS queues are encrypted at rest.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.sqs_queue_encrypted_at_rest

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'kms_master_key_id') is null then 'alarm'
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_sqs_queue';

Tags