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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...