Skip to content

Commit 5a3bd46

Browse files
committed
Merge branch 'hotfix-1.2.5' into stable
2 parents f27f706 + 5e10294 commit 5a3bd46

File tree

13 files changed

+232
-86
lines changed

13 files changed

+232
-86
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.2.5] - 2019-08-16
8+
## Added
9+
- Support for docker secrets #325. Thanks to @anagno !
10+
- Add DISABLE_CHOWN environment variable #240
11+
- pqChecker lib to check passwords strength with ppolicy pwdCheckModule
12+
13+
### Fixed
14+
- Fix of incorrectly positioned 'log-helper debug' command #327. Thanks to @turcan !
15+
- Fix domain dn #341. Thanks to @obourdon !
16+
717
## [1.2.4] - 2019-03-14
818
### Fixed
919
- Excessive RAM usage on 1.2.2, increased 10x from 1.2.1 #242

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/openldap
2-
VERSION = 1.2.4
2+
VERSION = 1.2.5
33

44
.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version
55

README.md

+68-55
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,48 @@
44
![Docker Stars](https://img.shields.io/docker/stars/osixia/openldap.svg)
55
![](https://images.microbadger.com/badges/image/osixia/openldap.svg)
66

7-
Latest release: 1.2.4 - OpenLDAP 2.4.47 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
7+
Latest release: 1.2.5 - OpenLDAP 2.4.47 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
88

99
**A docker image to run OpenLDAP.**
1010

1111
> OpenLDAP website : [www.openldap.org](http://www.openldap.org/)
1212
1313

1414
- [osixia/openldap](#osixiaopenldap)
15-
- [Contributing](#contributing)
16-
- [Quick Start](#quick-start)
17-
- [Beginner Guide](#beginner-guide)
18-
- [Create new ldap server](#create-new-ldap-server)
19-
- [Data persistence](#data-persistence)
20-
- [Edit your server configuration](#edit-your-server-configuration)
21-
- [Seed ldap database with ldif](#seed-ldap-database-with-ldif)
22-
- [Use an existing ldap database](#use-an-existing-ldap-database)
23-
- [Backup](#backup)
24-
- [Administrate your ldap server](#administrate-your-ldap-server)
25-
- [TLS](#tls)
26-
- [Use auto-generated certificate](#use-auto-generated-certificate)
27-
- [Use your own certificate](#use-your-own-certificate)
28-
- [Disable TLS](#disable-tls)
29-
- [Multi master replication](#multi-master-replication)
30-
- [Fix docker mounted file problems](#fix-docker-mounted-file-problems)
31-
- [Debug](#debug)
32-
- [Environment Variables](#environment-variables)
33-
- [Default.yaml](#defaultyaml)
34-
- [Default.startup.yaml](#defaultstartupyaml)
35-
- [Set your own environment variables](#set-your-own-environment-variables)
36-
- [Use command line argument](#use-command-line-argument)
37-
- [Link environment file](#link-environment-file)
38-
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
39-
- [Advanced User Guide](#advanced-user-guide)
40-
- [Extend osixia/openldap:1.2.4 image](#extend-osixiaopenldap124-image)
41-
- [Make your own openldap image](#make-your-own-openldap-image)
42-
- [Tests](#tests)
43-
- [Kubernetes](#kubernetes)
44-
- [Under the hood: osixia/light-baseimage](#under-the-hood-osixialight-baseimage)
45-
- [Security](#security)
46-
- [Known security issues](#known-security-issues)
47-
- [Changelog](#changelog)
15+
- [Contributing](#Contributing)
16+
- [Quick Start](#Quick-Start)
17+
- [Beginner Guide](#Beginner-Guide)
18+
- [Create new ldap server](#Create-new-ldap-server)
19+
- [Data persistence](#Data-persistence)
20+
- [Edit your server configuration](#Edit-your-server-configuration)
21+
- [Seed ldap database with ldif](#Seed-ldap-database-with-ldif)
22+
- [Use an existing ldap database](#Use-an-existing-ldap-database)
23+
- [Backup](#Backup)
24+
- [Administrate your ldap server](#Administrate-your-ldap-server)
25+
- [TLS](#TLS)
26+
- [Use auto-generated certificate](#Use-auto-generated-certificate)
27+
- [Use your own certificate](#Use-your-own-certificate)
28+
- [Disable TLS](#Disable-TLS)
29+
- [Multi master replication](#Multi-master-replication)
30+
- [Fix docker mounted file problems](#Fix-docker-mounted-file-problems)
31+
- [Debug](#Debug)
32+
- [Environment Variables](#Environment-Variables)
33+
- [Default.yaml](#Defaultyaml)
34+
- [Default.startup.yaml](#Defaultstartupyaml)
35+
- [Set your own environment variables](#Set-your-own-environment-variables)
36+
- [Use command line argument](#Use-command-line-argument)
37+
- [Link environment file](#Link-environment-file)
38+
- [Docker Secrets](#Docker-Secrets)
39+
- [Make your own image or extend this image](#Make-your-own-image-or-extend-this-image)
40+
- [Advanced User Guide](#Advanced-User-Guide)
41+
- [Extend osixia/openldap:1.2.5 image](#Extend-osixiaopenldap125-dev-image)
42+
- [Make your own openldap image](#Make-your-own-openldap-image)
43+
- [Tests](#Tests)
44+
- [Kubernetes](#Kubernetes)
45+
- [Under the hood: osixia/light-baseimage](#Under-the-hood-osixialight-baseimage)
46+
- [Security](#Security)
47+
- [Known security issues](#Known-security-issues)
48+
- [Changelog](#Changelog)
4849

4950
## Contributing
5051

@@ -57,11 +58,11 @@ If you find this image useful here's how you can help:
5758
## Quick Start
5859
Run OpenLDAP docker image:
5960

60-
docker run --name my-openldap-container --detach osixia/openldap:1.2.4
61+
docker run --name my-openldap-container --detach osixia/openldap:1.2.5
6162

6263
Do not forget to add the port mapping for both port 389 and 636 if you wish to access the ldap server from another machine.
6364

64-
docker run -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.2.4
65+
docker run -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.2.5
6566

6667
Either command starts a new container with OpenLDAP running inside. Let's make the first search in our LDAP container:
6768

@@ -97,7 +98,7 @@ It will create an empty ldap for the company **Example Inc.** and the domain **e
9798
By default the admin has the password **admin**. All those default settings can be changed at the docker command line, for example:
9899

99100
docker run --env LDAP_ORGANISATION="My Company" --env LDAP_DOMAIN="my-company.com" \
100-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.2.4
101+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.2.5
101102

102103
#### Data persistence
103104

@@ -148,12 +149,12 @@ argument to entrypoint if you don't want to overwrite them.
148149
# single file example:
149150
docker run \
150151
--volume ./bootstrap.ldif:/container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldif \
151-
osixia/openldap:1.2.4 --copy-service
152+
osixia/openldap:1.2.5 --copy-service
152153

153154
#directory example:
154155
docker run \
155156
--volume ./ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom \
156-
osixia/openldap:1.2.4 --copy-service
157+
osixia/openldap:1.2.5 --copy-service
157158

158159
### Use an existing ldap database
159160

@@ -164,7 +165,7 @@ simply mount this directories as a volume to `/var/lib/ldap` and `/etc/ldap/slap
164165

165166
docker run --volume /data/slapd/database:/var/lib/ldap \
166167
--volume /data/slapd/config:/etc/ldap/slapd.d \
167-
--detach osixia/openldap:1.2.4
168+
--detach osixia/openldap:1.2.5
168169

169170
You can also use data volume containers. Please refer to:
170171
> [https://docs.docker.com/engine/tutorials/dockervolumes/](https://docs.docker.com/engine/tutorials/dockervolumes/)
@@ -184,7 +185,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
184185
#### Use auto-generated certificate
185186
By default, TLS is already configured and enabled, certificate is created using container hostname (it can be set by docker run --hostname option eg: ldap.example.org).
186187

187-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.2.4
188+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.2.5
188189

189190
#### Use your own certificate
190191

@@ -194,24 +195,24 @@ You can set your custom certificate at run time, by mounting a directory contain
194195
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
195196
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
196197
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
197-
--detach osixia/openldap:1.2.4
198+
--detach osixia/openldap:1.2.5
198199

199200
Other solutions are available please refer to the [Advanced User Guide](#advanced-user-guide)
200201

201202
#### Disable TLS
202203
Add --env LDAP_TLS=false to the run command:
203204

204-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.2.4
205+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.2.5
205206

206207
### Multi master replication
207208
Quick example, with the default config.
208209

209210
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
210-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.2.4)
211+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.2.5)
211212
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
212213

213214
#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
214-
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.2.4)
215+
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.2.5)
215216
LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
216217

217218
#Add the pair "ip hostname" to /etc/hosts on each containers,
@@ -247,7 +248,7 @@ You may have some problems with mounted files on some systems. The startup scrip
247248

248249
To fix that run the container with `--copy-service` argument :
249250

250-
docker run [your options] osixia/openldap:1.2.4 --copy-service
251+
docker run [your options] osixia/openldap:1.2.5 --copy-service
251252

252253
### Debug
253254

@@ -256,11 +257,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
256257

257258
Example command to run the container in `debug` mode:
258259

259-
docker run --detach osixia/openldap:1.2.4 --loglevel debug
260+
docker run --detach osixia/openldap:1.2.5 --loglevel debug
260261

261262
See all command line options:
262263

263-
docker run osixia/openldap:1.2.4 --help
264+
docker run osixia/openldap:1.2.5 --help
264265

265266

266267
## Environment Variables
@@ -326,7 +327,7 @@ Replication options:
326327

327328
If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python:
328329

329-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.2.4
330+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.2.5
330331

331332
To convert yaml to python online: http://yaml-online-parser.appspot.com/
332333

@@ -338,6 +339,7 @@ Other environment variables:
338339
- **LDAP_REMOVE_CONFIG_AFTER_SETUP**: delete config folder after setup. Defaults to `true`
339340
- **LDAP_SSL_HELPER_PREFIX**: ssl-helper environment variables prefix. Defaults to `ldap`, ssl-helper first search config from LDAP_SSL_HELPER_* variables, before SSL_HELPER_* variables.
340341
- **HOSTNAME**: set the hostname of the running openldap server. Defaults to whatever docker creates.
342+
- **DISABLE_CHOWN**: do not perform any chown to fix file ownership. Defaults to `false`
341343

342344

343345
### Set your own environment variables
@@ -346,7 +348,7 @@ Other environment variables:
346348
Environment variables can be set by adding the --env argument in the command line, for example:
347349

348350
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
349-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.2.4
351+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.2.5
350352

351353
Be aware that environment variable added in command line will be available at any time
352354
in the container. In this example if someone manage to open a terminal in this container
@@ -357,28 +359,39 @@ he will be able to read the admin password in clear text from environment variab
357359
For example if your environment files **my-env.yaml** and **my-env.startup.yaml** are in /data/ldap/environment
358360

359361
docker run --volume /data/ldap/environment:/container/environment/01-custom \
360-
--detach osixia/openldap:1.2.4
362+
--detach osixia/openldap:1.2.5
361363

362364
Take care to link your environment files folder to `/container/environment/XX-somedir` (with XX < 99 so they will be processed before default environment files) and not directly to `/container/environment` because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).
363365

364366
Note: the container will try to delete the **\*.startup.yaml** file after the end of startup files so the file will also be deleted on the docker host. To prevent that : use --volume /data/ldap/environment:/container/environment/01-custom**:ro** or set all variables in **\*.yaml** file and don't use **\*.startup.yaml**:
365367

366368
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
367-
--detach osixia/openldap:1.2.4
369+
--detach osixia/openldap:1.2.5
370+
371+
#### Docker Secrets
372+
373+
As an alternative to passing sensitive information via environmental variables, _FILE may be appended to the listed variables, causing
374+
the startup.sh script to load the values for those values from files presented in the container. This is particular usefull for loading
375+
passwords using the [Docker secrets](https://docs.docker.com/engine/swarm/secrets/) mechanism. For example:
376+
377+
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
378+
--env LDAP_ADMIN_PASSWORD_FILE=/run/secrets/authentication_admin_pw --detach osixia/openldap:1.2.4
379+
380+
Currently this is only supported for LDAP_ADMIN_PASSWORD, LDAP_CONFIG_PASSWORD, LDAP_READONLY_USER_PASSWORD
368381

369382
#### Make your own image or extend this image
370383

371384
This is the best solution if you have a private registry. Please refer to the [Advanced User Guide](#advanced-user-guide) just below.
372385

373386
## Advanced User Guide
374387

375-
### Extend osixia/openldap:1.2.4 image
388+
### Extend osixia/openldap:1.2.5 image
376389

377390
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
378391

379392
Dockerfile example:
380393

381-
FROM osixia/openldap:1.2.4
394+
FROM osixia/openldap:1.2.5
382395
MAINTAINER Your Name <[email protected]>
383396

384397
ADD bootstrap /container/service/slapd/assets/config/bootstrap
@@ -420,7 +433,7 @@ Run your image:
420433

421434
We use **Bats** (Bash Automated Testing System) to test this image:
422435

423-
> [https://github.com/sstephenson/bats](https://github.com/sstephenson/bats)
436+
> [https://github.com/bats-core/bats-core](https://github.com/bats-core/bats-core)
424437
425438
Install Bats, and in this project directory run:
426439

example/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2'
22
services:
33
openldap:
4-
image: osixia/openldap:1.2.4
4+
image: osixia/openldap:1.2.5
55
container_name: openldap
66
environment:
77
LDAP_LOG_LEVEL: "256"

example/extend-osixia-openldap/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM osixia/openldap:1.2.4
1+
FROM osixia/openldap:1.2.5
22
MAINTAINER Your Name <[email protected]>
33

44
ADD bootstrap /container/service/slapd/assets/config/bootstrap

example/kubernetes/simple/ldap-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
spec:
1414
containers:
1515
- name: ldap
16-
image: osixia/openldap:1.2.4
16+
image: osixia/openldap:1.2.5
1717
volumeMounts:
1818
- name: ldap-data
1919
mountPath: /var/lib/ldap

example/kubernetes/using-secrets/gce-statefullset.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
spec:
1313
containers:
1414
- name: azaldap
15-
image: osixia/openldap:1.2.4
15+
image: osixia/openldap:1.2.5
1616
imagePullPolicy: IfNotPresent
1717
#command: ["/bin/bash","-c","while [ 1 = 1 ] ; do sleep 1; date; done"]
1818
ports:

example/kubernetes/using-secrets/ldap-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
spec:
1414
containers:
1515
- name: ldap
16-
image: osixia/openldap:1.2.4
16+
image: osixia/openldap:1.2.5
1717
args: ["--copy-service"]
1818
volumeMounts:
1919
- name: ldap-data

image/Dockerfile

+21-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ FROM osixia/light-baseimage:1.1.2
55
ARG LDAP_OPENLDAP_GID
66
ARG LDAP_OPENLDAP_UID
77

8+
ARG PQCHECKER_VERSION=2.0.0
9+
ARG PQCHECKER_MD5=c005ce596e97d13e39485e711dcbc7e1
10+
811
# Add openldap user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
912
# If explicit uid or gid is given, use it.
1013
RUN if [ -z "${LDAP_OPENLDAP_GID}" ]; then groupadd -r openldap; else groupadd -r -g ${LDAP_OPENLDAP_GID} openldap; fi \
@@ -18,17 +21,24 @@ RUN echo "deb http://ftp.debian.org/debian stretch-backports main" >> /etc/apt/s
1821
#  https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:ssl-tools/download.sh
1922
RUN echo "path-include /usr/share/doc/krb5*" >> /etc/dpkg/dpkg.cfg.d/docker && apt-get -y update \
2023
&& /container/tool/add-service-available :ssl-tools \
21-
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get -t stretch-backports install -y --no-install-recommends \
22-
ldap-utils \
23-
libsasl2-modules \
24-
libsasl2-modules-db \
25-
libsasl2-modules-gssapi-mit \
26-
libsasl2-modules-ldap \
27-
libsasl2-modules-otp \
28-
libsasl2-modules-sql \
29-
openssl \
30-
slapd \
31-
krb5-kdc-ldap \
24+
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get -t stretch-backports install -y --no-install-recommends \
25+
ca-certificates \
26+
curl \
27+
ldap-utils \
28+
libsasl2-modules \
29+
libsasl2-modules-db \
30+
libsasl2-modules-gssapi-mit \
31+
libsasl2-modules-ldap \
32+
libsasl2-modules-otp \
33+
libsasl2-modules-sql \
34+
openssl \
35+
slapd \
36+
krb5-kdc-ldap \
37+
&& curl -o pqchecker.deb -SL http://www.meddeb.net/pub/pqchecker/deb/8/pqchecker_${PQCHECKER_VERSION}_amd64.deb \
38+
&& echo "${PQCHECKER_MD5} *pqchecker.deb" | md5sum -c - \
39+
&& dpkg -i pqchecker.deb \
40+
&& rm pqchecker.deb \
41+
&& apt-get remove -y --purge --auto-remove curl ca-certificates \
3242
&& apt-get clean \
3343
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3444

image/environment/default.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@
1010
LDAP_LOG_LEVEL: 256
1111

1212
# Ulimit
13-
LDAP_NOFILE: 1024
13+
LDAP_NOFILE: 1024
14+
15+
# Do not perform any chown to fix file ownership
16+
DISABLE_CHOWN: false

0 commit comments

Comments
 (0)