Scripted authentication
This documentation does not apply to the most recent version of Splunk. Click here for the latest version.
Scripted authentication
Splunk ships with support for three authentication systems: Splunk's built-in system, LDAP and a new scripted authentication API. With the new scripted authentication system, you can set up Splunk to interface with an authentication system you already have in place.
Commands
Scripted authentication currently has three built-in commands. Here is a descriptive list of these commands, including their inputs and outputs.
-
userlogin: login with username/password pair- in:
--username=<username> --password=<password>(passed over stdin) - out: --status=<status_bit> --search_filter=<search_filter>(optional) --authToken=<tok> (optional)success (or fail)
- in:
-
getUserType: this command corresponds to the role within Splunk (for example Admin, Power or User)- in:
--username=<username> --authToken=<tok> (optional) - out:
--status=<status_bit> --role=<role> (eg Admin)
- in:
-
getUserInfo: get user information- in:
--username=<username> --authToken=<tok> (optional) - out:
--status=<status_bit> --userInfo=<userId>;<username>;<realname>;<role>
- in:
Supplemental calls:
-
getUsers- in:
--authToken=<tok> (optional) - out:
--status=<status_bit> --userInfo=<userId>;<username>;<realname>;<role> --userInfo1=<userId>;<username>;<realname>;<role>....
- in:
Advanced calls (ticked checking systems etc.):
-
checkSession- in:
--authToken=<tok> (optional) - out:
--status=<status_bit>
- in:
Every out starts with a <status_bit> which is one of the following:
-
success- The command succeeded correctly.
-
tmp_fail- Temporary failure of auth plugin. Attempt to just go on.
-
auth_fail- Failure to authenticate. Terminate the user's session.
Example
For an example on using scripted authentication with PAM, please see this entry in scripted auth developer Rory's blog.
NOTE: Set the pamauth script setuid instead of running Splunk as root.
This documentation applies to the following versions of Splunk: 3.2 , 3.2.1 , 3.2.2 View the Article History for its revisions.