Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Docker OpenLDAP Server for testing LDAP applications

License

NotificationsYou must be signed in to change notification settings

rroemhild/docker-test-openldap

Repository files navigation

This Docker image provides an OpenLDAP Server for testing LDAP applications, i.e. unit tests. The server is initialized with the example domainplanetexpress.com with data from theFuturama Wiki.

Parts of the image are based on the work from Nick Stenningdocker-slapd and Bertrand Gounydocker-openldap.

The Flask extensionflask-ldapconn use this image for unit tests.

Features

  • Initialized with data from Futurama
  • Support for LDAP over TLS (STARTTLS) using a self-signed cert, or valid certificates (LetsEncrypt, etc)
  • memberOf overlay support
  • MS-AD style groups support
  • Supports Forced STARTTLS
  • Supports custom domain and custom directory structure

Usage

docker pull ghcr.io/rroemhild/docker-test-openldap:masterdocker run --rm -p 10389:10389 -p 10636:10636 ghcr.io/rroemhild/docker-test-openldap:master

Testing

# List all Usersldapsearch -H ldap://localhost:10389 -x -b "ou=people,dc=planetexpress,dc=com" -D "cn=admin,dc=planetexpress,dc=com" -w GoodNewsEveryone "(objectClass=inetOrgPerson)"# Request StartTLSldapsearch -H ldap://localhost:10389 -Z -x -b "ou=people,dc=planetexpress,dc=com" -D "cn=admin,dc=planetexpress,dc=com" -w GoodNewsEveryone "(objectClass=inetOrgPerson)"# Enforce StartTLSldapsearch -H ldap://localhost:10389 -ZZ -x -b "ou=people,dc=planetexpress,dc=com" -D "cn=admin,dc=planetexpress,dc=com" -w GoodNewsEveryone "(objectClass=inetOrgPerson)"# Enforce StartTLS with self-signed certLDAPTLS_REQCERT=never ldapsearch -H ldap://localhost:10389 -ZZ -x -b "ou=people,dc=planetexpress,dc=com" -D "cn=admin,dc=planetexpress,dc=com" -w GoodNewsEveryone "(objectClass=inetOrgPerson)"

Exposed ports

  • 10389 (ldap)
  • 10636 (ldaps)

Exposed volumes

  • /etc/ldap/slapd.d
  • /etc/ldap/ssl
  • /var/lib/ldap
  • /run/slapd

LDAP structure

dc=planetexpress,dc=com

AdminSecret
cn=admin,dc=planetexpress,dc=comGoodNewsEveryone

ou=people,dc=planetexpress,dc=com

cn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassinetOrgPerson
cnHubert J. Farnsworth
snFarnsworth
descriptionHuman
displayNameProfessor Farnsworth
employeeTypeOwner
employeeTypeFounder
givenNameHubert
jpegPhotoJPEG-Photo (630x507 Pixel, 26780 Bytes)
mailprofessor@planetexpress.com
mailhubert@planetexpress.com
ouOffice Management
titleProfessor
uidprofessor
userPasswordprofessor

cn=Philip J. Fry,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassinetOrgPerson
cnPhilip J. Fry
snFry
descriptionHuman
displayNameFry
employeeTypeDelivery boy
givenNamePhilip
jpegPhotoJPEG-Photo (429x350 Pixel, 22132 Bytes)
mailfry@planetexpress.com
ouDelivering Crew
uidfry
userPasswordfry

cn=John A. Zoidberg,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassinetOrgPerson
cnJohn A. Zoidberg
snZoidberg
descriptionDecapodian
displayNameZoidberg
employeeTypeDoctor
givenNameJohn
jpegPhotoJPEG-Photo (343x280 Pixel, 26438 Bytes)
mailzoidberg@planetexpress.com
ouStaff
titlePh. D.
uidzoidberg
userPasswordzoidberg

cn=Hermes Conrad,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassinetOrgPerson
cnHermes Conrad
snConrad
descriptionHuman
employeeTypeBureaucrat
employeeTypeAccountant
givenNameHermes
mailhermes@planetexpress.com
ouOffice Management
uidhermes
userPasswordhermes

cn=Turanga Leela,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassinetOrgPerson
cnTuranga Leela
snTuranga
descriptionMutant
employeeTypeCaptain
employeeTypePilot
givenNameLeela
jpegPhotoJPEG-Photo (429x350 Pixel, 26526 Bytes)
mailleela@planetexpress.com
ouDelivering Crew
uidleela
userPasswordleela

cn=Bender Bending Rodriguez,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassinetOrgPerson
cnBender Bending Rodriguez
snRodriguez
descriptionRobot
employeeTypeShip's Robot
givenNameBender
jpegPhotoJPEG-Photo (436x570 Pixel, 26819 Bytes)
mailbender@planetexpress.com
ouDelivering Crew
uidbender
userPasswordbender

cn=Amy Wong+sn=Kroker,ou=people,dc=planetexpress,dc=com

Amy has a multi-valued DN

AttributeValue
objectClassinetOrgPerson
cnAmy Wong
snKroker
descriptionHuman
givenNameAmy
mailamy@planetexpress.com
ouIntern
uidamy
userPasswordamy

cn=admin_staff,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassGroup
cnadmin_staff
membercn=Hubert J. Farnsworth,ou=people,dc=planetexpress,dc=com
membercn=Hermes Conrad,ou=people,dc=planetexpress,dc=com

cn=ship_crew,ou=people,dc=planetexpress,dc=com

AttributeValue
objectClassGroup
cnship_crew
membercn=Turanga Leela,ou=people,dc=planetexpress,dc=com
membercn=Philip J. Fry,ou=people,dc=planetexpress,dc=com
membercn=Bender Bending Rodriguez,ou=people,dc=planetexpress,dc=com

JAAS configuration

In case you want to use this OpenLDAP server for testing with a Java-basedapplication using JAAS and theLdapLoginModule, here's a working configurationfile you can use to connect.

other {  com.sun.security.auth.module.LdapLoginModule REQUIRED    userProvider="ldap://localhost:10389/ou=people,dc=planetexpress,dc=com"    userFilter="(&(uid={USERNAME})(objectClass=inetOrgPerson))"    useSSL=false    java.naming.security.principal="cn=admin,dc=planetexpress,dc=com"    java.naming.security.credentials="GoodNewsEveryone"    debug=true    ;};

This config uses the admin credentials to connect to the OpenLDAP server and tosubmit the search query for the user that enters their credentials. As usernametheuid attribute of each entry is used.

About

Docker OpenLDAP Server for testing LDAP applications

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors17


[8]ページ先頭

©2009-2025 Movatter.jp