You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Set up TLS encryption for communication between Kafka clients and Kafka brokers, Set up SSL authentication of clients for ESP Kafka clusters
3
+
description: Set up TLS encryption for communication between Kafka clients and Kafka brokers, Set up SSL authentication of clients for ESP Kafka clusters.
4
4
ms.service: hdinsight
5
5
ms.topic: how-to
6
6
ms.custom: hdinsightactive
7
-
ms.date: 04/03/2023
7
+
ms.date: 04/08/2024
8
8
---
9
9
10
10
# Set up TLS encryption and authentication for ESP Apache Kafka cluster in Azure HDInsight
@@ -37,10 +37,10 @@ The summary of the broker setup process is as follows:
37
37
1. Once you have all of the certificates, put the certs into the cert store.
38
38
1. Go to Ambari and change the configurations.
39
39
40
-
Use the following detailed instructions to complete the broker setup:
40
+
Use the following detailed instructions to complete the broker setup:
41
41
42
-
> [!Important]
43
-
> In the following code snippets wnX is an abbreviation for one of the three worker nodes and should be substituted with `wn0`, `wn1` or `wn2` as appropriate. `WorkerNode0_Name` and `HeadNode0_Name` should be substituted with the names of the respective machines.
42
+
> [!Important]
43
+
> In the following code snippets wnX is an abbreviation for one of the three worker nodes and should be substituted with `wn0`, `wn1` or `wn2` as appropriate. `WorkerNode0_Name` and `HeadNode0_Name` should be substituted with the names of the respective machines.
44
44
45
45
1. Perform initial setup on head node 0, which for HDInsight fills the role of the Certificate Authority (CA).
46
46
@@ -64,7 +64,7 @@ Use the following detailed instructions to complete the broker setup:
64
64
1. SCP the certificate signing request to the CA (headnode0)
@@ -128,7 +128,7 @@ To complete the configuration modification, do the following steps:
128
128
1. Under **Kafka Broker** set the **listeners** property to `PLAINTEXT://localhost:9092,SASL_SSL://localhost:9093`
129
129
1. Under **Advanced kafka-broker** set the **security.inter.broker.protocol** property to `SASL_SSL`
130
130
131
-
:::image type="content" source="./media/apache-esp-kafka-ssl-encryption-authentication/properties-file-with-sasl.png" alt-text="Screenshot showing how to edit Kafka sasl configuration properties in Ambari." border="true":::
131
+
:::image type="content" source="./media/apache-esp-kafka-ssl-encryption-authentication/properties-file-with-sasl.png" alt-text="Screenshot showing how to edit Kafka configuration properties in Ambari." border="true":::
132
132
133
133
1. Under **Custom kafka-broker** set the **ssl.client.auth** property to `required`.
134
134
@@ -144,16 +144,23 @@ To complete the configuration modification, do the following steps:
144
144
> 1. ssl.keystore.location and ssl.truststore.location is the complete path of your keystore, truststore location in Certificate Authority (hn0)
145
145
> 1. ssl.keystore.password and ssl.truststore.password is the password set for the keystore and truststore. In this case as an example,` MyServerPassword123`
146
146
> 1. ssl.key.password is the key set for the keystore and trust store. In this case as an example, `MyServerPassword123`
147
-
148
-
For HDI version 4.0 or 5.0
149
-
150
-
a. If you're setting up authentication and encryption, then the screenshot looks like
151
147
152
-
:::image type="content" source="./media/apache-esp-kafka-ssl-encryption-authentication/properties-file-authentication-as-required.png" alt-text="Screenshot showing how to edit Kafka-env template property in Ambari authentication as required." border="true":::
153
-
154
-
b. If you are setting up encryption only, then the screenshot looks like
148
+
1. To Use TLS 1.3 in Kafka, add following configs to the Kafka configs in Ambari.
149
+
1. `ssl.enabled.protocols=TLSv1.3`
150
+
1. `ssl.protocol=TLSv1.3`
151
+
152
+
> [!Important]
153
+
> 1. TLS 1.3 works with HDI 5.1 kafka version only.
154
+
> 1. If you use TLS 1.3 at server side, you should use TLS 1.3 configs at client too.
155
+
156
+
1. For HDI version 4.0 or 5.0
157
+
1. If you're setting up authentication and encryption, then the screenshot looks like
158
+
159
+
:::image type="content" source="./media/apache-esp-kafka-ssl-encryption-authentication/properties-file-authentication-as-required.png" alt-text="Screenshot showing how to edit Kafka-env template property in Ambari authentication as required." border="true":::
160
+
161
+
1. If you are setting up encryption only, then the screenshot looks like
155
162
156
-
:::image type="content" source="./media/apache-esp-kafka-ssl-encryption-authentication/properties-file-authentication-as-none.png" alt-text="Screenshot showing how to edit Kafka-env template property in Ambari authentication as none." border="true":::
163
+
:::image type="content" source="./media/apache-esp-kafka-ssl-encryption-authentication/properties-file-authentication-as-none.png" alt-text="Screenshot showing how to edit Kafka-env template property in Ambari authentication as none." border="true":::
157
164
158
165
1. Restart all Kafka brokers.
159
166
@@ -210,6 +217,11 @@ These steps are detailed in the following code snippets.
1. To Use TLS 1.3 add following configs to file `client-ssl-auth.properties`
221
+
```config
222
+
ssl.enabled.protocols=TLSv1.3
223
+
ssl.protocol=TLSv1.3
224
+
```
213
225
214
226
1. Start the admin client with producer and consumer options to verify that both producers and consumers are working on port 9093. Refer to [Verification](apache-kafka-ssl-encryption-authentication.md#verification) section for steps needed to verify the setup using console producer/consumer.
215
227
@@ -282,7 +294,7 @@ The details of each step are given.
282
294
cd ssl
283
295
```
284
296
285
-
1. Create client store with signed cert, and import CA certificate into the keystore and truststore on client machine (hn1):
297
+
1. Create client store with signed certificate, and import CA certificate into the keystore, and truststore on client machine (hn1):
@@ -306,6 +318,11 @@ The details of each step are given.
306
318
ssl.key.password=MyClientPassword123
307
319
308
320
```
321
+
1. To Use TLS 1.3 add following configs to file `client-ssl-auth.properties`
322
+
```config
323
+
ssl.enabled.protocols=TLSv1.3
324
+
ssl.protocol=TLSv1.3
325
+
```
309
326
310
327
## Verification
311
328
@@ -317,7 +334,7 @@ Run these steps on the client machine.
317
334
### Kafka 2.1 or above
318
335
319
336
> [!Note]
320
-
> Below commands will work if you are either using `kafka` user or a custom user which have access to do CRUD operation.
337
+
> Below commands will work if you're either using `kafka` user or a custom user which have access to do CRUD operation.
321
338
322
339
:::image type="content" source="./media/apache-esp-kafka-ssl-encryption-authentication/access-to-crud-operation.png" alt-text="Screenshot showing how to provide access CRUD operations." border="true":::
323
340
@@ -327,7 +344,7 @@ Using Command Line Tool
327
344
328
345
1. `klist`
329
346
330
-
If ticket is present, then you are good to proceed. Otherwise generate a Kerberos principle and keytab using below command.
347
+
If ticket is present, then you're good to proceed. Otherwise generate a Kerberos principle and keytab using below command.
Copy file name to clipboardExpand all lines: articles/hdinsight/kafka/apache-kafka-ssl-encryption-authentication.md
+33-13Lines changed: 33 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,10 @@ description: Set up TLS encryption for communication between Kafka clients and K
4
4
ms.service: hdinsight
5
5
ms.topic: how-to
6
6
ms.custom: hdinsightactive
7
-
ms.date: 02/20/2024
7
+
ms.date: 04/08/2024
8
8
---
9
9
10
-
# Set up TLS encryption and authentication for NonESP Apache Kafka cluster in Azure HDInsight
10
+
# Set up TLS encryption and authentication for Non-ESP Apache Kafka cluster in Azure HDInsight
11
11
12
12
This article shows you how to set up Transport Layer Security (TLS) encryption, previously known as Secure Sockets Layer (SSL) encryption, between Apache Kafka clients and Apache Kafka brokers. It also shows you how to set up authentication of clients (sometimes referred to as two-way TLS).
13
13
@@ -37,11 +37,11 @@ The summary of the broker setup process is as follows:
37
37
1. Once you have all of the certificates, put the certs into the cert store.
38
38
1. Go to Ambari and change the configurations.
39
39
40
-
Use the following detailed instructions to complete the broker setup:
41
-
42
-
> [!Important]
43
-
> In the following code snippets wnX is an abbreviation for one of the three worker nodes and should be substituted with `wn0`, `wn1` or `wn2` as appropriate. `WorkerNode0_Name` and `HeadNode0_Name` should be substituted with the names of the respective machines.
40
+
Use the following detailed instructions to complete the broker setup:
44
41
42
+
> [!Important]
43
+
> In the following code snippets wnX is an abbreviation for one of the three worker nodes and should be substituted with `wn0`, `wn1` or `wn2` as appropriate. `WorkerNode0_Name` and `HeadNode0_Name` should be substituted with the names of the respective machines.
44
+
45
45
1. Perform initial setup on head node 0, which for HDInsight fills the role of the Certificate Authority (CA).
46
46
47
47
```bash
@@ -64,7 +64,7 @@ Use the following detailed instructions to complete the broker setup:
64
64
1. SCP the certificate signing request to the CA (headnode0)
@@ -145,20 +145,29 @@ To complete the configuration modification, do the following steps:
145
145
> 1. ssl.keystore.password and ssl.truststore.password is the password set for the keystore and truststore. In this case as an example, `MyServerPassword123`
146
146
> 1. ssl.key.password is the key set for the keystore and trust store. In this case as an example, `MyServerPassword123`
147
147
148
+
1. To Use TLS 1.3 in Kafka
149
+
150
+
Add following configs to the kafka configs in Ambari
151
+
> 1. `ssl.enabled.protocols=TLSv1.3`
152
+
> 1. `ssl.protocol=TLSv1.3`
153
+
>
154
+
> [!Important]
155
+
> 1. TLS 1.3 works with HDI 5.1 kafka version only.
156
+
> 1. If you use TLS 1.3 at server side, you should use TLS 1.3 configs at client too.
148
157
149
-
For HDI version 4.0 or 5.0
158
+
1. For HDI version 4.0 or 5.0
150
159
151
160
1. If you're setting up authentication and encryption, then the screenshot looks like
1. If you are setting up encryption only, then the screenshot looks like
164
+
1. If you're setting up encryption only, then the screenshot looks like
156
165
157
-
:::image type="content" source="./media/apache-kafka-ssl-encryption-authentication/editing-configuration-kafka-env-four-encryption-only.png" alt-text="Screenshot showing how to edit kafka-env template property field in Ambari for encryption only." border="true":::
166
+
:::image type="content" source="./media/apache-kafka-ssl-encryption-authentication/editing-configuration-kafka-env-four-encryption-only.png" alt-text="Screenshot showing how to edit kafka-env template property field in Ambari for encryption only." border="true":::
158
167
159
-
160
168
1. Restart all Kafka brokers.
161
169
170
+
162
171
## Client setup (without authentication)
163
172
164
173
If you don't need authentication, the summary of the steps to set up only TLS encryption are:
@@ -210,9 +219,15 @@ These steps are detailed in the following code snippets.
1. To Use TLS 1.3 add following configs to file `client-ssl-auth.properties`
223
+
```config
224
+
ssl.enabled.protocols=TLSv1.3
225
+
ssl.protocol=TLSv1.3
226
+
```
213
227
214
228
1. Start the admin client with producer and consumer options to verify that both producers and consumers are working on port 9093. Refer to [Verification](apache-kafka-ssl-encryption-authentication.md#verification) section for steps needed to verify the setup using console producer/consumer.
215
229
230
+
216
231
## Client setup (with authentication)
217
232
218
233
> [!Note]
@@ -282,7 +297,7 @@ The details of each step are given.
282
297
cd ssl
283
298
```
284
299
285
-
1. Create client store with signed cert, and import ca cert into the keystore and truststore on client machine (hn1):
300
+
1. Create client store with signed cert, import CA cert into the keystore, and truststore on client machine (hn1):
0 commit comments