0

I am new to Apache Kafka, and here is what I have done so far,

  1. Downloaded kafka_2.12-2.1.0
  2. Make Batch file for Zookeeper to run zookeeper server:

    start kafka_2.12-2.1.0.\bin\windows\zookeeper-server-start.bat kafka_2.12-2.1.0.\config\zookeeper.properties

  3. Make Batch File for Apache Kafka server

    start kafka_2.12-2.1.0\bin\windows\kafka-server-start.bat kafka_2.12-2.1.0\config\server.properties

  4. Started A Producer using batch file.

    start kafka_2.12-2.1.0.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic 3drocket-player

It is running fine but now I am looking for authentication. As I have to implement a consumer with specific auth settings (requirement by the client). Like security protocol is SASL_SSL and SSL mechanism is GSSAPI. For this reason, I tried to search and find confluet documentation but the problem is it is too abstract that how to take each and every step.

I am looking for detail configuration steps according to my setup. How to configure my kafka server with SASL SSL and GSSAPI protocol. Initially I found that GSSAPI/Keberos has a separate server then, do i need to install more server? Within Confluent Kafka is there any built-in solution.

Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
  • 1
    GSSAPI is not an "_SSL mechanism_", its an abstraction layer over different authentication mechanisms (Kerberos, NTLM) trying to coexist on some platforms. https://serverfault.com/questions/139896/what-is-sasl-gssapi – mazaneicha Mar 21 '20 at 16:11
  • I found that SASL_SSL can be implemented through GSSAPI/Kerberoz – Muhammad Faizan Khan Mar 28 '20 at 05:44

2 Answers2

0

Configure a SASL port in server.properties

e.g)

listeners=SASL_SSL://host.name:port
security.inter.broker.protocol=SASL_SSL
sasl.mechanism.inter.broker.protocol=GSSAPI
sasl.enabled.mechanisms=GSSAPI
sasl.kerberos.service.name=kafka
ssl.keystore.location=/path/to/keystore.jks
ssl.keystore.password=keystore_password
ssl.truststore.location=/path/to/truststore.jks
ssl.truststore.password=truststore_password
ssl.enabled.protocols=TLSv1.2,TLSv1.1,TLSv1

https://kafka.apache.org/documentation/#security_configbroker https://kafka.apache.org/documentation/#security_sasl_config

Client: When you run the Kafka client, you need to set these properties.

security.protocol=SASL_SSL
ssl.truststore.location=/path/to/truststore.jks
ssl.truststore.password=truststore_password
sasl.mechanism=GSSAPI
sasl.kerberos.service.name=kafka

https://kafka.apache.org/documentation/#security_configclients https://kafka.apache.org/documentation/#security_sasl_kerberos_clientconfig

Then configure the JAAS configuration

KafkaClient {
   com.sun.security.auth.module.Krb5LoginModule required
   useKeyTab=true
   keyTab="path/to/kafka_client.keytab"
   storeKey=true
   useTicketCache=false
   principal="kafka-client-1@EXAMPLE.COM";
};
S.Lim
  • 62
  • 4
  • where is the kerberos server? and what is JAAS configuration? – Muhammad Faizan Khan Mar 26 '20 at 07:25
  • If you want to use kerberized service, you need to set up the server. Please check this first. https://web.mit.edu/kerberos/krb5-devel/doc/admin/install.html JAAS is just a configuration file https://docs.confluent.io/current/kafka/authentication_sasl/index.html#jaas-configurations – S.Lim Mar 26 '20 at 12:46
  • You mean i have to setup a separate server for kerberos? – Muhammad Faizan Khan Mar 28 '20 at 06:35
0

... SASL/GSSAPI is for organizations using Kerberos (for example, by using Active Directory). You don’t need to install a new server just for Apache Kafka®. Ask your Kerberos administrator for a principal for each Kafka broker in your cluster and for every operating system user that will access Kafka with Kerberos authentication (via clients and tools). https://docs.confluent.io/current/kafka/authentication_sasl/authentication_sasl_gssapi.html#kafka-sasl-auth-gssapi ....

Alf Baez
  • 3
  • 2
  • From Review: Hi, while links are great way of sharing knowledge, they won't really answer the question if they get broken in the future. Add to your answer the essential content of the link which answers the question. In case the content is too complex or too big to fit here, describe the general idea of the proposed solution. Remember to always keep a link reference to the original solution's website. See: [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer) – sɐunıɔןɐqɐp Jun 04 '20 at 17:04