Skip to content

Commit 055b858

Browse files
committed
Merge branch 'hotfix-1.1.4' into stable
2 parents aa8d557 + b52560b commit 055b858

File tree

15 files changed

+118
-54
lines changed

15 files changed

+118
-54
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 1.1.4
4+
- Remove environment variable LDAP_TLS_PROTOCOL_MIN as it takes no effect, see #69
5+
- Adjust default GnuTLS cipher string according to Red Hat's TLS hardening guide.
6+
This by default also restricts the TLS protocol version to 1.2. For reference,
7+
see #69
8+
- Fix Error in Adding "Billy" #71
9+
- Add docker-compose.yml example and update kubernetes examples #52
10+
11+
Merge pull request :
12+
- Update LDAP_TLS_CIPHER_SUITE, remove LDAP_TLS_PROTOCOL_MIN #70
13+
- fixed LDAP_BACKEND for readonly user #62
14+
315
## 1.1.3
416
Merge pull request :
517
- Use mdb over hdb #50

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/openldap
2-
VERSION = 1.1.3
2+
VERSION = 1.1.4
33

44
.PHONY: all build build-nocache test tag_latest release
55

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
[hub]: https://hub.docker.com/r/osixia/openldap/
77

8-
Latest release: 1.1.3 - OpenLDAP 2.4.40 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
8+
Latest release: 1.1.4 - OpenLDAP 2.4.40 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
99

1010
A docker image to run OpenLDAP.
1111

