Skip to content

LDAP server for development and integration testing

License

Notifications You must be signed in to change notification settings

va1da5/ldap-dev-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LDAP Server for DEV/PoC Testing

Struggle free LDAP server meant for simulating MS AD. It could be used for development purpose and/or testing integrations with other tools. Out-of-the-box it contains an organization directory with few well known characters.

This is mostly an updated version of dwimberger/ldap-ad-it project.

Features

  • Relevant organization directory schema;
  • Directory management with embedded phpLDAPAdmin;
  • LDAP over TLS enabled. Root CA certificate is available;
  • Server customizable using environment variables.

Requirements

Installation

# Clone repository
git clone https://github.com/va1da5/ldap-dev-server.git
cd ldap-dev-server

# Pull and build required images
docker-compose pull
docker-compose build

Usage

  • The server is started using one of the following commands:

    # Starts containers in an interactive mode
    docker-compose up
    
    # Starts containers in a detached mode
    docker-compose up -d

    The server is going to bind to the default LDAP ports (389/TCP & 636/TCP). If any of these ports are occupied by some other processes, those need to be updated to something else, like 10389/TCP & 10636/TCP. This can be achieved in docker-compose.yml file.

  • Once containers are started the phpLDAPAdmin server is going to be available on https://localhost:6443.

    # Credentials
    User DN:  uid=admin,ou=system
    Password: secret
  • The server can also be queried using ldapsearch. Please find the examples below.

    # Plain text connection
    ldapsearch -x -LLL -H "ldap://localhost" \
        -D "uid=admin,ou=system" -w "secret" \
        -b "ou=users,dc=ad,dc=piedpiper,dc=com" "(cn=*)" dn givenName
    
    dn: cn=pp0001,ou=users,dc=ad,dc=piedpiper,dc=com
    givenname: Richard
    
    dn: cn=pp0003,ou=users,dc=ad,dc=piedpiper,dc=com
    givenname: Dinesh
    ...
    
    # TLS connection
    export LDAPTLS_REQCERT=never
    ldapsearch -x -LLL -v -H "ldaps://localhost:636" \
        -D "uid=admin,ou=system" -w "secret" \
        -b "ou=users,dc=ad,dc=piedpiper,dc=com" "(cn=*)" dn givenName
    

References