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
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...