Chapter 8. Securing LDAP access
Control how clients connect to the Identity Management (IdM) directory and manage anonymous access permissions.
8.1. Identity Management default access policy Copy linkLink copied to clipboard!
Identity Management (IdM) applies default security settings by adhering to the RHEL system-wide cryptographic policy. You can use this policy to ensure that all IdM components meet current security standards automatically, which eliminates the need for manual hardening.
Red Hat recommends that you use the system-wide crypto policy. Changing individual security settings can break components of IdM.
For more information see the crypto-policies(7) man page on your system.
8.2. Anonymous LDAP binds in Identity Management Copy linkLink copied to clipboard!
By default, Identity Management (IdM) allows anonymous binds, which are unauthenticated connections to the LDAP directory. Legacy utilities, such as realmd, or older RHEL clients require anonymous binds enabled to discover domain settings when enrolling a client. However, anonymous binds can expose certain configuration settings or directory values.
You can control the visibility of your directory by modifying the nsslapd-allow-anonymous-access attribute on the IdM 389 Directory Server instance.
These are the valid values for the nsslapd-allow-anonymous-access attribute:
-
on: allows all anonymous binds (default) -
rootdse: allows anonymous binds only for root DSE information -
off: disallows any anonymous binds
By changing the value of the nsslapd-allow-anonymous-access attribute to rootdse, you allow access to the root DSE and server configuration without any access to the directory data.
Red Hat does not recommend completely disallowing anonymous binds by setting the attribute to off, because this also blocks external clients from checking the server configuration. LDAP and web clients are not necessarily domain clients, so they connect anonymously to read the root DSE file to get connection information.
8.3. Disabling anonymous binds Copy linkLink copied to clipboard!
You can restrict anonymous access to ensure only server configuration is discoverable while protecting sensitive directory data.
Certain clients rely on anonymous binds to discover IdM settings. Additionally, the compat tree can break for legacy clients that are not using authentication. Perform this procedure only if your clients do not require anonymous binds.
Prerequisites
- You can authenticate as the Directory Manager to write to the LDAP server.
-
You can authenticate as the
rootuser to restart IdM services.
Procedure
Change the
nsslapd-allow-anonymous-accessattribute torootdse.ldapmodify -x -D "cn=Directory Manager" -W -h server.example.com -p 389
$ ldapmodify -x -D "cn=Directory Manager" -W -h server.example.com -p 389Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the 389 Directory Server instance to load the new setting.
systemctl restart dirsrv.target
# systemctl restart dirsrv.targetCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Display the value of the
nsslapd-allow-anonymous-accessattribute.ldapsearch -x -D "cn=Directory Manager" -b cn=config -W -h server.example.com -p 389 nsslapd-allow-anonymous-access | grep nsslapd-allow-anonymous-access
$ ldapsearch -x -D "cn=Directory Manager" -b cn=config -W -h server.example.com -p 389 nsslapd-allow-anonymous-access | grep nsslapd-allow-anonymous-accessCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter LDAP Password: # requesting: nsslapd-allow-anonymous-access nsslapd-allow-anonymous-access: rootdse
Enter LDAP Password: # requesting: nsslapd-allow-anonymous-access nsslapd-allow-anonymous-access: rootdseCopy to Clipboard Copied! Toggle word wrap Toggle overflow