Detection: SQS Queue DLQ Disabled
Overview
Detect when an Amazon SQS queue was created without a Dead Letter Queue (DLQ) configured. DLQs capture messages that cannot be processed successfully, preventing data loss and enabling troubleshooting. Ensuring DLQs are enabled improves reliability and operational resilience.
References:
Usage
Run the detection in your terminal:
powerpipe detection run aws_cloudtrail_log_detections.detection.sqs_queue_dlq_disabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe detection run aws_cloudtrail_log_detections.detection.sqs_queue_dlq_disabled --share
SQL
This detection uses a named query:
select tp_timestamp as timestamp,string_split(event_source, '.')[1] || ':' || event_name as operation,coalesce(response_elements ->> 'queueUrl', request_parameters ->> 'queueUrl') as resource,user_identity.arn as actor,tp_source_ip as source_ip,tp_index as account_id,aws_region as region,tp_id as source_id,*
from aws_cloudtrail_logwhere event_source = 'sqs.amazonaws.com' and event_name = 'SetQueueAttributes' and (request_parameters -> 'attributes' ->> 'RedrivePolicy') = '' and error_code is null
order by event_time desc;