Integrating KMS keys with SQS queries, cloudformation being used to deploy resources

0

I need to migrate a team from using non encryption SQS Queue to Customer Managed Keys KMS encryption.

I have a Cloud Formation template to deploy a CMK in Sandbox and Any IAM roles associated with that SQS Queue needs to be able to access the KMS key.

1개 답변
0

Hello,

Yes, producers and consumers of the queue need KMS permissions on key used for encrypting SQS queue in order to be able to send and receive messages from the queue. If appropriate KMS permissions are missing, KMSAccessDeniedException will be encountered.

Please note the permissions needed by producer to send messages to an encrypted SQS queue: { "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "kms:GenerateDataKey", "kms:Decrypt" ], "Resource": "arn:aws:kms:us-east-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab" }, { "Effect": "Allow", "Action": [ "sqs:SendMessage" ], "Resource": "arn:aws:sqs:*:123456789012:MyQueue" }] }

Below are the permissions needed by consumer to receive messages from encrypted queue:

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "kms:Decrypt" ], "Resource": "arn:aws:kms:us-east-2:123456789012:key/1234abcd-12ab-34cd-56ef-1234567890ab" }, { "Effect": "Allow", "Action": [ "sqs:ReceiveMessage" ], "Resource": "arn:aws:sqs:*:123456789012:MyQueue" }] }

In case of same account, these permissions can be added in IAM policies associated with role/user or in respective KMS key policy allowing IAM role/user with specific action.

SQS KMS permissions - https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-key-management.html

AWS
Anusha
답변함 10달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