Hi,
I'm trying to use admin/password endpoint to store credentials securely (using sample http://blogs.splunk.com/2011/03/15/storing-encrypted-credentials/). but splunkd is throwing an exception as shown below.
” Exception: Could not get TA-Sample credentials from splunk. Error: [HTTP 500] Splunkd internal error; [{'type': 'ERROR', 'text': "In handler 'passwords': Cannot base64 decode encrypted password", 'code': None}]
Any inputs on this will be really helpful.
Below is the python code and app.conf
App.conf
[ui]
is_visible = 0
label = TA-accuvant
[launcher]
[package]
check_for_updates = 1
[install]
is_configured = 1
[credential::user2:]
password = $1$XJHN09pBlRtp
Handler Python function
def getCredentials(session):
myapp = ‘TA-Accuvant’
try:
entities = entity.getEntities(['admin', 'passwords'], namespace=myapp,
owner=’nobody’, sessionKey=session)
except Exception, e:
raise Exception(“Could not get %s credentials from splunk. Error: %s”
% (myapp, str(e)))
for i, c in entities.items():
return c['username'], c['password']
raise Exception(“No credentials have been found”)
... View more