Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

2. JAR and LDAP Server

Torstein Nesby edited this page May 4, 2018 · 3 revisions

KafkaPlainSaslServer2AD

  1. git clone the project
  2. Do <project>/gradlew clean build shadowJarin the terminal window
  3. Copy <project>/build/libs/KafkaPlainSaslServer2AD-<version>-all.jar to <confluent>/share/java/kafka/ - in classpath to kafka
  4. Create ldapconfig.yaml in <confluent>/etc/kafka/ - in classpath to kafka

Content

#host of the LDAP server
host: localhost
#port of the LDAP server
port: 10636
# connectionTimout in milliseconds for LDAP 
connTimeout: 10000
# Placement of users in LDAP tree
usrBaseDN: ou=users,dc=security,dc=example,dc=com
# User attribute for DN completion
usrUid: uid
# Placement of groups in LDAP tree
grpBaseDN: ou=groups,dc=security,dc=example,dc=com
# Group attribute for DN completion
grpUid: cn
# Group membership attribute name
grpAttrName: uniqueMember
# Lifetime of user entry in cache after cache-write - IN MINUTES
usrCacheExpire: 6
# Lifetime of group entry in cache after cache-write - IN MINUTES
grpCacheExpire: 6

LDAP Server

A quick and easy LDAP server is Apache Directory Studio.

  1. Download software, create LDAP server and import the following test.ldif file

Content

dn: dc=security,dc=example,dc=com
objectClass: top
objectClass: domain
dc: security

dn: ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: users

dn: uid=srvkafkabroker,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka Broker
sn: Broker
uid: srvkafkabroker
userPassword: broker

dn: uid=srvbinder,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Service Binder
sn: Binder
uid: srvbinder
userPassword: binder

dn: uid=srvkafkasregistry,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka SRegistry
sn: SRegistry
uid: srvkafkasregistry
userPassword: sregistry

dn: uid=srvkafkaproducer,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka Producer
sn: Producer
uid: srvkafkaproducer
userPassword: producer

dn: uid=srvkafkaproducer2,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka Producer2
sn: Producer2
uid: srvkafkaproducer2
userPassword: producer2

dn: uid=srvkafkaproducer3,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka Producer3
sn: Producer3
uid: srvkafkaproducer3
userPassword: producer3

dn: uid=srvkafkaconsumer,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka Consumer
sn: Consumer
uid: srvkafkaconsumer
userPassword: consumer

dn: uid=srvkafkaconsumer2,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka Consumer2
sn: Consumer2
uid: srvkafkaconsumer2
userPassword: consumer2

dn: uid=srvkafkaconsumer3,ou=users,dc=security,dc=example,dc=com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
cn: Kafka Consumer3
sn: Consumer3
uid: srvkafkaconsumer3
userPassword: consumer3

dn: ou=groups,dc=security,dc=example,dc=com
objectClass: top
objectClass: organizationalUnit
ou: groups

dn: cn=ktconsTest,ou=groups,dc=security,dc=example,dc=com
objectClass: groupOfUniqueNames
objectClass: top
cn: ktacons
cn: ktconstest
uniqueMember: uid=srvkafkaconsumer,ou=users,dc=security,dc=example,dc=com
uniqueMember: uid=srvkafkaconsumer2,ou=users,dc=security,dc=example,dc=com

dn: cn=ktprodTest,ou=groups,dc=security,dc=example,dc=com
objectClass: groupOfUniqueNames
objectClass: top
cn: ktaprod
cn: ktprodtest
uniqueMember: uid=srvkafkaproducer3,ou=users,dc=security,dc=example,dc=com
Clone this wiki locally