What security mechanisms are available in Kafka?

Kafka provides a layered set of security mechanisms covering encryption, authentication, and authorization, so clusters can be locked down against unauthorized access and eavesdropping.

Key Points

Example

A regulated financial services company might combine TLS encryption, SASL/SCRAM authentication, and per-team ACLs so that only the "fraud-detection" service account can consume from a sensitive "transactions" topic, with every access attempt logged for audit purposes.

# Client configuration (e.g. fraud-detection service)
security.protocol=SASL_SSL
sasl.mechanism=SCRAM-SHA-512
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required \
  username="fraud-detection" password="${KAFKA_PASSWORD}";
ssl.truststore.location=/etc/kafka/client.truststore.jks
ssl.truststore.password=${TRUSTSTORE_PASSWORD}

# Allow only this service to read the sensitive topic
kafka-acls.sh --bootstrap-server kafka:9093 --command-config admin.properties \
  --add --allow-principal User:fraud-detection \
  --operation Read --topic transactions --group fraud-detection

Interview Tip

A concise interview answer is

Kafka's security mechanisms cover encryption with SSL/TLS, authentication with SASL — including Kerberos — and fine-grained authorization with ACLs, and a complete setup also secures the ZooKeeper or KRaft metadata layer and encrypts data at rest at the storage level, since Kafka doesn't do that natively.

Last updated: 1 November 2026

Previous question: How do you secure a Kafka cluster?

Next question: How would you implement encryption in Kafka?

More Kafka (Optional) interview questions

All Kafka (Optional) questions