7.9. Procedure – Authenticating users to an LDAP server

Purpose: 

Note

This feature is currently available only for SSH and RDP connections. For other protocols, see Section 18.2, Configuring gateway authentication.

PSM can authenticate the users of the controlled connections to LDAP databases. To authenticate the users to an LDAP database, complete the following steps.

Warning

By default, PSM uses nested groups when querying the LDAP server. Nested groups are mostly useful when authenticating the users to Microsoft Active Directory, but can slow down the query and cause the connection to timeout if the LDAP tree is very large. In this case, disable the Enable nested groups option.

Steps: 

  1. Navigate to Policies > LDAP Servers and click to create a new LDAP policy.

  2. Enter a name for the policy (for example ldapservers).

  3. Figure 7.10. Policies > LDAP Servers — Configuring LDAP Server policies

    Policies > LDAP Servers — Configuring LDAP Server policies
    1. Enter the IP address or hostname and port of the LDAP server into the Server Address field. If you want to encrypt the communication between PSM and the LDAP server, in case of TLS, enter 636 as the port number, or in case of STARTTLS, enter 389 as the port number.

      Use an IPv4 address.

      To add multiple servers, click and enter the address of the next server. If a server is unreachable, PSM will try to connect to the next server in the list in failover fashion.

      Warning

      If you will use a TLS-encrypted with certificate verification to connect to the LDAP server, use the full domain name (for example ldap.example.com) in the Server Address field, otherwise the certificate verification might fail. The name of the LDAP server must appear in the Common Name of the certificate.

    2. Select the type of your LDAP server in the Type field. Select Active Directory to connect to Microsoft Active Directory servers, or Posix to connect to servers that use the POSIX LDAP scheme.

    3. Enter the name of the DN to be used as the base of the queries into the Base DN field (for example DC=demodomain,DC=exampleinc).

    4. Enter the name of the DN where PSM should bind to before accessing the database into the Bind DN field.

      For example: CN=Administrator,CN=Users,DC=demodomain,DC=exampleinc.

      Note
      • PSM accepts both pre-win2000-style and Win2003-style account names (User Principal Names), for example administrator@example.com is also accepted.

      • Do not use sAMAccountName, as the bind DN expects a CN.

    5. To configure or change the password to use when binding to the LDAP server, click Change and enter the password. Click Update. Click .

      Note

      PSM accepts passwords that are not longer than 150 characters. The following special characters can be used: !"#$%&'()*+,-./:;<=>?@[\]^-`{|}

  4. Skip this step if you use passwords to authenticate the users.

    • If you use public-key authentication and receive the public key of the users from the LDAP database, enter the name of the LDAP attribute that stores the public keys of the users into the Publickey attribute name field. For details on using public-key authentication with the LDAP database, see Section 22.1, Configuring public-key authentication on PSM.

    • If you use X.509 certificate for authentication and receive the certificates of the users from the LDAP database, enter the name of the LDAP attribute that stores the certificates of the users into the Certificate attribute name field.

  5. Skip this step if you use passwords to authenticate the users.

    • If you use public-key authentication and want PSM to generate server-side encryption keys on-the-fly and store them in a separate attribute on the LDAP server, enter the name of the attribute into the Generated publickey attribute name field.

    • If you use certificate authentication and want PSM to generate server-side certificates on-the-fly and store them in a separate attribute on the LDAP server, enter the name of the attribute into the Generated certificate attribute name field.

  6. If you want to encrypt the communication between PSM and the LDAP server, in Encryption, select the TLS or the STARTTLS option and complete the following steps:

    Note

    TLS-encrypted connection to Microsoft Active Directory is supported only on Windows 2003 Server and newer platforms. Windows 2000 Server is not supported.

    • If you want PSM to verify the certificate of the server, select Only accept certificates authenticated by the specified CA certificate and click the icon in the CA X.509 certificate field. A pop-up window is displayed.

      Click Browse, select the certificate of the Certificate Authority (CA) that issued the certificate of the LDAP server, then click Upload. Alternatively, you can paste the certificate into the Copy-paste field and click Set.

      PSM will use this CA certificate to verify the certificate of the server, and reject the connections if the verification fails.

      Warning

      If you will use a TLS-encrypted with certificate verification to connect to the LDAP server, use the full domain name (for example ldap.example.com) in the Server Address field, otherwise the certificate verification might fail. The name of the LDAP server must appear in the Common Name of the certificate.

    • If the LDAP server requires mutual authentication, that is, it expects a certificate from PSM, enable Authenticate as client. Generate and sign a certificate for PSM, then click in the Client X.509 certificate field to upload the certificate. After that, click in the Client key field and upload the private key corresponding to the certificate.

    Balabit recommends using 2048-bit RSA keys (or stronger).

  7. Optional Step: If your LDAP server uses a custom POSIX LDAP scheme, you might need to set which LDAP attributes store the username, or the attributes that set group memberships. For example, if your LDAP scheme does not use the uid attribute to store the usernames, set the Username (userid) attribute name option. You can customize group-membership attributes using the POSIX group membership attribute name and GroupOfUniqueNames membership attribute name options.

    Note that PSM treats the retrieved usernames and group names as case sensitive.

  8. To commit the changes, click .

  9. If you have modified the Server certificate check field or the keys used in the connections, perform the following steps:

    Warning

    This step terminates all controlled connections going through PSM. Disconnect your clients from the protected servers before proceeding.

    To activate the new settings, navigate to Basic Settings > System > Traffic control > All services section and click Restart.

  10. Click Test to test the connection.

    Note

    Testing TLS and STARTTLS-encrypted connections is not supported.