Control: SQS queue policies should not allow ALL (*) actions
Description
SQS CloudWatch Logs destination policy should avoid wildcard in 'actions'.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.sqs_queue_policy_no_action_star
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.sqs_queue_policy_no_action_star --share
SQL
This control uses a named query:
select address as resource, case when ((attributes_std ->> 'policy')::jsonb ) -> 'Statement' @> '[{"Action": "*"}]' then 'alarm' else 'ok' end as status, split_part(address, '.', 2) || case when ((attributes_std ->> 'policy')::jsonb ) -> 'Statement' @> '[{"Action": "*"}]' then ' policy allow wildcard action' else ' policy is ok' end || '.' as reason , path || ':' || start_linefrom terraform_resourcewhere type = 'aws_sqs_queue_policy';