Queues, topics and event buses are the connective tissue of AWS applications, and every one of them carries a resource policy that can quietly let another account, another service or the whole internet send, read or subscribe. Amazon SQS, Amazon SNS and Amazon EventBridge move orders, alerts, audit events and commands between services, so a loose policy can leak data, inject forged messages into a workload, or turn a rule into a delivery channel to an outside account. This guide covers the identity model the three services share, privileged actions, service integrations and API destination credentials, CloudTrail logging, encryption and the misconfigurations seen most often. It is written for AWS platform engineers, application security teams and cloud security reviewers. For function-level detail, see the AWS Lambda Security Guide; for the wider serverless model, the Serverless Security Guide.
This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.
Key takeaways
- The resource policy is the perimeter. AWS's first best practice for both SQS and SNS is to avoid policies whose principal is "*" or empty. A wildcard principal without a strong condition makes a queue or topic usable by any AWS account.
- Service grants need source conditions. When S3, SNS or EventBridge delivers to a queue, topic or function, scope the grant with aws:SourceArn and aws:SourceAccount so another customer's resource cannot use the same service principal to reach yours.
- Accepting events from other accounts changes every rule. AWS warns that rules without an account field match events from any account allowed to send to the bus. Add account to every rule on a shared bus.
- Message traffic is not logged by default. SQS SendMessage, ReceiveMessage and DeleteMessage are CloudTrail data events that need advanced event selectors. Policy changes such as SetQueueAttributes and AddPermission are management events and should alert.
- Encryption has edges. SQS SSE encrypts the message body, not queue names, attributes or message metadata, and a queue on the AWS managed key alias/aws/sqs cannot invoke a Lambda function in another account. Use customer managed keys for cross-account flows.
How identity and access work in EventBridge, SNS and SQS
All three services evaluate two kinds of policy on every call: the caller's IAM identity policy, and a resource-based policy on the queue, topic or event bus. Cross-account access needs both sides to allow it. AWS describes the same three-role model for SQS and SNS, which is a useful starting point for least privilege.
| Service | Resource policy | Writer actions | Reader or consumer actions | Admin actions |
|---|---|---|---|---|
| Amazon SQS | Queue policy (the Policy attribute, also set through AddPermission) | sqs:SendMessage, SendMessageBatch | sqs:ReceiveMessage, DeleteMessage, ChangeMessageVisibility | CreateQueue, DeleteQueue, SetQueueAttributes, AddPermission, RemovePermission, PurgeQueue |
| Amazon SNS | Topic policy | sns:Publish | sns:Subscribe (subscribers receive copies of every message) | CreateTopic, DeleteTopic, SetTopicAttributes, AddPermission |
| Amazon EventBridge | Event bus policy (AWS::Events::EventBusPolicy in CloudFormation) | events:PutEvents | events:PutRule and PutTargets (a rule decides where matched events go) | Bus policy changes, DeleteRule, RemoveTargets, DisableRule, connection and API destination management |
Rules are read access. In EventBridge, the right to create a rule is the right to read events. AWS documents that a principal authorised for events:PutRule can create a rule that matches events and sends them to a target. Restrict which events a principal can route with the events:source and events:detail-type condition keys, and where they can send them with events:TargetArn. A broad PutRule plus PutTargets grant lets a developer copy every CloudTrail API call event on the bus to a queue they control.
Cross-account buses. The default event bus accepts events only from its own account until a bus policy grants more. A bus policy can allow PutEvents, PutRule and PutTargets from another account, from an organisation through aws:PrincipalOrgID, or from everyone. APIs such as PutRule accept an event bus ARN, so a permitted account can create rules on your bus without assuming a role. AWS also notes that events forwarded by a receiver account to a third account are not delivered, which limits chaining but does not remove the need for tight bus policies.
Encryption and identity. With SSE-KMS, the KMS key policy becomes a third policy in the path. A producer that can call SendMessage but cannot use the key fails, and the AWS managed key alias/aws/sqs cannot be granted to other accounts, which is why AWS states that a queue using it cannot invoke a Lambda function in another account. Plan customer managed keys for every cross-account or cross-service flow. See the AWS KMS Security Guide.
Admin roles and privileged access
The highest-risk permissions are the ones that change who can use a resource, not the ones that send messages.
| Action | Why it is privileged | Who should hold it |
|---|---|---|
| sqs:SetQueueAttributes, sqs:AddPermission | Rewrites the queue policy, encryption key and redrive settings | Infrastructure pipeline role only |
| sns:SetTopicAttributes, sns:AddPermission | Rewrites the topic policy, opening publish or subscribe | Infrastructure pipeline role only |
| sns:Subscribe on sensitive topics | A new subscription to an outside endpoint receives every message | Named consumer roles; deny for others |
| events:PutPermission or bus policy updates | Opens a bus to other accounts or the organisation | Platform team |
| events:PutRule plus events:PutTargets | Routes matched events, including CloudTrail API call events, to any target the role can name | Scoped by events:source, events:detail-type and events:TargetArn |
| events:CreateConnection, UpdateConnection | Stores credentials for outbound API destinations | Integration owners, with change control |
| sqs:PurgeQueue, DeleteQueue, DeleteTopic | Destroys messages and can hide evidence | Break-glass or pipeline only |
- Deploy policies from code: manage queue, topic and bus policies through infrastructure as code and deny console changes with an SCP that excludes the pipeline role. See the AWS CloudFormation and CDK Security Guide.
- Use resource control policies for a data perimeter: an RCP can deny SQS and SNS access to principals outside your organisation regardless of what an individual queue policy says. See the AWS Resource Control Policies and Data Perimeter Guide.
- Use roles, not access keys: AWS's SQS and SNS best practices both say not to store long-term access keys in applications or on EC2 instances, because they are not rotated automatically. Producers and consumers should use IAM roles.
Integrations, API tokens and service accounts
Every integration between these services is a non-human identity: a service principal acting under a resource policy, or an IAM role that EventBridge assumes to reach a target.
- Service principals: EventBridge delivers to SNS, SQS, Lambda and API Gateway as events.amazonaws.com. AWS's example API Gateway policy restricts that principal with an ArnEquals condition on aws:SourceArn naming the rule. Apply the same pattern to queues and topics, and add aws:SourceAccount, so only your rule, bucket or topic can deliver.
- SNS to SQS fan-out: the queue policy should allow sqs:SendMessage from sns.amazonaws.com only where aws:SourceArn equals the topic ARN. A queue that allows any SNS topic can be subscribed to by a topic in another account.
- Target roles: for API destinations and some targets, EventBridge assumes an IAM role you supply. Scope it to the single target and trust events.amazonaws.com with an aws:SourceArn condition on the rule.
- API destination connections: connections support Basic, OAuth client credentials and API key authorisation. EventBridge stores the credentials as a secret in AWS Secrets Manager through the service-linked role AWSServiceRoleForAmazonEventBridgeApiDestinations. Treat each connection as a stored third-party credential: inventory it, rotate it, and use the narrowest token the SaaS provider allows. Endpoints must use HTTPS. De-authorising a connection removes its stored parameters. See the API Key Management Guide.
- HTTP and HTTPS subscriptions: AWS advises against subscriptions to raw IP addresses and recommends a domain name. Subscribers must verify message signatures before processing: SignatureVersion 1 uses SHA1 and SignatureVersion 2 uses SHA256, which AWS describes as the recommended option. Reject messages with an unexpected TopicArn, retrieve the signing certificate over HTTPS, and prefer the SDK's built-in validation over hand-written code.
- Unsubscribe authentication: unless one-click unsubscribe is required, confirm subscriptions with AuthenticateOnUnsubscribe set to true. Otherwise an unauthenticated request can remove a subscription and silently stop alerts.
Logging and detection
CloudTrail records control plane calls for all three services by default. Message traffic is a different matter.
| Event | CloudTrail category | What it can indicate | Response |
|---|---|---|---|
| SetQueueAttributes or AddPermission changing the Policy attribute | Management (default) | Queue opened to another account or wildcard | Diff the policy; revert if not from the pipeline |
| SetTopicAttributes or AddPermission on a topic | Management | Publish or subscribe opened up | Same as above |
| Subscribe to an external email, HTTP or account endpoint | Management | Data being copied out of the account | Confirm the endpoint owner |
| PutPermission, PutRule, PutTargets on a bus | Management | New routing of events, possibly to another account | Check target ARN and account against an allow list |
| CreateConnection, UpdateConnection | Management | New or changed outbound credentials | Confirm with the integration owner |
| PurgeQueue, DeleteQueue, DeleteTopic | Management | Destruction of messages or alert channels | Alert security operations |
| SendMessage, ReceiveMessage, DeleteMessage | Data event, off by default, extra cost, resource type AWS::SQS::Queue | Who read or injected messages | Enable for sensitive queues with advanced event selectors |
CloudTrail redacts the SQS message body in data events (the documented sample shows HIDDEN_DUE_TO_SECURITY_REASONS), so the record shows who acted on which queue but not what the message said. Enable data events selectively, for example only SendMessage on queues that trigger privileged automation, because volume and cost grow quickly. See the AWS CloudTrail Guide.
Continuous checks. IAM Access Analyzer reports queues and topics shared outside your zone of trust; see the IAM Access Analyzer Guide. Security Hub control SQS.1 checks that queues are encrypted at rest.
Metrics that show it is working
- External access findings: open Access Analyzer findings on SQS queues and SNS topics (target: zero unapproved).
- Source-conditioned grants: share of service principal statements in queue and topic policies that carry aws:SourceArn or aws:SourceAccount (target: 100 per cent).
- Account-scoped rules: share of rules on cross-account buses that include an account field (target: 100 per cent).
- Policy changes outside the pipeline: SetQueueAttributes, SetTopicAttributes and bus policy changes by non-pipeline principals per month (target: zero).
- Connection credential age: days since each API destination connection was last rotated, against your secret rotation standard.
Hardening baseline
- Inventory first: list every queue, topic and bus with its policy, key, owner tag and any cross-account principal. Run Access Analyzer across the organisation to find external sharing.
- Deny insecure transport: add a Deny statement where aws:SecureTransport is false to every queue and topic policy. AWS notes that an SNS topic encrypted with KMS does not automatically reject HTTP publishing, so the policy is needed. SSE-enabled SQS queues already require HTTPS and Signature Version 4 and reject anonymous requests.
- Encrypt at rest: use SSE-SQS or SSE-KMS for queues and SSE for topics. Choose a customer managed key where producers or consumers are in other accounts or where you need key-level access control. Remember that only messages sent after encryption is enabled are encrypted.
- Remove wildcard principals: replace "*" with named roles or with "*" constrained by aws:PrincipalOrgID, aws:SourceArn or aws:SourceAccount.
- Use VPC endpoints for internal traffic: both SQS and SNS support endpoint policies and resource policies that limit access to particular VPCs or endpoints, typically with aws:SourceVpce.
- Scope rule creation: grant events:PutRule with events:source and events:detail-type conditions, and PutTargets with events:TargetArn, so teams can route only their own events to their own targets.
- Add the account field to every rule on a bus that accepts events from other accounts, as AWS strongly recommends.
- Configure dead-letter queues with matching encryption: a message moved to a DLQ keeps its original encryption state, so an unencrypted source feeding an encrypted DLQ stays unencrypted. Encrypt the source.
- Roll out safely: apply new policies to one non-production queue or topic, watch CloudTrail and application errors for AccessDenied, then promote through the pipeline. Roll back by redeploying the previous policy version from source control.
Framework mapping
| Control area | NIST SP 800-53 Rev 5 | NIST CSF 2.0 | ATT&CK |
|---|---|---|---|
| Resource policies and least privilege | AC-3, AC-6 | PR.AA-05 | T1537 Transfer Data to Cloud Account |
| Encryption in transit and at rest | SC-8, SC-28 | PR.DS-01, PR.DS-02 | Not applicable |
| Service integration roles and stored credentials | IA-5, AC-6 | PR.AA-01 | T1552.001 Credentials In Files (stored API keys) |
| CloudTrail management and data events | AU-2, AU-12 | DE.CM-09 | T1078.004 Cloud Accounts |
| Policy as code and change control | CM-2, CM-3 | PR.PS-01 | Not applicable |
In ISO/IEC 27001:2022 terms the work sits under A.8.3 Information access restriction, A.8.24 Use of cryptography and A.8.15 Logging.
Common misconfigurations
- Wildcard queue policies: "Principal": "*" with sqs:SendMessage or sqs:ReceiveMessage and no condition, often left from a tutorial, letting any AWS account read or inject messages.
- Unconditioned service principals: a queue that trusts sns.amazonaws.com or s3.amazonaws.com without aws:SourceArn, so a resource in another account can deliver to it.
- Shared bus without account filters: a bus opened to the organisation or to all accounts, with existing rules that now fire on events from any sender, including forged events that trigger automation.
- Over-broad PutRule: developers able to create rules on the default bus without conditions, giving them a copy of every CloudTrail API call event and every target they can name.
- Cross-account flows on the AWS managed key: a queue on alias/aws/sqs that silently fails to trigger a function in another account, prompting someone to disable encryption to make it work.
- Long-lived keys in producers: on-premises or third-party producers using IAM user access keys stored in configuration, which AWS advises against.
Practitioner checklist
- Run Access Analyzer and list every queue, topic and bus reachable from outside the organisation.
- Remove wildcard principals or constrain them with aws:PrincipalOrgID, aws:SourceArn and aws:SourceAccount.
- Add an aws:SecureTransport Deny to every queue and topic policy.
- Encrypt all queues and topics; use customer managed KMS keys for cross-account flows.
- Scope events:PutRule and PutTargets with source, detail-type and TargetArn conditions.
- Add the account field to all rules on buses that accept other accounts' events.
- Inventory API destination connections and rotate their stored credentials.
- Enforce SignatureVersion 2 verification and AuthenticateOnUnsubscribe for HTTP subscribers.
- Alert on policy, subscription, rule and connection changes made outside the pipeline.
- Enable SQS data events for queues that drive privileged automation.
Standards and references
- AWS: Amazon SQS security best practices
- AWS: Amazon SNS security best practices
- AWS: Permissions for Amazon EventBridge event buses
- AWS: Using IAM policy conditions in Amazon EventBridge
- AWS: Amazon EventBridge API destinations
- AWS: Encryption at rest in Amazon SQS
- AWS: Verifying the signatures of Amazon SNS messages
- AWS: Logging Amazon SQS API calls using CloudTrail
Related NHI Mgmt Group resources: Serverless Security Guide · AWS Lambda Security Guide · Cross-Account and Cross-Tenant Access Guide · AWS Resource Control Policies and Data Perimeter Guide · AWS Security Guide