mirror of
https://github.com/floci-io/floci.git
synced 2026-11-30 08:55:17 -05:00
fix(iam): check an SQS redrive as the actions its guide gives each queue (#9743)
StartMessageMoveTask was checked as sqs:StartMessageMoveTask alone, on both its SourceArn and its DestinationArn, so a caller granted the permissions AWS requires was refused on the destination, and one granted the action alone on the dead-letter queue was let through. ListMessageMoveTasks was checked as its own action alone. The Amazon SQS developer guide's table of a dead-letter queue redrive's minimum permissions gives each task's actions of each queue: "Add the sqs:StartMessageMoveTask, sqs:ReceiveMessage, sqs:DeleteMessage, and sqs:GetQueueAttributes of the dead-letter queue", "Add the sqs:SendMessage of the destination queue", and "Add the sqs:ListMessageMoveTasks and sqs:GetQueueAttributes of the dead-letter queue". The API reference names each queue's parameter: SourceArn "only ARNs of dead-letter queues (DLQs)", DestinationArn "specify the destination queue". AWS's own fidelity check (iam__sqs__sts/check_start_message_move_task_requires_composite_source_and_destination_permissions in aws/aws-emulator-evaluation-suite) refuses a caller granted sqs:StartMessageMoveTask alone on the dead-letter queue, naming sqs:ReceiveMessage on it, and lets the call through once the five are granted. tools/aws/fetch_sqs_redrive_permissions.py copies the table's rows and those parameter sentences into tools/aws/sources/sqs-redrive-permissions.json, a new PERMISSION_SOURCES entry, and the request-resources generator's task_permission_resources reads it: the row naming the operation's own action, each action on the resource the rules read from the parameter naming its queue, a queue the request names by no such parameter being the one the row names the operation's own action of. --verify checks each row's actions against the Service Reference's AuthorizedActions. Only StartMessageMoveTask and ListMessageMoveTasks change; CancelMessageMoveTask names its task by handle and keeps its reading.
This commit is contained in:
1 parent
a98a43d519
commit
1c84d5eccf
12 files changed
+718
-13
No files matched your search
@@ -82,6 +82,9 @@ on:
|
||||
- 'tools/aws/fetch_ssm_session_permissions.py'
|
||||
- 'tools/aws/sources/ssm-session-permissions.json'
|
||||
- 'tools/aws/test_fetch_ssm_session_permissions.py'
|
||||
- 'tools/aws/fetch_sqs_redrive_permissions.py'
|
||||
- 'tools/aws/sources/sqs-redrive-permissions.json'
|
||||
- 'tools/aws/test_fetch_sqs_redrive_permissions.py'
|
||||
- 'src/main/resources/aws/dynamodb-condition-keys.json'
|
||||
- 'tools/aws/regen_dynamodb_condition_keys.py'
|
||||
- 'tools/aws/test_regen_dynamodb_condition_keys.py'
|
||||
|
||||
Reference in new issue
Block a user