I am trying to create a setup screen for my app that will store passwords securely and also create a scripted input in inputs.conf. I want the setup screen to have only three fields (host, username, password). I want those three fields to be input into admin/passwords as realm=host, name=username, and password=password. At the same time, I want to create a new scripted input that would look something like: [script://MyScript.py host].
The script is already configured to pull the username and password from admin/passwords using the host parameter to identify the correct realm. This is necessary because there will be multiple scripts running against different hosts that will potentially have different usernames and passwords.
I have the setup.xml below working. It correctly inputs a new host/username/password combination and the script can read that successfully. But, I have to manually create the script entry in inputs.conf. How can I have the setup store the password securely and also create the scripted input in inputs.conf at the same time? Do I have to use a custom endpoint for that? If so, how can a custom endpoint write a password to admin/passwords?
<setup> <block title="Add new host" endpoint="admin/passwords" entity="_new"> <input field="realm"> <label>Host</label> <type>text</type> </input> <input field="name"> <label>Username</label> <type>text</type> </input> <input field="password"> <label>Password</label> <type>password</type> </input> </block> </setup>
References:
http://docs.splunk.com/Documentation/Splunk/latest/Developer/SetupExampleCredentials
... View more