diff --git a/entrypoint.sh b/entrypoint.sh index f8f097f..1fbf910 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -72,6 +72,31 @@ EOF # enable the policies module ldapadd -Q -Y EXTERNAL -H ldapi:/// -f enable_ppolicy.ldif +echo "Preparing the basic password overlay..." + +# prepare the .ldif files to create a basic overlay of password policies +cat > passwd_ppolicy_overlay.ldif << EOF +dn: cn=default,ou=policies,dc=example,dc=com +objectClass: pwdPolicy +objectClass: organizationalRole +cn: default +pwdAttribute: userPassword +pwdMinLength: 8 +pwdCheckQuality: 2 +EOF + +cat > policies_ou.ldif << EOF +dn: ou=policies,dc=example,dc=com +objectClass: top +objectClass: organizationalUnit +ou: policies +EOF + +# enable the overlay +ldapadd -D "cn=admin,dc=example,dc=com" -w admin -H ldapi:/// -f policies_ou.ldif + +ldapadd -x -D "cn=admin,dc=example,dc=com" -w admin -H ldapi:/// -f passwd_ppolicy_overlay.ldif + echo "openLDAP framework ready." # execute the command passed to the container