Skip to content

Lesson 4 of 9 · 28m

Operating OpenLDAP and 389ds: TLS, ACLs, and Admin Discipline

Compare the two major directory servers and build a secure operational baseline around encryption, least-privilege access, and controlled administration.

OpenLDAP and 389 Directory Server solve the same core problem with different operational personalities. OpenLDAP rewards precision and exposes sharp edges through cn=config. 389ds leans toward managed administration with tools such as dsconf and a long tradition in identity infrastructure. The failures are the same either way: plaintext binds, one omnipotent admin credential, unmanaged local changes, and nobody knowing which service account owns which permission.

Pick the server, then respect its model

OpenLDAP's modern configuration is itself LDAP data under cn=config:

ldapsearch -Y EXTERNAL -H ldapi:/// -b cn=config   '(olcDatabase={2}mdb)' olcSuffix olcRootDN olcDbIndex

389ds commonly exposes administrative operations through CLI tooling:

dsconf -D 'cn=Directory Manager' ldap://localhost backend suffix list
dsconf -D 'cn=Directory Manager' ldap://localhost config get nsslapd-port

Do not mix mental models. In OpenLDAP, generated slapd.d files are not casual hand-editing targets. In 389ds, use dsconf, dsctl, and documented LDIF operations rather than editing live instance internals.

TLS is table stakes, not a checkbox

LDAP exposes passwords and Kerberos-adjacent authentication material in bind operations. Require LDAPS or StartTLS before credentials cross a network. A service check should verify certificate name, chain, protocol, and expiry:

openssl s_client -connect ldap.sudosecurity.org:636   -servername ldap.sudosecurity.org </dev/null | openssl x509 -noout -subject -issuer -dates

Then verify the LDAP layer:

ldapsearch -x -H ldaps://ldap.sudosecurity.org:636   -D 'uid=readonly,ou=services,dc=sudosecurity,dc=org' -W   -b '' -s base '(objectClass=*)' namingContexts

Internal networks are not a trust boundary. They are simply networks where credential theft is quieter.

ACLs should answer application questions

OpenLDAP ACLs are ordered and first-match sensitive:

olcAccess: {0}to dn.subtree="ou=people,dc=sudosecurity,dc=org"
  attrs=userPassword
  by self write
  by dn="uid=authbind,ou=services,dc=sudosecurity,dc=org" read
  by anonymous auth
  by * none
olcAccess: {1}to dn.subtree="ou=people,dc=sudosecurity,dc=org"
  by dn="uid=readonly,ou=services,dc=sudosecurity,dc=org" read
  by users read
  by * none

Order matters. A broad earlier rule can silently make a later precise rule irrelevant. Test ACLs as the exact service account, not as Directory Manager. Admin success tells you nothing about delegated access.

Separate administrative planes

Do not use cn=Directory Manager or an OpenLDAP rootdn for routine application traffic. Create narrow accounts:

uid=authbind       validates userPassword through bind/read only where required
uid=readonly       reads users and groups for applications
uid=provisioner    creates and updates lifecycle-managed identities
uid=replication    replication-only credential with no interactive use

Rotate these credentials independently and log the owning service. If one Kubernetes namespace is compromised, you should lose one service account, not the directory.

Operational discipline is the real control

Track schema version, server version, suffixes, indexes, ACL changes, certificates, replication topology, and backup proof in one operational document. Directory services are boring when run well because every dangerous operation is scheduled, reviewed, and reversible.

Field notes

  • ldapwhoami after a bind is the fastest way to prove which identity the server actually granted.
  • Certificate renewal is not complete until every replica and client trust store trusts the new chain.
  • RootDN/rootpw in the data suffix should not become the application integration account by convenience.
  • ACL tests must include anonymous, authenticated user, target service account, and admin cases.

Was this lesson helpful?

Sign in to rate