Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 1abb042

Browse files
its-samijsumners
authored andcommitted
Add ppolicy overlay
1 parent d48bc2f commit 1abb042

File tree

7 files changed

+65
-1
lines changed

7 files changed

+65
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ docker build -t openldap .
4848
```
4949

5050
The result will be a Docker image built for the local system's architecture
51-
and stroed in the local Docker image list. Running said image would look like:
51+
and stored in the local Docker image list. Running said image would look like:
5252

5353
```sh
5454
$ docker run --rm -it -p 1389:389 openldap

bootstrap/config/ppolicy.ldif

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Load ppolicy module
2+
dn: cn=module{0},cn=config
3+
changetype: modify
4+
add: olcModuleLoad
5+
olcModuleLoad: ppolicy
6+
7+
# Backend ppolicy overlay
8+
dn: olcOverlay={2}ppolicy,olcDatabase={1}mdb,cn=config
9+
changetype: add
10+
objectClass: olcOverlayConfig
11+
objectClass: olcPPolicyConfig
12+
olcOverlay: {2}ppolicy
13+
olcPPolicyDefault: cn=default,ou=ppolicies,dc=planetexpress,dc=com
14+
olcPPolicyHashCleartext: TRUE

bootstrap/data/10_people_bender.ldif

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,4 +492,5 @@ ou: Delivering Crew
492492
uid: bender
493493
userPassword:: e3NzaGF9amxCTnNmVVdKK0tIWHprRFVuYTJSSTBjK09PNmlGdzAxZHd3K3c9P
494494
Q==
495+
pwdPolicySubentry: cn=robot,ou=ppolicies,dc=planetexpress,dc=com
495496

bootstrap/data/50_ppolicies.ldif

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dn: ou=ppolicies,dc=planetexpress,dc=com
2+
objectClass: top
3+
objectClass: organizationalUnit
4+
description: Password policies
5+
ou: ppolicies
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
dn: cn=default,ou=ppolicies,dc=planetexpress,dc=com
2+
objectClass: pwdPolicy
3+
objectClass: organizationalRole
4+
cn: default
5+
pwdAttribute: userPassword
6+
pwdAllowUserChange: TRUE
7+
pwdCheckQuality: 1
8+
pwdExpireWarning: 0
9+
pwdFailureCountInterval: 0
10+
pwdGraceAuthNLimit: 0
11+
pwdInHistory: 0
12+
pwdLockout: FALSE
13+
pwdLockoutDuration: 0
14+
pwdMaxAge: 0
15+
pwdMaxFailure: 0
16+
pwdMinAge: 0
17+
pwdMinLength: 0
18+
pwdMustChange: FALSE
19+
pwdSafeModify: FALSE

bootstrap/data/60_ppolicy_robot.ldif

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
dn: cn=robot,ou=ppolicies,dc=planetexpress,dc=com
2+
objectClass: pwdPolicy
3+
objectClass: organizationalRole
4+
cn: robot
5+
pwdAttribute: userPassword
6+
pwdAllowUserChange: TRUE
7+
pwdCheckQuality: 1
8+
pwdExpireWarning: 1001
9+
pwdFailureCountInterval: 0
10+
pwdGraceAuthNLimit: 0
11+
pwdInHistory: 0
12+
pwdLockout: FALSE
13+
pwdLockoutDuration: 0
14+
pwdMaxAge: 1000
15+
pwdMaxFailure: 0
16+
pwdMinAge: 0
17+
pwdMinLength: 0
18+
pwdMustChange: TRUE
19+
pwdSafeModify: FALSE

bootstrap/slapd-init.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ configure_memberof_overlay(){
9191
ldapmodify -Y EXTERNAL -H ldapi:/// -f ${CONFIG_DIR}/memberof.ldif -Q
9292
}
9393

94+
configure_ppolicy_overlay(){
95+
echo "Configure ppolicy overlay..."
96+
ldapmodify -Y EXTERNAL -H ldapi:/// -f ${CONFIG_DIR}/ppolicy.ldif -Q
97+
}
98+
9499
load_initial_data() {
95100
echo "Load data..."
96101
local data=$(find ${DATA_DIR} -maxdepth 1 -name \*_\*.ldif -type f | sort)
@@ -125,6 +130,7 @@ configure_msad_features
125130
configure_tls
126131
configure_logging
127132
configure_memberof_overlay
133+
configure_ppolicy_overlay
128134
load_initial_data
129135

130136
kill -INT `cat /run/slapd/slapd.pid`

0 commit comments

Comments
 (0)