Splunk supports authentication via its internal authentication services or your existing LDAP server.
Note: You must add a CA when connecting to AD via secure LDAP. Read the section below entitled Import your CA for more information.
Configure LDAPConfigure LDAP through Splunk Web or via authentication.conf.
Determine your User and Group Base DNBefore you map your LDAP settings in Splunk, figure out your user and groupbase DN, or distinguished name. The DN is the location in the directory where authentication information is stored. If all information is contained in each user's entry, then these DNs must be the same. If group membership information for users is kept in a separate entry, enter a separate DN identifying the subtree in the directory where the group information is stored.
Set up LDAP via Splunk WebFirst, set LDAP as your authentication strategy:
1. Click the Admin link in the upper right-hand corner.
2. Click the Server tab then select Authentication Configuration.
3. Select LDAP from the Set Authentication method drop-down.
Next, fill in your LDAP settings:
4. Define an LDAP strategy name for your configuration. The name cannot be LDAP and it must not contain spaces.
5. The strategy name is added to the Set Authentication Strategy drop-down once you save your LDAP configurations.
6. Specify the Host name of your LDAP server. Be sure that your Splunk Server can resolve the host name.
7. Specify the Port that Splunk should use to connect to your LDAP server.
8. Turn on SSL by checking SSL enabled.
9. Enter the Bind DN
10. Enter and confirm the Bind DN password for the binding user.
11. Specify the User base DN.
12. Specify the User base filter for the object class you want to filter your users on.
13. Specify the Group base DN
14. Input the Group base filter.
15. Enter the User name attribute that defines the user name.
16. Specify the Real name attribute (also referred to as the common name) of the user.
17. Input the Group name attribute.
18. Specify the Group member attribute.
19. Enter the Group mapping attribute.
20. Enter a value for pageSize.
21. Specify a Failsafe user name.
22. Enter and confirm a Failsafe password for your failsafe user.
Import your CATo configure Splunk's LDAP to work with your own CA, follow these steps:
1. Export your root CA cert in Base-64 encoded X.509 format.
2. Add these lines to $SPLUNK_HOME/etc/openldap/ldap.conf:
TLS_CACERT $SPLUNK_HOME/etc/openldap/certs/$YOUR_CERT_NAME TLS_CACERTDIR $SPLUNK_HOME/etc/openldap/certs
4. Place the exported CA cert at $SPLUNK_HOME/etc/openldap/certs/cert1.cer.
5. Restart Splunk.
6. In Splunk Web, navigate to Admin > Server > Authentication Configuration.
7. You can now map the designated AD groups to the respective roles in Splunk.
Map existing LDAP groups to Splunk rolesOnce you have configured Splunk to authenticate via your LDAP server, map your existing LDAP groups to any roles you have created. If you do not use groups, you can map users individually.
Note: You can either map users or map groups but not both. If you are using groups, all the users you wish to have access to Splunk must be members of an appropriate group. Groups inherit capabilities from the highest level role they're a member of.
All users and groups are visible under the Users tab in the Splunk Web Admin section. Click the Edit link next to the appropriate user or group to define User Roles.
Test your LDAP configurationIf you find that your Splunk install is not able to successfully connect to your LDAP server, try these troubleshooting steps:
1. Remove any custom values you've added for userBaseFilter and groupBaseFilter.
2. Check $SPLUNK_HOME/var/log/splunk/splunkd.log for any authentication errors.
3. Perform an ldapsearch to test that the variables you are specifying work:
ldapsearch -h "<host>" -p "<port>" -b "<userBaseDN>" -x -D "<bindDN>" -w "<bindDNpassword>" ldapsearch -h "<host>" -p "<port>" -b "<groupBaseDN>" -x -D "<bindDN>" -w "<bindDNpassword>"
This example steps you through obtaining LDIFs and setting up authentication.conf. You can also enter these settings in Splunk Web, as described above.
Note: The particulars of your LDAP server may be different. Check your LDAP server settings and adapt authentication.conf attributes to your environment.
Get LDIFsYou should have both the user and group LDIFs to set up authentication.conf.
User LDIFGet the user LDIF by running the following command (use your own ou and dc):
# ldapsearch -h ldaphost -p 389 -x -b "ou=People,dc=splunk,dc=com" -D "cn=Directory Manager" -w password
This returns:
# splunkadmin, People, splunk.com dn: uid=splunkadmin,ou=People, dc=splunk,dc=com uid: splunkadmin givenName: Splunk objectClass: top objectClass: person objectClass: organizationalPerson objectClass: inetorgperson sn: Admin cn: Splunk Admin
Get the group LDIF by running the following command (use your own ou and dc):
# ldapsearch -h ldaphost -p 389 -x -b "ou=groups,dc=splunk,dc=com" -D "cn=Directory Manager" -w password
This returns:
# SplunkAdmins, Groups, splunk.com dn: cn=SplunkAdmins,ou=Groups, dc=splunk,dc=com description: Splunk Admins objectClass: top objectClass: groupofuniquenames cn: SplunkAdmins uniqueMember: uid=splunkadmin,ou=People, dc=splunk,dc=com
Use the following instructions to set up authentication.conf. Edit this file in $SPLUNK_HOME/etc/system/local/, or your own custom application directory in $SPLUNK_HOME/etc/apps/. For more information on configuration files in general, see how configuration files work.
To set up LDAP via Splunk Web, see the instructions above.
set authentication typeBy default, Splunk uses its own authentication type. Change that in the [authentication] stanza.
[authentication] authType = LDAP authSettings = ldaphost
Now, map your LDIFs to the attribute/values in authentication.conf.
[ldaphost] host = ldaphost.domain.com pageSize = 0 port = 389 SSLEnabled = 0 failsafeLogin = failsafe failsafePassword = fail bindDN = cn=Directory Manager bindDNpassword = password groupBaseDN = ou=Groups,dc=splunk,dc=com; groupBaseFilter = (objectclass=*) groupMappingAttribute = dn groupMemberAttribute = uniqueMember groupNameAttribute = cn realNameAttribute = givenName userBaseDN = ou=People,dc=splunk,dc=com; userBaseFilter = (objectclass=*) userNameAttribute = uid
You can also set a stanza to map roles you have created in authorize.conf to users you have enabled in authentication.conf.
[roleMap] Admin = SplunkAdmins;
If you have already configured saved searches and want to convert them to work with your new LDAP configuration, follow these steps:
1. Identify the user IDs at the Splunk CLI by typing:
./splunk list user
3. To test that this works, create one saved search as an LDAP user so you can verify that you have the format of the LDAP userid, and
then making the changes to the existing saved searches.
4. Once you finish modifying savedsearches.conf, you must restart Splunk.
Known issues with LDAPWhen configuring Splunk to work with your LDAP instance, note the following:
Comments
No comments have been submitted.