@@ -35,7 +35,7 @@ A docker image to run OpenLDAP.
3535
- [Link environment file](#link-environment-file)
3636
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
3737
- [Advanced User Guide](#advanced-user-guide)
38-
- [Extend osixia/openldap:1.1.3 image](#extend-osixiaopenldap113-image)
38+
- [Extend osixia/openldap:1.1.4 image](#extend-osixiaopenldap114-image)
3939
- [Make your own openldap image](#make-your-own-openldap-image)
4040
- [Tests](#tests)
4141
- [Kubernetes](#kubernetes)
@@ -53,7 +53,7 @@ If you find this image useful here's how you can help:
5353
## Quick Start
5454
Run OpenLDAP docker image:
5555

56-
docker run --name my-openldap-container --detach osixia/openldap:1.1.3
56+
docker run --name my-openldap-container --detach osixia/openldap:1.1.4
5757

5858
This start a new container with OpenLDAP running inside. Let's make the first search in our LDAP container:
5959

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

9191
docker run --env LDAP_ORGANISATION="My Company" --env LDAP_DOMAIN="my-company.com" \
92-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.3
92+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.4
9393

9494
#### Data persistence
9595

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

115115
docker run --volume /data/slapd/database:/var/lib/ldap \
116116
--volume /data/slapd/config:/etc/ldap/slapd.d
117-
--detach osixia/openldap:1.1.3
117+
--detach osixia/openldap:1.1.4
118118

119119
You can also use data volume containers. Please refer to:
120120
> [https://docs.docker.com/userguide/dockervolumes/](https://docs.docker.com/userguide/dockervolumes/)
@@ -134,7 +134,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
134134
#### Use auto-generated certificate
135135
By default TLS is enable, a certificate is created with the container hostname (it can be set by docker run --hostname option eg: ldap.example.org).
136136

137-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.3
137+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.4
138138

139139
#### Use your own certificate
140140

@@ -144,24 +144,24 @@ You can set your custom certificate at run time, by mounting a directory contain
144144
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
145145
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
146146
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
147-
--detach osixia/openldap:1.1.3
147+
--detach osixia/openldap:1.1.4
148148

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

151151
#### Disable TLS
152152
Add --env LDAP_TLS=false to the run command:
153153

154-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.3
154+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.4
155155

156156
### Multi master replication
157157
Quick example, with the default config.
158158

159159
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
160-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.3)
160+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.4)
161161
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
162162

163163
#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
164-
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.3)
164+
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.4)
165165
LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
166166

167167
#Add the pair "ip hostname" to /etc/hosts on each containers,
@@ -173,7 +173,7 @@ That's it! But a little test to be sure:
173173

174174
Add a new user "billy" on the first ldap server
175175

176-
docker exec $LDAP_CID ldapadd -x -D "cn=admin,dc=example,dc=org" -w admin -f /container/service/slapd/assets/test/new-user.ldif --hostname ldap.example.org -ZZ
176+
docker exec $LDAP_CID ldapadd -x -D "cn=admin,dc=example,dc=org" -w admin -f /container/service/slapd/assets/test/new-user.ldif -h ldap.example.org -ZZ
177177

178178
Search on the second ldap server, and billy should show up!
179179

@@ -197,7 +197,7 @@ You may have some problems with mounted files on some systems. The startup scrip
197197

198198
To fix that run the container with `--copy-service` argument :
199199

200-
docker run [your options] osixia/openldap:1.1.3 --copy-service
200+
docker run [your options] osixia/openldap:1.1.4 --copy-service
201201

202202
### Debug
203203

@@ -206,11 +206,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
206206

207207
Example command to run the container in `debug` mode:
208208

209-
docker run --detach osixia/openldap:1.1.3 --loglevel debug
209+
docker run --detach osixia/openldap:1.1.4 --loglevel debug
210210

211211
See all command line options:
212212

213-
docker run osixia/openldap:1.1.3 --help
213+
docker run osixia/openldap:1.1.4 --help
214214

215215

216216
## Environment Variables
@@ -253,8 +253,7 @@ TLS options:
253253
- **LDAP_TLS_KEY_FILENAME**: Ldap ssl certificate private key filename. Defaults to `ldap.key`
254254
- **LDAP_TLS_CA_CRT_FILENAME**: Ldap ssl CA certificate filename. Defaults to `ca.crt`
255255
- **LDAP_TLS_ENFORCE**: Enforce TLS. Defaults to `false`
256-
- **LDAP_TLS_CIPHER_SUITE**: TLS cipher suite. Defaults to `SECURE256:-VERS-SSL3.0`
257-
- **LDAP_TLS_PROTOCOL_MIN**: TLS min protocol. Defaults to `3.1`
256+
- **LDAP_TLS_CIPHER_SUITE**: TLS cipher suite. Defaults to `SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC`, based on Red Hat's [TLS hardening guide](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Hardening_TLS_Configuration.html)
258257
- **LDAP_TLS_VERIFY_CLIENT**: TLS verify client. Defaults to `demand`
259258

260259
Help: http://www.openldap.org/doc/admin24/tls.html
@@ -274,7 +273,7 @@ Replication options:
274273

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

277-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.3
276+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.4
278277

279278
To convert yaml to python online: http://yaml-online-parser.appspot.com/
280279

@@ -289,7 +288,7 @@ Other environment variables:
289288
Environment variables can be set by adding the --env argument in the command line, for example:
290289

291290
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
292-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.3
291+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.4
293292

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

302301
docker run --volume /data/ldap/environment:/container/environment/01-custom \
303-
--detach osixia/openldap:1.1.3
302+
--detach osixia/openldap:1.1.4
304303

305304
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).
306305

307306
Note: the container will try to delete the **\*.yaml.startup** 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 **\*.yaml.startup**:
308307

309308
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
310-
--detach osixia/openldap:1.1.3
309+
--detach osixia/openldap:1.1.4
311310

312311
#### Make your own image or extend this image
313312

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

316315
## Advanced User Guide
317316

318-
### Extend osixia/openldap:1.1.3 image
317+
### Extend osixia/openldap:1.1.4 image
319318

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

322321
Dockerfile example:
323322

324-
FROM osixia/openldap:1.1.3
323+
FROM osixia/openldap:1.1.4
325324
MAINTAINER Your Name <[email protected]>
326325

327326
ADD bootstrap /container/service/slapd/assets/config/bootstrap
@@ -343,7 +342,7 @@ Clone this project:
343342
Adapt Makefile, set your image NAME and VERSION, for example:
344343

345344
NAME = osixia/openldap
346-
VERSION = 1.1.3
345+
VERSION = 1.1.4
347346

348347
become:
349348
NAME = cool-guy/openldap

example/docker-compose.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
version: '2'
2+
services:
3+
openldap:
4+
image: osixia/openldap:1.1.4
5+
container_name: openldap
6+
environment:
7+
LDAP_LOG_LEVEL: "256"
8+
LDAP_ORGANISATION: "Example Inc."
9+
LDAP_DOMAIN: "example.org"
10+
LDAP_BASE_DN: ""
11+
LDAP_ADMIN_PASSWORD: "admin"
12+
LDAP_CONFIG_PASSWORD: "config"
13+
LDAP_READONLY_USER: "false"
14+
#LDAP_READONLY_USER_USERNAME: "readonly"
15+
#LDAP_READONLY_USER_PASSWORD: "readonly"
16+
LDAP_BACKEND: "hdb"
17+
LDAP_TLS: "true"
18+
LDAP_TLS_CRT_FILENAME: "ldap.crt"
19+
LDAP_TLS_KEY_FILENAME: "ldap.key"
20+
LDAP_TLS_CA_CRT_FILENAME: "ca.crt"
21+
LDAP_TLS_ENFORCE: "false"
22+
LDAP_TLS_CIPHER_SUITE: "SECURE256:-VERS-SSL3.0"
23+
LDAP_TLS_PROTOCOL_MIN: "3.1"
24+
LDAP_TLS_VERIFY_CLIENT: "demand"
25+
LDAP_REPLICATION: "false"
26+
#LDAP_REPLICATION_CONFIG_SYNCPROV: "binddn="cn=admin,cn=config" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="60 +" timeout=1 starttls=critical"
27+
#LDAP_REPLICATION_DB_SYNCPROV: "binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical"
28+
#LDAP_REPLICATION_HOSTS: "#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']"
29+
LDAP_REMOVE_CONFIG_AFTER_SETUP: "true"
30+
LDAP_CFSSL_PREFIX: "ldap"
31+
tty: true
32+
stdin_open: true
33+
volumes:
34+
- /var/lib/ldap
35+
- /etc/ldap/slapd.d
36+
- /container/service/slapd/assets/certs/
37+
ports:
38+
- "389:389"
39+
- "639:639"
40+
hostname: "example.org"
41+
phpldapadmin:
42+
image: osixia/phpldapadmin:latest
43+
container_name: phpldapadmin
44+
environment:
45+
PHPLDAPADMIN_LDAP_HOSTS: "openldap"
46+
PHPLDAPADMIN_HTTPS: "false"
47+
ports:
48+
- "8080:80"
49+
depends_on:
50+
- openldap

example/extend-osixia-openldap/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM osixia/openldap:1.1.3
1+
FROM osixia/openldap:1.1.4
22
MAINTAINER Your Name <[email protected]>
33

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

example/extend-osixia-openldap/environment/my-env.yaml.startup

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ LDAP_TLS_KEY_FILENAME: cert.key
2323
LDAP_TLS_CA_CRT_FILENAME: ca.crt
2424

2525
LDAP_TLS_ENFORCE: false
26-
LDAP_TLS_CIPHER_SUITE: SECURE256:-VERS-SSL3.0
27-
LDAP_TLS_PROTOCOL_MIN: 3.1
26+
LDAP_TLS_CIPHER_SUITE: SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC
2827
LDAP_TLS_VERIFY_CLIENT: never
2928

3029
# Replication

example/kubernetes/simple/ldap-rc.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: ldap
18-
image: osixia/openldap:1.1.3
18+
image: osixia/openldap:1.1.4
1919
volumeMounts:
2020
- name: ldap-data
2121
mountPath: /var/lib/ldap
@@ -43,6 +43,8 @@ spec:
4343
value: "readonly"
4444
- name: LDAP_READONLY_USER_PASSWORD
4545
value: "readonly"
46+
- name: LDAP_BACKEND
47+
value: "hdb"
4648
- name: LDAP_TLS
4749
value: "true"
4850
- name: LDAP_TLS_CRT_FILENAME
@@ -54,9 +56,7 @@ spec:
5456
- name: LDAP_TLS_ENFORCE
5557
value: "false"
5658
- name: LDAP_TLS_CIPHER_SUITE
57-
value: "SECURE256:-VERS-SSL3.0"
58-
- name: LDAP_TLS_PROTOCOL_MIN
59-
value: "3.1"
59+
value: "SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC"
6060
- name: LDAP_TLS_VERIFY_CLIENT
6161
value: "demand"
6262
- name: LDAP_REPLICATION
@@ -69,6 +69,8 @@ spec:
6969
value: "#PYTHON2BASH:['ldap://ldap-one-service', 'ldap://ldap-two-service']"
7070
- name: LDAP_REMOVE_CONFIG_AFTER_SETUP
7171
value: "true"
72+
- name: LDAP_CFSSL_PREFIX
73+
value: "ldap"
7274
- name: ldap-backup
7375
image: osixia/openldap-backup:0.1.8
7476
volumeMounts:

example/kubernetes/using-secrets/environment/file-to-base64.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44

55
FILE=$1
66

7-
FILE_ENCODED=$(cat $FILE | base64)
8-
FILE_ENCODED=`echo ${FILE_ENCODED} | tr -d '\n'`
9-
FILE_ENCODED=`echo ${FILE_ENCODED} | tr -d ' '`
7+
FILE_ENCODED=$(cat $FILE | base64 --wrap=0)
108
echo $FILE_ENCODED

example/kubernetes/using-secrets/environment/my-env.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
# General container configuration
99
# see table 5.1 in http://www.openldap.org/doc/admin24/slapdconf2.html for the available log levels.
10-
LDAP_LOG_LEVEL: 0
10+
LDAP_LOG_LEVEL: 256

example/kubernetes/using-secrets/environment/my-env.yaml.startup

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@
99
# Required and used for new ldap server only
1010
LDAP_ORGANISATION: Example Inc.
1111
LDAP_DOMAIN: example.org
12-
LDAP_ADMIN_PASSWORD: Adm1n!
13-
LDAP_CONFIG_PASSWORD: c0nfig
12+
LDAP_BASE_DN: #if empty automatically set from LDAP_DOMAIN
1413

15-
LDAP_READONLY_USER: true
14+
LDAP_ADMIN_PASSWORD: admin
15+
LDAP_CONFIG_PASSWORD: config
16+
17+
LDAP_READONLY_USER: false
1618
LDAP_READONLY_USER_USERNAME: readonly
17-
LDAP_READONLY_USER_PASSWORD: passwr0rd!
19+
LDAP_READONLY_USER_PASSWORD: readonly
20+
21+
# Backend
22+
LDAP_BACKEND: hdb
1823

1924
# Tls
2025
LDAP_TLS: true
21-
LDAP_TLS_CRT_FILENAME: cert.crt
22-
LDAP_TLS_KEY_FILENAME: cert.key
26+
LDAP_TLS_CRT_FILENAME: ldap.crt
27+
LDAP_TLS_KEY_FILENAME: ldap.key
2328
LDAP_TLS_CA_CRT_FILENAME: ca.crt
2429

2530
LDAP_TLS_ENFORCE: false
26-
LDAP_TLS_CIPHER_SUITE: SECURE256:-VERS-SSL3.0
27-
LDAP_TLS_PROTOCOL_MIN: 3.1
28-
LDAP_TLS_VERIFY_CLIENT: never
31+
LDAP_TLS_CIPHER_SUITE: SECURE256:+SECURE128:-VERS-TLS-ALL:+VERS-TLS1.2:-RSA:-DHE-DSS:-CAMELLIA-128-CBC:-CAMELLIA-256-CBC
32+
LDAP_TLS_VERIFY_CLIENT: demand
2933

3034
# Replication
3135
LDAP_REPLICATION: false
@@ -43,4 +47,7 @@ LDAP_REPLICATION_HOSTS:
4347

4448

4549
# Remove config after setup
46-
LDAP_REMOVE_CONFIG_AFTER_SETUP: false
50+
LDAP_REMOVE_CONFIG_AFTER_SETUP: true
51+
52+
# cfssl environment variables prefix
53+
LDAP_CFSSL_PREFIX: ldap # cfssl-helper first search config from LDAP_CFSSL_* variables, before CFSSL_* variables.

0 commit comments

Comments
 (0)