Description
A new SNS topic with an empty kms_master_key_id has no KMS encryption for stored message bodies. After you set the key, SNS encrypts newly published bodies at rest and decrypts them for delivery.
Potential impact
The change leaves existing backlogged messages as they were. Keep sensitive information out of topic names, message subjects and attributes, which are outside this encryption.
Remediation
Specify a symmetric encryption key in the topic’s Region and grant publishers and integrated services the key permissions they need. Use HTTPS and Signature Version 4 for requests to the encrypted topic. Publish a test message, confirm receipt, and review storage encryption and access policies at the destination.
Examples
Replace alias/MyAlias in the second excerpt with the alias of the key you intend to use.
Before
resource "aws_sns_topic" "user_updates" {
name = "user-updates-topic"
kms_master_key_id = ""
}
After
resource "aws_sns_topic" "user_updates" {
name = "user-updates-topic"
kms_master_key_id = "alias/MyAlias"
}