Skip to main content
HIGHMSKSecurity

MSK Encryption Weak

msk-encryption-weak

What this rule checks

Detects MSK clusters without TLS for client-broker traffic, without inter-broker encryption, or using AWS-managed keys for at-rest encryption.

How to fix it

  1. 1Set ClientBroker to TLS in EncryptionInTransit
  2. 2Set InCluster to true in EncryptionInTransit
  3. 3Specify DataVolumeKMSKeyId for at-rest encryption
FlaggedClient-broker traffic is set to PLAINTEXT and inter-broker encryption is disabled, so Kafka data travels unencrypted.
import { aws_msk as msk, aws_ec2 as ec2 } from 'aws-cdk-lib';

const vpc = new ec2.Vpc(this, 'Vpc');
new msk.CfnCluster(this, 'Cluster', {
  clusterName: 'events',
  kafkaVersion: '3.5.1',
  numberOfBrokerNodes: 3,
  brokerNodeGroupInfo: {
    instanceType: 'kafka.m5.large',
    clientSubnets: vpc.privateSubnets.map((s) => s.subnetId),
  },
  encryptionInfo: {
    encryptionInTransit: { clientBroker: 'PLAINTEXT', inCluster: false },
  },
});
FixedSetting clientBroker to TLS, inCluster to true, and a customer-managed dataVolumeKmsKeyId encrypts traffic in transit and broker volumes at rest.
import { aws_msk as msk, aws_ec2 as ec2, aws_kms as kms } from 'aws-cdk-lib';

const vpc = new ec2.Vpc(this, 'Vpc');
new msk.CfnCluster(this, 'Cluster', {
  clusterName: 'events',
  kafkaVersion: '3.5.1',
  numberOfBrokerNodes: 3,
  brokerNodeGroupInfo: {
    instanceType: 'kafka.m5.large',
    clientSubnets: vpc.privateSubnets.map((s) => s.subnetId),
  },
  encryptionInfo: {
    encryptionInTransit: { clientBroker: 'TLS', inCluster: true },
    encryptionAtRest: { dataVolumeKmsKeyId: new kms.Key(this, 'MskKey').keyId },
  },
});

CDK Insights pinpoints the exact file and line in your CDK source for every finding, so you can jump straight to the fix.

Affected resource types

AWS::MSK::Cluster

Compliance frameworks

SOC2HIPAAPCI-DSSNIST

AWS documentation

Read the AWS guidance

Intentional? Suppress this finding

Sometimes a flag is deliberate β€” a genuinely public endpoint, say. You can dismiss msk-encryption-weak and the reason is kept in the report, not silently hidden.

In .cdk-insights.json:

{
  "ignoreRules": [
    { "id": "msk-encryption-weak", "reason": "Why this is intentional" }
  ]
}

Or inline in your CDK code:

Validations.of(scope).acknowledge({
  id: 'cdk-insights::msk-encryption-weak',
  reason: 'Why this is intentional',
});

Use the rule ID msk-encryption-weak shown above β€” not the CDK-* ID from SARIF / GitHub code scanning. To dismiss every finding on one construct instead, use ignorePaths. Suppression docs β†’

Catch this in your stack

$ npx cdk-insights scan

CDK Insights runs this and 118+ other rules locally against your synthesised CDK app β€” free, no account, your code never leaves your machine.

More MSK rules