MSK Client Authentication Missing
msk-client-authentication-missing
What this rule checks
Detects MSK clusters without client authentication or that allow unauthenticated access.
How to fix it
- 1Enable SASL/SCRAM, IAM auth, or mTLS in ClientAuthentication
- 2Disable Unauthenticated access
import { aws_ec2 as ec2, aws_msk as msk } from 'aws-cdk-lib';
const vpc = new ec2.Vpc(this, 'Vpc');
new msk.CfnCluster(this, 'Cluster', {
clusterName: 'orders',
kafkaVersion: '3.6.0',
numberOfBrokerNodes: 2,
brokerNodeGroupInfo: {
instanceType: 'kafka.m5.large',
clientSubnets: vpc.privateSubnets.map((s) => s.subnetId),
},
clientAuthentication: {
unauthenticated: { enabled: true },
},
});import { aws_ec2 as ec2, aws_msk as msk } from 'aws-cdk-lib';
const vpc = new ec2.Vpc(this, 'Vpc');
new msk.CfnCluster(this, 'Cluster', {
clusterName: 'orders',
kafkaVersion: '3.6.0',
numberOfBrokerNodes: 2,
brokerNodeGroupInfo: {
instanceType: 'kafka.m5.large',
clientSubnets: vpc.privateSubnets.map((s) => s.subnetId),
},
clientAuthentication: {
unauthenticated: { enabled: false },
sasl: { iam: { enabled: true } },
},
});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::ClusterIntentional? Suppress this finding
Sometimes a flag is deliberate β a genuinely public endpoint, say. You can dismiss msk-client-authentication-missing and the reason is kept in the report, not silently hidden.
In .cdk-insights.json:
{
"ignoreRules": [
{ "id": "msk-client-authentication-missing", "reason": "Why this is intentional" }
]
}Or inline in your CDK code:
Validations.of(scope).acknowledge({
id: 'cdk-insights::msk-client-authentication-missing',
reason: 'Why this is intentional',
});Use the rule ID msk-client-authentication-missing 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 scanCDK Insights runs this and 118+ other rules locally against your synthesised CDK app β free, no account, your code never leaves your machine.