A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/confluentinc/librdkafka/wiki/Using-SASL-with-librdkafka below:

Using SASL with librdkafka · confluentinc/librdkafka Wiki · GitHub

Note: This guide assumes you have a Debian/Ubuntu system. Other OS and distributions will have the same packages but names and paths may be different.
For Windows please follow the guide SASL via SSPI (Windows).

Note: librdkafka must be built with SASL support (which is enabled by default if libsasl2-dev is installed at buildtime). You can query librdkafka for enabled features by getting the builtin.features configuration property.

Kerberos keytabs (file-based pre-authenticated keys) are created for each broker in the cluster as well as for each client. They keytabs are distributed to the broker and client nodes respectively.

Decide on the following things:

NOTE: I strongly suggest reading Ubuntu's Kerberos guide.

Install the kerberos server if you do not already have a Kerberos server installed:

sudo apt-get install krb5-kdc krb5-admin-server

Answer the questions accordingly:

2. Configure Kafka broker for SASL

Follow instructions here: http://docs.confluent.io/current/kafka/sasl.html

3. Create client principal and keytab on Kerberos server
# kadmin.local -q 'addprinc -randkey ${CLIENT_NAME}/${CLIENT_HOST}@{REALM}'
# kadmin.local -q 'ktadd -k /etc/security/keytabs/${CLIENT_NAME}.keytab ${CLIENT_NAME}/${CLIENT_HOST}@{REALM}'

Securely copy the /etc/security/keytabs/${CLIENT_NAME}.keytab file to the ${CLIENT_HOST}, preferably in the same location. Set up permissions to secure the file accordingly, make sure the user that will run the Kafka client has access to read the keytab file.

4. Install SASL modules on client host

Debian/Ubuntu:

sudo apt-get install libsasl2-modules-gssapi-mit libsasl2-dev

CentOS/Redhat:

sudo yum install cyrus-sasl-gssapi cyrus-sasl-devel
5. Configure Kafka client on client host

The configuration listed below are standard librdkafka configuration properties (see CONFIGURATION.md), how these are actually set in a librdkafka based client depends on the application, for instance kafkacat uses -X <prop>=<val> command line arguments.

# Use SASL plaintext
security.protocol=SASL_PLAINTEXT

# Broker service name
sasl.kerberos.service.name=$SERVICENAME

# Client keytab location
sasl.kerberos.keytab=/etc/security/keytabs/${CLIENT_NAME}.keytab

# sasl.kerberos.principal
sasl.kerberos.principal=${CLIENT_NAME}/${CLIENT_HOST}

NOTE: Make sure to replace $... with the appropriate values above.

$ kafkacat -b ${BROKER_HOST} -L -X security.protocol=SASL_PLAINTEXT \
    -X sasl.kerberos.keytab=/etc/security/keytabs/${CLIENT_NAME}.keytab \
    -X sasl.kerberos.principal=${CLIENT_NAME}/${CLIENT_HOST}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4