Safeguard
Security Guides•

Is an SQS queue policy with Principal star ever safe?

Principal star in an SQS queue policy means anyone, including anonymous callers. When it needs conditions, what to use instead, and how to audit.

Safeguard Security Team
4 min read

A queue policy with Principal set to star grants the permission to everyone, including anonymous users, so it is safe only when strict conditions narrow it, such as a source ARN, source account or VPC endpoint. For most queues, name the exact accounts, roles or services instead.

What star means in SQS

The AWS SQS policy examples include one titled "Grant a permission to all users." It shows a statement with Principal set to star and the action ReceiveMessage, and the documentation describes the effect as granting permission to all users, anonymous users. Other examples show how to narrow that: a time window, a CIDR range, an allowlist and blocklist of address ranges. They exist because star with no condition is wide open.

AWS uses these examples to teach the policy language. That does not make them a pattern to copy into production.

Safer choices

NeedUse instead
One other AWS account sends messagesPrincipal set to that account or a role in it, with only SendMessage
SNS delivers to the queueThe SNS service principal with an aws:SourceArn condition, see the SNS to SQS policy guide
Traffic must stay in your networkAllow only through your VPC endpoint, see the VPC endpoint guide
Several accounts share the queueList each account explicitly, and give each only the actions it needs

Know the limits of cross-account grants

The SQS documentation lists actions that cross-account permissions do not cover, such as CreateQueue, DeleteQueue, ListQueues, SetQueueAttributes, AddPermission and RemovePermission. That helps you reason about what another account can do through a queue policy, but do not use it as a reason to be loose with the actions that are covered. SendMessage and ReceiveMessage are the powerful ones: the first lets someone inject work into your system, the second lets them read your messages.

Steps to audit

  1. List all queues in each account and region.
  2. Read each access policy. Search for a Principal value of star, an AWS value of star, and a Service principal without a Condition.
  3. For each hit, ask what the intended caller is. If the answer is a service or an account, replace star with that.
  4. If star must stay, add a condition for a source ARN, a source account, a source VPC endpoint or a CIDR range, and keep the action list as short as possible.
  5. Send a test message from a principal that should not be allowed and confirm it fails.
  6. Add a check to your infrastructure as code pipeline so a new star policy is flagged before deployment.

Think about what is in the queue

Even a send-only grant is risky if the consumer trusts the message. An outsider who can send can try malformed payloads against your consumer code. The consumer is an endpoint, as explained in Your queue consumer is an unreviewed endpoint. A read grant is worse, because queues often carry customer identifiers, internal URLs and tokens.

Try it yourself

Click through it at your own pace, or open it full screen. Consider how a recurring check would catch a queue policy that someone widened during an incident.

Safeguard's policies and gates can flag risky configuration in pull requests, and the free scan is a quick start on your dependencies.

Quick check

Does a CIDR range condition make a star principal safe?

It narrows the callers to a network range, which can be reasonable for known networks. Public ranges or broad corporate ranges still allow many callers, so prefer named principals.

Can the SQS console show me risky policies?

You can read each queue's access policy there. For many queues, script the review or add checks to your infrastructure code.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.