Configuring mTLS
Mutual TLS (mTLS) is an extension of the standard Transport Layer Security (TLS) protocol that ensures two-way authentication, adding another layer of security beyond standard TLS. Complete the necessary tasks to configure mTLS authentication for a cluster in Streaming with Apache Kafka.
Generating Certificates
In mTLS, both the Kafka client and the Kafka brokers verify each other's identity using digital certificates. Both the Kafka client and broker must have their own certificates and the certificates must be signed by a Certificate Insurance (CA). A CA is a trusted entity that issues, signs, and stores digital certificates.
mTLS uses different types of digital certificates.
- Client certificates: issued to client (Kafka client) to authenticate a client to a server (Kafka broker) and typically signed by a CA.
- Server certificates: issued to server (Kafka broker) to authenticate to a client (Kafka client) and typically signed by a CA.
- Intermediate certificates: sit between the root CA and the leaf certificates (client or server certificates). Intermediate certificates are issued by a CA and can issue leaf certificates. Intermediate certificates enhance security by limiting access to the root CA.
- Root certificates: are the highest level of certificates in the trust hierarchy and are used to sign intermediate certificates. Root certificates are self-signed. They're installed in a trusted certificate store.
By default, Streaming with Apache Kafka broker certificates are signed by Digicert public root CA with name DigiCert Global Root G2
. DigiCert is a trusted CA and its root certificate is likely already included in the default truststore of most JDKs and client tools and you can use it to establish the secure connection.
This is an example of creating certificates using a custom truststore that you can use for test clusters. For production clusters, use certificates signed by a trusted CA.
Updating the Kafka Cluster
Update the Kafka cluster with the created certificates.
- On the Kafka clusters list page, find the cluster that you want to work with. If you need help finding the list page or the cluster, see Listing Clusters.
- From the for the cluster, select Edit cluster.
- In the Security settings section of the Edit cluster panel, enter the certificate content.
- Select Update.
Configuring Kafka Clients
To connect to a Kafka cluster using mTLS, after you set up the Kafka truststore, you update the Kafka client properties file.