Amazon Managed Streaming for Apache Kafka (MSK) provides fully managed Kafka clusters. Security risks include credential theft, topic hijacking, and real-time data interception.
Managed Kafka brokers with ZooKeeper or KRaft mode. Supports SASL/SCRAM, IAM, and mTLS authentication. Topics store real-time streaming data from producers to consumers.
Attack note: Plaintext listeners (9092) allow unauthenticated access. SASL credentials often stored in Secrets Manager.
MSK Connect runs Kafka Connect connectors. MSK Serverless auto-scales capacity. Both integrate with VPC, IAM, and can connect to external data sources.
Attack note: Connectors with overly permissive IAM roles can access S3, DynamoDB, and other AWS services
MSK clusters can expose real-time data streams including PII, financial transactions, and system events. Compromised consumers can intercept all messages. Producers can inject malicious data.
aws kafka list-clusters-v2aws kafka describe-cluster-v2 \
--cluster-arn CLUSTER_ARNaws kafka get-bootstrap-brokers \
--cluster-arn CLUSTER_ARNkafka-topics.sh --bootstrap-server BROKER:9092 \
--listkafka-consumer-groups.sh \
--bootstrap-server BROKER:9092 --listkafka-console-consumer.sh \
--bootstrap-server BROKER:9092 \
--topic TOPIC_NAME \
--from-beginningkafka-console-producer.sh \
--bootstrap-server BROKER:9092 \
--topic TOPIC_NAMEkafka-topics.sh \
--bootstrap-server BROKER:9092 \
--listkafka-topics.sh \
--bootstrap-server BROKER:9092 \
--describe --topic TOPIC_NAMEkafka-consumer-groups.sh \
--bootstrap-server BROKER:9092 \
--group GROUP_ID \
--reset-offsets --to-earliest \
--topic TOPIC_NAME --executeaws secretsmanager get-secret-value \
--secret-id AmazonMSK_CLUSTER_NAME{
"Effect": "Allow",
"Action": "kafka:*",
"Resource": "*"
}Full MSK access including cluster management and all topics
{
"Effect": "Allow",
"Action": [
"kafka-cluster:Connect",
"kafka-cluster:ReadData"
],
"Resource": [
"arn:aws:kafka:*:*:cluster/CLUSTER/*",
"arn:aws:kafka:*:*:topic/CLUSTER/*/TOPIC"
]
}Only connect and read from specific topic
{
"Effect": "Allow",
"Action": [
"kafka-cluster:*Topic*",
"kafka-cluster:ReadData",
"kafka-cluster:WriteData"
],
"Resource": "*"
}Read/write to all topics - data exposure risk
{
"Effect": "Allow",
"Action": [
"kafka-cluster:Connect",
"kafka-cluster:WriteData"
],
"Resource": [
"arn:aws:kafka:*:*:topic/CLUSTER/*/events-*"
]
}Only produce to topics matching pattern
Use IAM authentication instead of SASL/SCRAM for better access control.
aws kafka update-security --authentication-info ClientBroker=TLS,Iam=ENABLEDOnly allow TLS connections on port 9094. Disable port 9092.
Require mutual TLS for client authentication with ACM certificates.
Send broker logs to CloudWatch for security monitoring and audit.
aws kafka update-monitoring --logging-info BrokerLogs={CloudWatchLogs={Enabled=true}}Implement fine-grained Kafka ACLs to restrict topic access per principal.
Restrict inbound to specific CIDR ranges. No 0.0.0.0/0 access.
AWS MSK Security Card • Toc Consulting
Always obtain proper authorization before testing