All Apps and Add-ons

authtokenrefresh doesn't work

sistemistiposta
Path Finder

Hello,
I successfully run the Rundeck App community for Splunk. I can create the token and I use it with success to to query from Splunk to Rundeck via REST API.

But the batch authtokenrefresh can't update the token when it is near to expire:

2019-09-20 11:57:04,609 INFO Refreshing token for host rundeck.example.com:4443
2019-09-20 11:57:05,076 ERROR Error deleting rundeck credential for host rundeck.example.com:4443 : <type 'exceptions.KeyError'>
2019-09-20 11:57:05,081 ERROR Error creating rundeck credential for host rundeck.example.com:4443 : <class 'splunklib.binding.HTTPError'>
2019-09-20 11:57:05,309 INFO Performing Rundeck Modular Input validation
2019-09-20 11:57:06,762 INFO rundeck://users : Performing token replacement
2019-09-20 11:57:06,809 INFO rundeck://project_jobs : Getting Rundeck auth token from secure Splunk storage

So the old token is always used, and the batch at every run creates a new unused token in Rundeck, until the old initial token expires definitively.

Could you help me?
Many thanks
Marco

0 Karma

sistemistiposta
Path Finder

Oh, I definitively found something which doesn't work with latest version of Splunk and Rundeck too.

First, if I have splunkd listening on http, this app doesn't work.
I hacked the code in rundeck.py here to work with HTTP scheme:

SPLUNK_PORT = server_uri[17:]
and
args = {'host':'localhost','port':SPLUNK_PORT,'scheme':'http','scheme':'http','token':session_key,'app':myapp,'owner':'nobody'}
on each line like above.

I thinks a new input config will be appreciated. The SSL is mandatory to the rundeck server, but is not mandatory to splunk daemon, which is localhost.

Then, if you use Rundeck 3.1 you must change the minimum api version to 21:

#default minimum
api_version = "21"

This is all.

Kind Regards
Marco

0 Karma

sistemistiposta
Path Finder

Also from the setup, I can't update the token from Configuration --> Setup Rundeck Environment.
The error is:

2019-09-20 12:33:17,995 ERROR Error deleting rundeck credential , perhaps this is the first setup run and it did not yet exist (that is ok) : <class 'splunk.ResourceNotFound'>
2019-09-20 12:33:17,995 DEBUG creating rundeck credential
2019-09-20 12:33:18,011 ERROR Error creating rundeck credential : <class 'splunk.RESTException'>

and the local/password.conf is not updated.

Instead, at the first run the setup correctly accept the auth token, as expected, and store it in the local/password.conf.

I installed the app on Splunk 7.3

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...

Index This | How many sevens are there between 1 and 100?

August 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...