All Apps and Add-ons

I need to encrypt the password in my curl command to update a tag entry. Any good way to do this easily?

dmacgillivray
Communicator

Hi All,

I have an app that updates tags when needed. Problem is I am trying to make the initial curl call as secure and as ease as possible.

Does anyone know the simplest way to do this? I do not want to see my password for this app get logged in syslog or any other place. However, I simply want to encrypt the password as seen below.

I know the below command works but how to I get to bring in the password that is encrypted from my password.conf file? I set this up in /local/password.conf of the search app.

curl -k -u user:encrypted_password https://localhost:8089/servicesNS/nobody/search/search/tags/test_hosts -d add=host::testserver1.com

0 Karma

sfrazer
Explorer

Curl has the ability to pull a username / password from a "netrc" file, and you can use this to fill environment variables. The format for a netrc file is likely different from the password.conf app, though.

Here's some more information:

http://stackoverflow.com/a/33818945

0 Karma

dmacgillivray
Communicator

Thanks sfrazer, I saw this. It actually has a URL option, which I wonder if I can call our pass rest that way.
--netrc url

appreciate the suggestion.

-Daniel

0 Karma

dmacgillivray
Communicator

Hi Sfrazer and all out there doing similar stuff in Splunk, I decided to go with Python and calling the REST from that code. It will allow me to do more things and a richer set of possibilities for an all in one solution.

I really liked this link from below from Splunk using the

import splunk.entity as entity (object) 🙂

https://docs.splunk.com/Documentation/Splunk/6.4.3/AdvancedDev/SetupExampleCredentials#2._Write_a_py...

I will post an update to this when done coding. Happy to contribute.

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...