Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eugenmayer/docker-image-ldapexample

A openldap server with a pre-defined example layout for auth and groups with memberOf. Use it for test-setups
https://github.com/eugenmayer/docker-image-ldapexample

ldap openldap-server testing

Last synced: 25 days ago
JSON representation

A openldap server with a pre-defined example layout for auth and groups with memberOf. Use it for test-setups

Awesome Lists containing this project

README

        

[![build](https://github.com/EugenMayer/docker-image-ldapexample/actions/workflows/build.yml/badge.svg)](https://github.com/EugenMayer/docker-image-ldapexample/actions/workflows/build.yml)

## WAT

If you need to test-drive your ldap authentication or need a test-server to test your ldap against, this docker-image could be of use. It does come with pre-deployed users and groups, so you can test authentication and filters right away.

## start

Just run `docker-compose up -d` right in here.

You can also run the prebuild images without any mounts

```bash
docker run -p 389:389 ghcr.io/eugenmayer/ldaptestserver:type1
#or
docker run -p 389:389 ghcr.io/eugenmayer/ldaptestserver:type2
```

See the connection details under layout.

## Database layout

Using `docker-compose.yml`, you will have 2 servers started as an example, with 2 slightly different layouts, based on `data-template-type1.ldif` and `data-template-type2.ldif`

Server 1 has the port `10389` and the default domain example.org
- admin user: `cn=admin,dc=example,dc=org`
- admin password: `admin`

Server 2 has the port `20389` and the default domain example.org
- admin user: `cn=admin,dc=kontextwork-test,dc=de`
- admin password: `admin`

When you see the Users / Groups below, you need to replace the `` with the domain, so either `dc=example,dc=org` or`dc=kontextwork-test,dc=de`

The ldif's are templated, so you can change the container env variable `LDAP_DOMAIN` to have your own domain, or change the password.

### Type 1 Template

`` should be `dc=example,dc=org` if the default is not changed.

## Users
- uid=user1id,ou=accounts,ou=base1,,
- uid=user2id,ou=accounts,ou=base1,
- uid=included1id,ou=accounts,ou=base2,
- uid=readonlyid,ou=other accounts,ou=base1,
- uid=userExcludedeid,ou=accounts,ou=base1,

Passwords do match the the `uid`, so `user1` for the user `uid=user1,ou=accounts,` and so on.

## Groups

We have one group

- cn=myservice,ou=groups,ou=base1,

with the following members

- uid=user1id,ou=accounts,ou=base1,,
- uid=user2id,ou=accounts,ou=base1,
- uid=included1id,ou=accounts,ou=base2,

### Type 2 Template

`` should be `dc=kontextwork-test,dc=de` if the default is not changed.

#### Users

- uid=included1id,ou=accounts,ou=base1,
- uid=included2id,ou=accounts,ou=base1,
- uid=included3id,ou=accounts,ou=base1,
- uid=readonlyid,ou=other accounts,ou=base1,
- uid=includedMissingMailid,ou=accounts,ou=base1
- uid=excluded1id,ou=accounts,ou=base1,
- uid=excluded2id,ou=accounts,ou=base1,
- uid=included1id,ou=accounts,ou=base2,

Passwords do match the the `uid`, so `included1` for the user `uid=included1,ou=accounts,` and so on.

#### Groups

We have groups

- cn=myservice,ou=groupsou=base1,,
- cn=otherservice,ou=groups,ou=base1,
- cn=groupwithinvalid,ou=groups,ou=base1,
- cn=differentservice,ou=groups,ou=base1,
- cn=groupofgroups,ou=groups,ou=base1,

with the following members

myservice
- uid=included1id,ou=accounts,ou=base1,
- uid=included2id,ou=accounts,ou=base1,
- uid=included3id,ou=accounts,ou=base1,
- uid=includedMissingMailid,ou=accounts,ou=base1

otherservice
- uid=included1id,ou=accounts,ou=base1,

differentservice
- uid=included2id,ou=accounts,ou=base1,

groupofgroups
- cn=otherservice,ou=groups,ou=base1,
- cn=differentservice,ou=groups,ou=base1,

groupwithinvalid
- uid=includedMissingMailid,ou=accounts,ou=base1,

## Build

You can build your images using your custom templates, custom password or LDAP_DOMAIN. See the `Dockerfile` included here
and just make it your own, if you like. Also see the templates and see how you can adopt or modify them to your liking.

**Important:** If you rely on `memberOf` you should ensure that your users are created before your groups in the ldif,
or memberOf will not work!

## Credits

Well they all belong to [osixia/docker-openldap](https://github.com/osixia/docker-openldap) who did bring up this awesome
ldap docker image in the first place!