Skip to content

Commit 7d74e7b

Browse files
committed
add documentation for AWS MSK IAM authentication
1 parent 89f913d commit 7d74e7b

File tree

1 file changed

+44
-2
lines changed
  • docs/eventing/brokers/broker-types/kafka-broker

1 file changed

+44
-2
lines changed

docs/eventing/brokers/broker-types/kafka-broker/README.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ Knative supports the following SASL mechanisms:
218218
- `PLAIN`
219219
- `SCRAM-SHA-256`
220220
- `SCRAM-SHA-512`
221+
- `OAUTHBEARER` for AWS MSK IAM
221222
222223
To use a specific SASL mechanism replace `<sasl_mechanism>` with the mechanism of your choice.
223224
@@ -251,6 +252,9 @@ kubectl create secret --namespace <namespace> generic <my_secret> \
251252
--from-literal=user.skip=true
252253
```
253254
255+
!!! note
256+
`ca.crt` can be omitted to fallback to use system's root CA set.
257+
254258
### Authentication and encryption using SSL
255259

256260
```bash
@@ -261,8 +265,46 @@ kubectl create secret --namespace <namespace> generic <my_secret> \
261265
--from-file=user.key=<my_key.pem_file_path>
262266
```
263267

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+
```
266308

267309
## Bring your own topic
268310

0 commit comments

Comments
 (0)