@@ -218,6 +218,7 @@ Knative supports the following SASL mechanisms:
218
218
- `PLAIN`
219
219
- `SCRAM-SHA-256`
220
220
- `SCRAM-SHA-512`
221
+ - `OAUTHBEARER` for AWS MSK IAM
221
222
222
223
To use a specific SASL mechanism replace `<sasl_mechanism>` with the mechanism of your choice.
223
224
@@ -251,6 +252,9 @@ kubectl create secret --namespace <namespace> generic <my_secret> \
251
252
--from-literal=user.skip=true
252
253
```
253
254
255
+ !!! note
256
+ `ca.crt` can be omitted to fallback to use system' s root CA set.
257
+
254
258
# ## Authentication and encryption using SSL
255
259
256
260
` ` ` bash
@@ -261,8 +265,46 @@ kubectl create secret --namespace <namespace> generic <my_secret> \
261
265
--from-file=user.key=< my_key.pem_file_path>
262
266
` ` `
263
267
264
- !!! note
265
- `ca.crt` can be omitted to fallback to use system' s root CA set.
268
+ # ## Authentication for AWS MSK IAM
269
+ AWS MSK IAM authentication requires creation of a secret and java properties configuration.
270
+
271
+ In the following ConfigMaps append the following to the listed property values. If using an assumed IAM role, add ` awsRoleArn=" <role_arn>" ` to the ` sasl.jaas.config` value.
272
+
273
+ - config-kafka-broker-data-plane
274
+ - config-kafka-broker-producer.properties
275
+ - config-kafka-broker-consumer.properties
276
+ - config-kafka-channel-data-plane
277
+ - config-kafka-channel-producer.properties
278
+ - config-kafka-channel-consumer.properties
279
+
280
+ ```
281
+ security.protocol=SASL_SSL
282
+ sasl.mechanism=OAUTHBEARER
283
+ sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required awsStsRegion="<region >";
284
+ sasl.login.callback.handler.class=software.amazon.msk.auth.iam.IAMOAuthBearerLoginCallbackHandler
285
+ sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMOAuthBearerLoginCallbackHandler
286
+ ```
287
+
288
+ Create a secret for using the default AWS credentials:
289
+
290
+ ```bash
291
+ kubectl create secret --namespace <namespace> generic <my_secret> \
292
+ --from-literal=protocol=SASL_SSL \
293
+ --from-literal=sasl.mechanism=OAUTHBEARER \
294
+ --from-literal=type=OAUTHBEARER \
295
+ --from-literal=tokenProvider=MSKAccessTokenProvider
296
+ ```
297
+
298
+ Or create a secret for using an assumed role:
299
+
300
+ ``` bash
301
+ kubectl create secret --namespace < namespace> generic < my_secret> \
302
+ --from-literal=protocol=SASL_SSL \
303
+ --from-literal=sasl.mechanism=OAUTHBEARER \
304
+ --from-literal=type=OAUTHBEARER \
305
+ --from-literal=tokenProvider=MSKRoleAccessTokenProvider \
306
+ --from-literal=roleARN=< role_arn>
307
+ ```
266
308
267
309
## Bring your own topic
268
310
0 commit comments