aws-sqs-public-queue
An SQS queue with Principal:* granting sqs:SendMessage (no condition) is publicly writable; any unauthenticated sender can trigger bound Lambda consumers via messaging-chains.
match
A conjunctive graph pattern. Variables (?x) bind node ids; every clause must hold.
{'match_record': {'resource_type': 'AWS::SQS::Queue', 'field': 'Policy'}, 'where': ['statement grants sqs:SendMessage (or sqs:*) to Principal:* with no effective restricting condition']}
where
node_type(?queue) ==
Queue
emit
| source type | Queue |
|---|---|
| target type | AnonymousIdentity |
| source | <SQS queue node> |
| target | <AnonymousIdentity> |
| conditions | resource_policy |
| state logic | ACTIVE when the queue policy has a statement granting sqs:SendMessage (or a wildcard that includes it) to Principal:* or Principal:{"AWS":"*"} with NO condition (or only non-restricting conditions such as an always-true Bool condition). CONDITIONAL(resource_policy) when a condition exists that the caller must satisfy (aws:SourceIp, aws:SourceVpc, etc.) — the queue is not fully public but is reachable from a constrained source. BLOCKED by an SCP that denies cross-account or public access. |
Narrative
SQS queue {queue.name} grants sqs:SendMessage to Principal:* with no restricting condition; any unauthenticated caller can publish messages, enabling the Phase-10 trigger chain for any Lambda consumer bound to this queue via messaging-chains.
Raw rule rules/derived/aws/sqs.yaml
id: aws-sqs-public-queue
emits: ExposedToInternet
description: An SQS queue with Principal:* granting sqs:SendMessage (no condition) is publicly writable;
any unauthenticated sender can trigger bound Lambda consumers via messaging-chains.
match:
- match_record:
resource_type: AWS::SQS::Queue
field: Policy
where:
- statement grants sqs:SendMessage (or sqs:*) to Principal:* with no effective restricting condition
where:
- node_type(?queue) == Queue
emit:
source_type: Queue
target_type: AnonymousIdentity
source: <SQS queue node>
target: <AnonymousIdentity>
permissions: []
conditions:
- resource_policy
state_logic: "ACTIVE when the queue policy has a statement granting sqs:SendMessage (or a wildcard that\
\ includes it) to Principal:* or Principal:{\"AWS\":\"*\"} with NO condition (or only non-restricting\
\ conditions such as an always-true Bool condition). CONDITIONAL(resource_policy) when a condition\
\ exists that the caller must satisfy (aws:SourceIp, aws:SourceVpc, etc.) \u2014 the queue is not\
\ fully public but is reachable from a constrained source. BLOCKED by an SCP that denies cross-account\
\ or public access."
confidence: 0.98
derived_from:
- aws-sqs-public-send-policy (explicit)
false_positive_note: "Principal:* WITH a meaningful condition (aws:SourceIp range, aws:SourceVpc, aws:PrincipalOrgID)\
\ is NOT ExposedToInternet \u2014 it is conditionally reachable. Downgrade to CONDITIONAL(condition_expression)\
\ when a non-trivial condition is present. aws:PrincipalOrgID restricts to the org \u2014 ExposedToTenant,\
\ not ExposedToInternet. An sqs:ReceiveMessage-only wildcard grant does NOT make the queue a public\
\ write target; check that the allowed action includes sqs:SendMessage. VPC endpoint policies (not\
\ queue policies) do not appear in GetQueueAttributes[Policy] and are handled separately."
narrative: SQS queue {queue.name} grants sqs:SendMessage to Principal:* with no restricting condition;
any unauthenticated caller can publish messages, enabling the Phase-10 trigger chain for any Lambda
consumer bound to this queue via messaging-chains.