Skip to content
Veltoryx Technologies
ProLesson 9.3Intermediate4 min readUpdated 31 October 2026

Security Essentials: TLS, SASL, and ACLs

Harden Apache Kafka with TLS wire encryption, configure SASL/SCRAM-SHA-512 authentication, and enforce granular topic ACL authorization.

In enterprise environments, streaming sensitive customer, financial, or healthcare data over unencrypted channels introduces severe compliance and security risks. An unhardened Kafka cluster allows unauthorized network eavesdroppers to inspect plaintext payloads, spoof producer identities, or maliciously delete topic data.

Securing Kafka requires three distinct architectural layers:

  1. Encryption in Transit (TLS): Prevents packet sniffing and man-in-the-middle attacks.
  2. Authentication (SASL / mTLS): Verifies the cryptographic identity of connecting clients and brokers.
  3. Authorization (ACLs): Enforces fine-grained permissions dictating which resources a principal can read or write.
Kafka Security Architecture
Fig. 1 · Kafka Security Architecture

01Encryption in transit with TLS (SSL)

By default, Kafka clients communicate with brokers over cleartext TCP sockets (port 9092). Enabling TLS (Transport Layer Security) encrypts all network packets passing between clients, brokers, and KRaft controllers.

Keystore and truststore configuration

In Java 17 and 21, keys and certificates are managed using the modern PKCS12 format:

  • Keystore (server.keystore.p12): Contains the broker's private key and SSL certificate signed by an enterprise Certificate Authority (CA).
  • Truststore (server.truststore.p12): Contains the root and intermediate CA certificates trusted by the broker to validate client and peer certificates.

Broker server.properties configuration

properties
# Enable TLS listener alongside plaintext internal listener
listeners=INTERNAL://0.0.0.0:9092,EXTERNAL://0.0.0.0:9094
listener.security.protocol.map=INTERNAL:PLAINTEXT,EXTERNAL:SSL

ssl.keystore.location=/var/private/ssl/server.keystore.p12
ssl.keystore.password=keystoreSecret123
ssl.key.password=keystoreSecret123
ssl.keystore.type=PKCS12

ssl.truststore.location=/var/private/ssl/server.truststore.p12
ssl.truststore.password=truststoreSecret123
ssl.truststore.type=PKCS12

# Supported TLS protocols
ssl.enabled.protocols=TLSv1.3,TLSv1.2

Loading the rest of the lesson…