Secure Directory Services
Summary
Directory services hold every account and group, so their protocols must be protected. Plain LDAP can send credentials in clear text, so connections should be encrypted with LDAPS or StartTLS, authentication should use strong methods, and access to directory servers should be restricted.
In plain words
Directories (usually accessed with LDAP) hold users, computers and permissions, so they must be protected. Plain LDAP on port 389 is unencrypted. Anonymous access and simple bind (DN and password in plaintext) are unsafe. Use SASL (for example Kerberos, with STARTTLS) or LDAPS on port 636, which uses a certificate. Separate read-only and read/write access, and never expose LDAP to the Internet.
Detailed explanation
- LDAP: Lightweight Directory Access Protocol, on TCP port 389.
Authentication methods
- Anonymous bind: No authentication; should be disabled or tightly limited.
- Simple bind: Sends the username and password; in clear text unless the connection is encrypted.
- Simple Authentication and Security Layer (SASL): A framework that allows stronger methods such as Kerberos.
- LDAPS: LDAP over TLS on port 636.
- StartTLS: Upgrades a port 389 connection to TLS.
Recommendations
- Disable insecure methods: Turn off anonymous and unencrypted simple binds.
- Limit access: Grant read and write rights to directory data by least privilege.
- Restrict network access: Allow directory connections only from systems that need them.
Important terms
taken from the text above- LDAP
- Lightweight Directory Access Protocol, on TCP port 389.
- Anonymous bind
- No authentication; should be disabled or tightly limited.
- Simple bind
- Sends the username and password; in clear text unless the connection is encrypted.
- Simple Authentication and Security Layer (SASL)
- A framework that allows stronger methods such as Kerberos.
- LDAPS
- LDAP over TLS on port 636.
- StartTLS
- Upgrades a port 389 connection to TLS.
- Disable insecure methods
- Turn off anonymous and unencrypted simple binds.
- Limit access
- Grant read and write rights to directory data by least privilege.
- Restrict network access
- Allow directory connections only from systems that need them.
Examples & real-world scenarios
- Moving applications from LDAP 389 to LDAPS 636.
- Disabling anonymous bind on a directory server.
- Firewalling the directory so only internal subnets can reach it.
Scenario
An app authenticates users with LDAP simple bind over port 389, so passwords cross the network in clear text. Reconfiguring it to use LDAPS protects the credentials in transit.
Common mistakes
- Using simple bind without TLS.
- Mixing up the ports: 389 is LDAP, 636 is LDAPS.
Practical skills
- Recommend secure LDAP settings.
What I should remember
- LDAPS: Port 636; encrypts directory traffic.
- Simple bind: Exposes credentials unless TLS is used.
- SASL: Enables Kerberos and other strong methods.
- Anonymous bind: Disable it.