Security

How to get session key / auth token for mod input script

jimmycmfu
New Member

Hi,

I'm currently trying to get the auth token that can be used for rest apis without exposing my password. Since it is a mod input script, I am using passAuth = <user> in inputs.conf. This provides me the auth token via stdin, but it is exposing some information that I would not like exposed. The stdin that I get is "sessionKey=abcd1234" for example. Is there a way to omit the "sessionKey=" part and only return the session key?

https://docs.splunk.com/Documentation/Splunk/8.2.1/Admin/Inputsconf

https://docs.splunk.com/Documentation/SplunkCloud/8.2.2105/AdvancedDev/ModInputsIntro

Alternatively, is there another way to retrieve the session key / auth token without including the password in my script?

Thanks!

 

Labels (2)
0 Karma
Get Updates on the Splunk Community!

The OpenTelemetry Certified Associate (OTCA) Exam

What’s this OTCA exam? The Linux Foundation offers the OpenTelemetry Certified Associate (OTCA) credential to ...

From Manual to Agentic: Level Up Your SOC at Cisco Live

Welcome to the Era of the Agentic SOC   Are you tired of being a manual alert responder? The security ...

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 4)

Welcome back to Splunk Classroom Chronicles, our ongoing series where we shine a light on what really happens ...