Security in Queues
Who may do what with a queue (IAM), which calls are audited, and how API and SQS clients authenticate.
IAM actions
Every request, through the API, the CLI, the console or the SQS endpoint, is checked against your
IAM policies. A queue's resource name is rn:ews:<region>:<organization id>:queue:queue/<queue name>,
for example rn:ews:de1:<organization id>:queue:queue/my-queue.
| Action | Access | What it allows |
|---|---|---|
queue:ListQueues | Read | List the queues of the organization and their message counts |
queue:GetQueueAttributes | Read | Read the settings and message counts of a queue |
queue:CreateQueue | Write | Create a queue |
queue:SetQueueAttributes | Write · destructive | Change the settings of a queue, including its dead-letter queue |
queue:DeleteQueue | Write · destructive | Delete a queue and every message in it |
queue:PurgeQueue | Write · destructive | Delete every message in a queue, keeping the queue |
queue:ListDeadLetterSourceQueues | Read | List the queues that use a queue as their dead-letter queue |
queue:StartMessageMoveTask | Write | Redrive a dead-letter queue: move its messages back to their source queues or to another queue (also needs SendMessage on the destination) |
queue:ListMessageMoveTasks | Read | List the recent redrives out of a dead-letter queue |
queue:SendMessage | Write | Put messages on a queue, singly or in batches |
queue:ReceiveMessage | Write | Take messages off a queue for processing (hides them while in flight) |
queue:DeleteMessage | Write · destructive | Delete a message that has been processed |
queue:ChangeMessageVisibility | Write | Extend or shorten how long a received message stays hidden |
Generated from the service’s IAM descriptor. Sensitive reads hand over secret material or source code and are recorded in the audit log like writes; destructive writes delete, overwrite or revoke.
- The message actions (
queue:SendMessage,queue:ReceiveMessage,queue:DeleteMessage,queue:ChangeMessageVisibility) are writes: a receive hides a message from your other consumers. The presetQueueReadOnlyAccesscan see queues and their counts, but not send, receive or delete. - A redrive needs
queue:StartMessageMoveTaskon the dead-letter queue andqueue:SendMessageon every queue the messages go to. - The batch operations need the action of their single form.
A worker that only consumes my-queue through the API needs this policy (replace org-id with
your organization id). A worker that uses an SQS client and looks the queue up with GetQueueUrl
also needs queue:GetQueueAttributes.
{
"Version": "2024-01-01",
"Statement": [
{
"Effect": "Allow",
"Action": ["queue:ReceiveMessage", "queue:DeleteMessage", "queue:ChangeMessageVisibility"],
"Resource": "rn:ews:de1:org-id:queue:queue/my-queue"
}
]
}Audit
Creating, changing, purging and deleting queues, and redrives, are recorded in the audit log like every other change. Sending, receiving, deleting and changing the visibility of messages are not recorded when they are allowed, as they happen thousands of times a minute; a denied attempt is recorded.
Authentication
- API and CLI: an access key in the
Authorization: EWS-ACCESS-KEY <key id>:<secret>header, or the CLI's sign-in. The console uses your session. - SQS endpoint: requests signed with Signature Version 4 with an access key from
Identity, Access keys, a legacy Object Storage key (
EWSS3…), or temporary credentials with their session token. See Use an SQS client.
Either way the key acts as its IAM user, and a key with a limit can do no more than its limit allows. Both surfaces see only the queues of the key's organization.