From 3b8e2d5c43fe145359fda09a8fed9c8377bf7770 Mon Sep 17 00:00:00 2001 From: Marisa Date: Wed, 5 Nov 2025 05:48:47 -0500 Subject: [PATCH] Update INSTALL.md --- INSTALL.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index f1370fc..d894558 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,25 +1,25 @@ # ldapdock -*_a configurable container running openLDAP_* +*_a configurable secure openLDAP based container_* Step by step approach on how to setup and run an openLDAP server on a systemd-less docker image container ## _1- Creating the ldapdock image container_ -build ldapdock from the dockerfile and run into it +build ldapdock from the dockerfile and run into it, creating the proper volumes to save databases data, config data, and certs data ``` > docker build -t ldapdock /path/to/dockerfile ``` ``` -> docker run -i -t -p 389:389 -p 636:636 -h example.com -v ldap_data:/var/lib/ldap -v ldap_config:/etc/ldap/slapd.d ldapdock +> docker run -i -t -p 389:389 -p 636:636 -h example.com -v ldap_data:/var/lib/ldap -v ldap_config:/etc/ldap/slapd.d -v ldap_certs:/etc/ldap/certs ldapdock ``` ## _2- Run the openLDAP server and populate a directory_ Use the following command to start openLDAP ``` -root@example:/# slapd -h "ldap:/// ldapi:/// ldaps:///" -g openldap -u openldap -F /etc/ldap/slapd.d +root@example:/# slapd -h "ldap:/// ldapi:/// ldaps:///" -g openldap -u openldap ``` Create some groups and users to populate a directory @@ -151,6 +151,7 @@ adding new entry "olcOverlay=ppolicy,olcDatabase={1}mdb,cn=config" ``` The policies module has been loaded and we can begin to configure password schemas and ACLs. --> + +## _4- Configure TLS/SSL certificates_ + +Create cert directories and generate certificates +``` +root@example:/# mkdir -p /etc/ldap/certs +root@example:/# cd /etc/ldap/certs +``` +CA key +``` +root@example:/etc/ldap/certs# certtool --generate-privkey --bits 4096 --outfile ca-key.pem +``` +CA template +``` +root@example:/etc/ldap/certs# cat > ca.info < ldap01.info < ldap01_slapd_cert_full.pem +chown root:openldap ldap01_slapd_cert_full.pem +chmod 640 ldap01_slapd_cert_full.pem +``` \ No newline at end of file