Security

How to manage password when running a CLI search command in a batch file?

akanno
Communicator

I want to run CLI search command in a batch file on Windows OS.
I hardcode username and password in the batch file because Splunk requires authentication.
However, hardcoding password in the batch file is unfavorable because security reasons.
So, I want to run a CLI search command in a batch file without hardcoding the password.
Could you tell me the best practices that run CLI search command in a batch file?

0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust

You can encode it in a configuration file, salt it in a database, etc. This is a common problem with storing any credentials. The best practice is up to your environment, needs, etc. If you must use batch, then you'll probably have to encode it in a config file somewhere.

You'd probably be better off using a different language and encoding the password in some weird base39 etc.

Please see this post https://answers.splunk.com/answers/337706/how-to-hide-the-password-in-the-script-when-i-use.html

or google "best practices for password in batch script", etc. The splunk answers community is not a security forum, although many of us work in the security field.

View solution in original post

0 Karma

jkat54
SplunkTrust
SplunkTrust

You can encode it in a configuration file, salt it in a database, etc. This is a common problem with storing any credentials. The best practice is up to your environment, needs, etc. If you must use batch, then you'll probably have to encode it in a config file somewhere.

You'd probably be better off using a different language and encoding the password in some weird base39 etc.

Please see this post https://answers.splunk.com/answers/337706/how-to-hide-the-password-in-the-script-when-i-use.html

or google "best practices for password in batch script", etc. The splunk answers community is not a security forum, although many of us work in the security field.

0 Karma

akanno
Communicator

thank you for your reply , jkat54.

It was very helpful for me.

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...