Amazon Simple Queue Service (SQS) is a managed message queuing service for application-to-application (A2A) communication. Amazon SQS can store
messages encrypted as soon as they are received. In the case that adversaries gain physical access to the storage medium or otherwise leak a message
from the file system, for example through a vulnerability in the service, they are not able to access the data.
Ask Yourself Whether
- The queue contains sensitive data that could cause harm when leaked.
- There are compliance requirements for the service to store data encrypted.
There is a risk if you answered yes to any of those questions.
Recommended Secure Coding Practices
It’s recommended to encrypt SQS queues that contain sensitive information. Encryption and decryption are handled transparently by SQS, so no
further modifications to the application are necessary.
Sensitive Code Example
For aws_sqs_queue:
resource "aws_sqs_queue" "queue" {
name = "sqs-unencrypted"
sqs_managed_sse_enabled = false # Sensitive, encryption disabled
}
Compliant Solution
For aws_sqs_queue:
resource "aws_sqs_queue" "queue" {
name = "sqs-encrypted"
sqs_managed_sse_enabled = true
}
See