Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Cloudera Employee
Created on 11-27-2018 03:59 PM
Steps:
- When configuring a Kafka broker to use only SSL, you can have authentication and encryption by enabling 2-ways SSL by using parameter ssl.client.auth=required.
- Go to Ambari > Kafka > configs > custom Kafka-broker, add ssl.client.auth=required parameter.
- In this case certificate owner name (subject) works as username & authentication happens with this username. You have to add server certificate owner name from each broker as superuser (usernames separated by semicolon) so that each broker can access resources from other brokers.
Example: In the case of two brokers you need to add two server certificate owner names to superuser. Go to Ambari > kafka > configs > custom kafka-broker, configure super.users parameter super.users = User:CN=user1,OU=kafka,O=kafka,L=kafka,ST=kafka,C=xx;User:CN=user2,OU=kafka,O=kafka,L=kafka,ST=kafka,C=xx
./kafka-acls.sh --authorizer kafka.security.auth.SimpleAclAuthorizer --authorizer-properties zookeeper.connect=<zkhost>:<port> --add --allow-principal User:"CN=kafka,OU=kafka,O=kafka,L=kafka,ST=kafka,C=xx" --cluster --producer --topic test ./kafka-console-producer.sh --broker-list <broker>:<port> --topic test --producer.config <client-ssl-path>/client-ssl.properties --security-protocol SSL
security.protocol=SSL ssl.truststore.location=<client.truststore.jks> ssl.truststore.password=<truststore-password> ssl.keystore.location=<client.keystore.jks> ssl.keystore.password=<keystore-password> ssl.key.password=<key-password>
./kafka-acls.sh --authorizer kafka.security.auth.SimpleAclAuthorizer --authorizer-properties zookeeper.connect=<zkhost>:<port> --add --allow-principal User:"CN=kafka,OU=kafka,O=kafka,L=kafka,ST=kafka,C=xx" --group=* --consumer --topic test ./kafka-console-consumer.sh --bootstrap-server <broker>:<port> --topic test --security-protocol SSL --consumer.config <client-ssl-path>/client-ssl.properties --from-beginning
- Build the custom jar & copy the jar to <kafka-broker>/libs/ folder in all brokers
- Configure below parameter in Ambari > kafka > configs > custom kafka-broker to load the custom class
- principal.builder.class=kafka.security.auth.CustomPrincipalBuilder
6,626 Views