Description
A new SQS queue created over HTTPS without encryption options uses SSE-SQS to encrypt message bodies. The first example explicitly sets sqs_managed_sse_enabled = false and supplies no KMS key.
Potential impact
New message bodies are then stored without encryption. The data key reuse period alone does not enable SSE.
Remediation
Set sqs_managed_sse_enabled = true for SQS-managed encryption or kms_master_key_id for SSE-KMS. Choose a customer managed key if you must edit its policy. Verify the applied settings. With SSE-KMS, test sending and receiving with the producer’s and consumer’s key permissions.
Examples
The second example uses the AWS managed KMS key alias/aws/sqs and a 300-second data key reuse period.
Before
hcl
resource "aws_sqs_queue" "example" {
name = "terraform-example-queue"
sqs_managed_sse_enabled = false
kms_data_key_reuse_period_seconds = 300
}
After
hcl
resource "aws_sqs_queue" "example" {
name = "terraform-example-queue"
kms_master_key_id = "alias/aws/sqs"
kms_data_key_reuse_period_seconds = 300
}