Version 2.0 to 2.3. Copyright © 2019 TigerGraph. All Rights Reserved.
The Lightweight Directory Access Protocol ( LDAP ) is an industry-standard protocol for accessing and maintaining directory information services across a network. Typically, LDAP servers are used to provide centralized user authentication service. The Tigergraph system supports LDAP authentication by allowing a TigerGraph user to log in using an LDAP username and credentials. During the authentication process, the GSQL server connects to the LDAP server and requests the LDAP server to authenticate the user.
GSQL LDAP authentication supports any LDAP server that follows LDAPv3 protocol. StartTLS/SSL connection is also supported.
SASL authentication is not yet supported. Some LDAP server are configured to require a client certificate upon connection. Client certificate is not yet supported in GSQL LDAP authentication.
In order to manage the user roles and privileges, the TigerGraph GSQL server employs two concepts—proxy user and proxy group.
A proxy user is a GSQL user created to correspond an external LDAP user. When operating within GSQL, the external LDAP user's roles and privileges are determined by the proxy user.
A proxy group is a GSQL user group that is used to manage a group of proxy users who share similar properties/attributes in LDAP.
An existing LDAP user can log in to GSQL only when the user matches at least one of the existing proxy groups' criteria. Once the criteria are satisfied, a proxy user will be created for the LDAP user. The roles and privileges of the proxy user are at least as permissive as the proxy group(s) he belongs to. It is also possible to change the roles of a specific proxy user independently. When the roles and privileges of a proxy group changes, the roles and privileges of all the proxy users belonging to this proxy group change accordingly.
To configure a TigerGraph system to use LDAP, there are two main configuration steps:
Configure the LDAP Connection.
Configure GSQL Proxy Groups and Users.
In order to choose and specify your LDAP configuration settings, you must understand some basic LDAP concepts. One reference for LDAP concepts is https://www.ldap.com/basic-ldap-concepts .
To enable and configure LDAP, run three commands.
gadmin --configure ldap
The gadmin program will then prompt the user for the settings for several LDAP configuration parameters.
2.Apply the configuration:
3.Restart the gsql server:
gadmin restart gsql -y
An example configuration is shown below.
$ gadmin --configure ldap# Enable LDAP authentication: default falsesecurity.ldap.enable [False]: trueTrue# Configure LDAP server hostname: default localhostsecurity.ldap.host [ldap.tigergraph.com]: ldap.tigergraph.comldap.tigergraph.com# Configure LDAP server port: default 389security.ldap.port : 389389# Configure LDAP search base DN, the root node to start the LDAP search for user authentication: must specifysecurity.ldap.base_dn [dc=tigergraph,dc=com]: dc=tigergraph,dc=comdc=tigergraph,dc=com# Configure LDAP search base DN, the root node to start the LDAP search for user authentication.security.ldap.search_filter [(objectClass=*)]:(objectClass=*)# Configure the username attribute name in LDAP server: default uidsecurity.ldap.username_attribute [uid]: uiduid# Configure the DN of LDAP user who has read access to the base DN specified above. Empty if everyone has read access to LDAP data: default emptysecurity.ldap.admin_dn [cn=Manager,dc=tigergraph,dc=com]: cn=Manager,dc=tigergraph,dc=comcn=Manager,dc=tigergraph,dc=com# Configure the password of the admin DN specified above. Needed only when admin_dn is specified: default emptysecurity.ldap.admin_password [secret]: secretsecret# Enable SSL/StartTLS for LDAP connection [none/ssl/starttls]: default nonesecurity.ldap.secure.protocol [starttls]: nonenone# Configure the truststore path for the certificates used in SSL: default emptysecurity.ldap.secure.truststore_path [/tmp/ca_server.pkcs12]:/tmp/ca_server.pkcs12# Configure the truststore format [JKS/PKCS12]: default JKSsecurity.ldap.secure.truststore_format [pkcs12]:pkcs12# Configure the truststore password: default changeitsecurity.ldap.secure.truststore_password [test]:test# Configure to trust all LDAP servers (unsafe): default falsesecurity.ldap.secure.trust_all [False]: false
Below is an explanation of each configuration parameter.
Set to "true" to enable LDAP; "false" to disable LDAP.
Hostname of LDAP server.
Port of LDAP server.
Base DN (Distinguished Name), in order for GSQL to perform the LDAP search.
A search filter is optional. When configured, the search is only performed for the LDAP entries that satisfy the filter. The filter must strictly follow LDAP filter format, i.e., the condition must be wrapped by parentheses, etc. A description of the different types of filters is available at https://www.ldap.com/ldap-filters . The official specification for LDAP filters is available at https://docs.ldap.com/specs/rfc4515.txt .
This specifies the LDAP attribute to search when the GSQL server looks up the usernames in the LDAP server upon login. For example, in the configuration shown above, when a user logs in with the "-u john" option, the GSQL server will search the "uid" attribute in LDAP to find "john" and check the credentials only after "john" is found.
These options are needed when the LDAP server is not publicly readable. In this case, the admin DN and corresponding password need to be specified in order for the GSQL server to connect to the LDAP server.
When set to "none", TigerGraph uses insecure LDAP connection. This can be changed to a secure connection protocol: "starttls" or "ssl".
When starttls or ssl is used, a truststore path as well as its password needs to be configured.
Currently, the TigerGraph system supports two trustore formats: pkcs12 and jks.
When specified, the GSQL server will blindly trust any LDAP sever.
This section explains how to configure a GSQL proxy group in order to allow LDAP user authentication.
A GSQL proxy group is created by the CREATE GROUP command with a given proxy rule. For example, assume there is an attribute called "role" in the LDAP directory, and "engineering" is one of the "role" attribute values. We can create a proxy group with the proxy rule "role=engineering". Different roles can then be assigned to the proxy group. An example is shown below. When a user logins, the GSQL server searches for the user's entry in the LDAP directory. If the user's LDAP entry matches the proxy rule of an existing proxy group, a proxy user is created to which the user will login in.
# create a proxy groupCREATE GROUP developers PROXY "role=engineering" // Any user in LDAP with role=engineer is proxied to the group 'developers'# grant role to proxy groupGRANT ROLE querywriter ON GRAPH computerNet TO developers
The SHOW GROUP command will display information about a group. The DROP GROUP command deletes the definition of a group.
# show the current groupsSHOW GROUP# delete a proxy groupDROP GROUP developers
Nothing needs to be configured for a proxy user. As long as the proxy rule matches, the proxy user will be automatically created upon login. A proxy user is very similar to a normal user. The minor differences are that a proxy user cannot change their password in GSQL and that a proxy user comes with default roles inherited from the proxy group that they belong to.
Admin_dn is the "distinguished name" of an LDAP entry. In LDAP, "distinguished name" is often abbreviated as dn. When configuring this field, a dn entry with read permission on the ldap directory is expected. Configuring a dn with no read permission will result in an error. Not configuring this field will likely result in an error since the LDAP server is typically not publicly readable. Please note that only the dn field will be accepted for this entry. All other entries will result in an authentication error. The corresponding password for the configured dn should also be set correctly in the configured entry "security.ldap.admin_password ".
It depends on what type of protocol your LDAP server uses. SSL/TLS is very common in enterprise use today. When SSL is used, the port is typically 636 instead of default port 389.
You need to configure the truststore when SSL/TLS is used in the LDAP server. The truststore's path, password, and format need to be configured accordingly. We support two formats—JKS and PKCS12. The JKS is Java KeyStore. The corresponding certificates for the LDAP server need to be imported to the JKS for successful authentication. Different truststore formats are typically interchangeable.
This might be the case if SSL/TLS is enabled from the LDAP server side but you don't have a certificate. You can set "security.ldap.secure.trust_all" to true to bypass the SSL/TLS certificate checking.
"Parameter error" means some of the LDAP configurations are not set properly. Most often it is because admin_dn, admin_password, or the login username and password are not set correctly. Unfortunately, we cannot know exactly what field is wrong because the LDAP server side does not respond back with such detail.
Congratulations! This means the LDAP is working. However, TigerGraph cannot find a matching rule for the login user. Please create a proxy group for the user. See documents for creating a proxy group here.