Building the foundation of directory security: the risks of cleartext passwords and eavesdropping, the anonymous, simple, and SASL bind types, SASL mechanisms from PLAIN to GSSAPI, hashed password storage, and the principle of least privilege.

In episode 14 you made searches fast with indexes. Now the discussion shifts: a fast directory that leaks is worthless. Episode 15 opens the security and encryption phase by covering the basic threats — from passwords sent as-is to man-in-the-middle attacks — then mapping the authentication types available in OpenLDAP before you seal them with TLS in episode 16.
The fundamental nature of LDAP is a text network protocol running over TCP. Without protection, these are the threats:
All these threats can be answered with a combination of transport encryption (episode 16) and strict access policies. This episode prepares the authentication concepts first.
OpenLDAP provides several ways to recognize who's talking:
A quick comparison:
| Method | Credentials | Transport security | Best fit |
|---|---|---|---|
| Anonymous | none | not relevant | public data |
| Simple bind | DN + password | needs TLS | legacy apps, simple integration |
| SASL | depends on mechanism | depends on mechanism | enterprise, SSO |
| External | cert or socket | inherent TLS/ldapi | cn=config admin, mutual TLS |
SASL doesn't authenticate by itself — it's a container for various mechanisms:
Because simple bind and SASL PLAIN send plaintext passwords, OpenLDAP provides a security gate via olcSecurity on cn=config and per database:
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcSecurity
olcSecurity: tls=1
olcSecurity: ssf=1tls=1 requires a TLS connection for all operations, and ssf=1 (security strength factor) demands a security layer with a minimum strength of 1. The result: binds that send passwords without TLS are rejected from the start, not just warned about.
Important
Be careful when setting olcSecurity: tls=1 over a plain connection. Once applied, all sessions without TLS fail immediately — including the admin session currently using it. Always apply it via ldapmodify -Y EXTERNAL -H ldapi:///, or make sure TLS is already running first.
Beyond transport, how the server stores passwords also determines overall security. OpenLDAP stores hashes, not plaintext passwords, with a scheme label:
| Scheme | Status | Notes |
|---|---|---|
{SSHA} | common | salted SHA-1, the old default |
{SHA} | deprecated | SHA-1 without salt, easy to brute-force |
{SSHA256}, {SSHA512} | recommended | salted SHA with higher strength |
{CRYPT} | depends | uses the system crypt |
{MD5} | deprecated | unsalted, weak |
{ARGON2} | modern | Argon2, if the slapd build supports it |
The default hash is set via olcPasswordHash in cn=config. Avoiding the deprecated {SHA} and {MD5} is the cheapest security decision you can make.
Authentication is only half the journey — the other half is authorization. A few key settings:
olcDisallows: bind_anon to forbid anonymous binds, and olcRequires: authc so every operation demands authentication.olcSecurity as above.read, not write, and a replication account only gets search access.olcAuthzPolicy governs how SASL identities map to directory DNs; in episode 17 this becomes the key to Kerberos integration.dn: cn=config
changetype: modify
replace: olcDisallows
olcDisallows: bind_anon
dn: olcDatabase={1}mdb,cn=config
changetype: modify
add: olcRequires
olcRequires: authcPeriodic security audits, the monitoring and logging covered in episode 18, and firewall restrictions (only open ports 389 and 636 to authorized networks) close the remaining gaps.
In this episode 15 you understood the OpenLDAP security foundation: cleartext password, eavesdropping, and man-in-the-middle threats; the difference between anonymous, simple bind, SASL, and external; SASL mechanisms from PLAIN to GSSAPI; securing with olcSecurity and ssf; password storage schemes from {SSHA} to {ARGON2}; and minimal access policies plus closing anonymous access.
Key takeaways:
olcSecurity: ssf=1 forces a secure layer.{SSHA512} or better, stay away from {MD5} and {SHA}.bind_anon forbidden, and a firewall.In the next episode, episode 16, you install the layer that seals all this: TLS/SSL configuration — certificates, StartTLS versus LDAPS, and testing encryption with ldapsearch -ZZ. The ssf and EXTERNAL concepts you know now become real practice.