An SNS topic, SQS queue or SageMaker notebook is defined without encryption at rest
What it finds
Messages waiting in topics and queues, and the data on notebook volumes, can include personal data and credentials. Encrypting them with a KMS key keeps them unreadable to anyone with access to the underlying storage.
Reported are, in files that use the CDK, SNS Topic without masterKey and CfnTopic without kmsMasterKeyId, SQS Queue with encryption: QueueEncryption.UNENCRYPTED and CfnQueue with sqsManagedSseEnabled: false, and SageMaker CfnNotebookInstance without kmsKeyId.
From the rule's source, unencrypted_messaging.rs.
import * as sns from "aws-cdk-lib/aws-sns";declare const stack: any;declare const key: any;export const alerts = new sns.Topic(stack, "Alerts", { displayName: "alerts" });tx0 reports: this resource keeps its data without encryption at restexport const safe = new sns.Topic(stack, "Safe", { masterKey: key }); Turn it on, off or suppress it
The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/ts:unencrypted-messaging" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:unencrypted-messaging] reason="..."tx0 explain tx0/ts:unencrypted-messaging shows the same in the terminal. Found a false positive? Report it.