This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

LDAP bind methods

There are two LDAP methods that you use to authenticate your Vertica database against an LDAP server.

There are two LDAP methods that you use to authenticate your Vertica database against an LDAP server.

  • Bind—Use LDAP bind when Vertica connects to the LDAP server and binds using the CN and password. (These values are the username and password of the user logging into the database). Use the bind method when your LDAP account's CN field matches that of the username defined in your database. For more information see Workflow for configuring LDAP bind.

  • Search and Bind —Use LDAP search and bind when your LDAP account's CN field is a user's full name or does not match the username defined in your database. For search and bind, the username is usually in another field such as UID or sAMAccountName in a standard Active Directory environment. Search and bind requires your organization's Active Directory information. This information allows Vertica to log into the LDAP server and search for the specified field. For more information see Workflow for configuring LDAP search and bind.

    If you are using search and bind, having a service account simplifies your server side configuration. In addition, you do not need to store your Active Directory password.

LDAP anonymous binding

Anonymous binding is an LDAP server function. Anonymous binding allows a client to connect and search the directory (bind and search) without logging in because binddn and bindpasswd are not needed.

You also do not need to log in when you configure LDAP authentication using Management Console.

1 - Workflow for configuring LDAP bind

To configure your Vertica database to authenticate clients using LDAP bind, follow these steps:.

To configure your Vertica database to authenticate clients using LDAP bind, follow these steps:

  1. Obtain a service account. For information see the LDAP product documentation.You cannot use the service account in the connection parameters for LDAP bind.

  2. Compare the user's LDAP account name to their Vertica username. For example, if John Smith's Active Directory (AD) sAMAccountName = jsmith, his Vertica username must also be jsmith.

    However, the LDAP account does not have to match the database user name, as shown in the following example:

    => CREATE USER r1 IDENTIFIED BY 'password';
    => CREATE AUTHENTICATION ldap1  METHOD 'ldap' HOST '172.16.65.177';
    => ALTER AUTHENTICATION ldap1 SET HOST=
       'ldap://172.16.65.10',basedn='dc=dc,dc=com',binddn_suffix=',ou=unit2,dc=dc,dc=com',binddn_prefix='cn=use';
    => GRANT AUTHENTICATION ldap1 TO r1;
    \! ${TARGET}/bin/vsql -p $PGPORT -U r1 -w $LDAP_USER_PASSWD -h ${HOSTNAME} -c
       "select user_name, client_authentication_name from sessions;"
     user_name | client_authentication_name
    -----------+----------------------------
     r1        | ldap
    (1 row)
    
  3. Run ldapsearch from a Vertica node against your LDAP or AD server. Verify the connection to the server and identify the values of relevant fields. Running ldapsearch helps you build the client authentication string needed to configure LDAP authentication.

    In the following example, ldapsearch returns the CN, DN, and sAMAccountName fields (if they exist) for any user whose CN contains the username jsmith. This search succeeds only for LDAP servers that allow anonymous binding:

    $ ldapsearch -x -h 10.10.10.10 -b "ou=Vertica Users,dc=CompanyCorp,dc=com"
    '(cn=jsmith*)' cn dn uid sAMAccountName
    

    ldapsearch returns the following results. The relevant information for LDAP bind is in bold:

    # extended LDIF
    #
    # LDAPv3
    # base <ou=Vertica Users,dc=CompanyCorp,dc=com> with scope subtree
    # filter: (cn=jsmith*)
    # requesting: cn dn uid sAMAccountName
    #
    # jsmith, Users, CompanyCorp.com
    dn:cn=jsmith,ou=Vertica Users,dc=CompanyCorp,dc=com
    cn: jsmith
    uid: jsmith
    # search result
    search: 2
    result: 0 Success
    # numResponses: 2
    # numEntries: 1
    
  4. Create a new authentication record based on the information from ldapsearch. In the ldapsearch entry, the CN is username jsmith, so you do not need to set it. Vertica automatically sets the CN to the username of the user who is trying to connect. Vertica uses that CN to bind against the LDAP server.

    => CREATE AUTHENTICATION v_ldap_bind METHOD 'ldap' HOST '0.0.0.0/0';
    => GRANT AUTHENTICATION v_ldap_bind TO public;
    => ALTER AUTHENTICATION v_ldap_bind SET
    host='ldap://10.10.10.10/',
    basedn='DC=CompanyCorp,DC=com',
    binddn_prefix='cn=',
    binddn_suffix=',OU=Vertica Users,DC=CompanyCorp,DC=com';
    

For more information see LDAP Bind Parameters.

2 - Workflow for configuring LDAP search and bind

To configure your Vertica database to authenticate clients using LDAP search and bind, follow these steps:.

To configure your Vertica database to authenticate clients using LDAP search and bind, follow these steps:

  1. Obtain a service account. For information see the LDAP product documentation.

  2. From a Vertica node, run ldapsearch against your LDAP or AD server. Verify the connection to the server, and identify the values of relevant fields. Running ldapsearch helps you build the client authentication string needed to configure LDAP authentication.

    In the following example, ldapsearch returns the CN, DN, and sAMAccountName fields (if they exist) for any user whose CN contains the username, John. This search succeeds only for LDAP servers that allow anonymous binding:

    $ ldapsearch -x -h 10.10.10.10 -b 'OU=Vertica Users,DC=CompanyCorp,DC=com' -s sub -D
    'CompanyCorp\jsmith' -W '(cn=John*)' cn dn uid sAMAccountName
    
  3. Review the results that ldapsearch returns.The relevant information for search and bind is in bold:

    # extended LDIF
    #
    # LDAPv3
    # base <OU=Vertica Users,DC=CompanyCorp,DC=com> with scope subtree
    # filter: (cn=John*)
    # requesting: cn dn sAMAccountName
    #
    # John Smith, Vertica Users, CompanyCorp.com
    dn: CN=jsmith,OU=Vertica Users,DC=CompanyCorp,DC=com
    cn: Jsmith
    sAMAccountName: jsmith
    # search result
    search: 2
    result: 0 Success
    # numResponses: 2
    # numEntries: 1
    
  4. Create the client authentication record. The cn attribute contains the username you want—jsmith. Set your search attribute to the CN field so that the search finds the appropriate account.

    => CREATE AUTHENTICATION v_ldap_bind_search METHOD 'ldap' HOST '10.10.10.10';
    => GRANT AUTHENTICATION v_ldap_bind_search TO public;
    => ALTER AUTHENTICATION v_ldap_bind_search SET
    host='ldap://10.10.10.10',
    basedn='OU=Vertica,DC=CompanyCorp,DC=com',
    binddn='CN=jsmith,OU=Vertica Users,DC=CompanyCorp,DC=com',
    bind_password='password',
    search_attribute='CN';
    

For more information see LDAP Bind and Search Parameters