For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-aws-sqs-queue-exposed.md.
A documentation index is available at /llms.txt.
Granting the wildcard principal (*) Allow access in an SQS queue policy makes the queue publicly accessible. Unauthorized users or principals can send, receive, or modify messages, increasing the risk of data exposure and message injection.
For Ansible SQS tasks (modules community.aws.sqs_queue or sqs_queue), inspect the policy property and ensure no policy Statement has "Effect": "Allow" with "Principal": "*". Statements must specify explicit principals (for example AWS account ARNs) or include restrictive conditions.
Resources with policy statements where Principal == "*" and Effect == "Allow" are flagged. Replace wildcard principals with explicit ARNs or add conditions such as aws:SourceAccount or aws:SourceVpce to restrict access.
Secure example (Ansible task with explicit principal):