How do you secure a Kafka cluster?

Securing a Kafka cluster means protecting data in transit and at rest, verifying the identity of every client and broker, and restricting what authenticated identities are allowed to do.

Key Points

Example

A team might configure each broker listener with SSL for encryption and SASL/SCRAM for authentication, then add an ACL that only lets the "billing-service" principal produce to the billing-events topic, denying every other client.

# Broker (server.properties): encrypted and authenticated listener
listeners=SASL_SSL://0.0.0.0:9093
ssl.keystore.location=/etc/kafka/broker.keystore.jks
ssl.keystore.password=********
sasl.enabled.mechanisms=SCRAM-SHA-512
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-512
security.inter.broker.protocol=SASL_SSL

# Authorization: deny by default (KRaft authorizer)
authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
allow.everyone.if.no.acl.found=false
super.users=User:admin

# Only billing-service may write to billing-events
kafka-acls.sh --bootstrap-server kafka:9093 --command-config admin.properties \
  --add --allow-principal User:billing-service \
  --operation Write --topic billing-events

Interview Tip

A concise interview answer is

I secure a Kafka cluster by enabling SSL/TLS for encryption in transit, SASL for client and broker authentication, and ACLs for fine-grained authorization, on top of keeping the cluster patched, network-isolated, and monitored for unauthorized access.

Last updated: 1 November 2026

Previous question: What are some of the challenges associated with using Kafka Streams?

Next question: What security mechanisms are available in Kafka?

More Kafka (Optional) interview questions

All Kafka (Optional) questions