Sign inSign up

rroemhild/test-openldap

By rroemhild

Updated over 5 years ago
Archived

OpenLDAP Server for testing LDAP applications, i.e. unit tests.

Image
Developer tools
15

1M+

rroemhild/test-openldap repository overview

OpenLDAP Docker Image for testing

Docker Build Status Docker Stars Docker Pulls

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

Parts of the image are based on the work from Nick Stenning docker-slapd and Bertrand Gouny docker-openldap.

The Flask extension flask-ldapconn use this image for unit tests.

Features

  • Initialized with data from Futurama
  • Support for TLS (snake oil cert on build)
  • memberOf overlay support
  • MS-AD style groups support

Usage

docker pull rroemhild/test-openldap
docker run --rm -p 10389:10389 -p 10636:10636 rroemhild/test-openldap

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)
mail[email protected]
mail[email protected]
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)
mail[email protected]
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)
mail[email protected]
ouStaff
titlePh. D.
uidzoidberg
userPasswordzoidberg
cn=Hermes Conrad,ou=people,dc=planetexpress,dc=com
AttributeValue
objectClassinetOrgPerson
cnHermes Conrad
snConrad
descriptionHuman
employeeTypeBureaucrat
employeeTypeAccountant
givenNameHermes
mail[email protected]
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)
mail[email protected]
ouDelivering Crew
uidleela
userPasswordleela
cn=Bender Bending Rodríguez,ou=people,dc=planetexpress,dc=com
AttributeValue
objectClassinetOrgPerson
cnBender Bending Rodríguez
snRodríguez
descriptionRobot
employeeTypeShip's Robot
givenNameBender
jpegPhotoJPEG-Photo (436x570 Pixel, 26819 Bytes)
mail[email protected]
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
mail[email protected]
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 Rodríguez,ou=people,dc=planetexpress,dc=com

JAAS configuration

In case you want to use this OpenLDAP server for testing with a Java-based application using JAAS and the LdapLoginModule, here's a working configuration file you can use to connect.

other {
  com.sun.security.auth.module.LdapLoginModule REQUIRED
    userProvider="ldap://localhost/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 to submit the search query for the user that enters their credentials. As username the uid attribute of each entry is used.

Tag summary

Content type

Image

Digest

sha256:ee9b80948

Size

43.1 MB

Last updated

over 5 years ago

docker pull rroemhild/test-openldap