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!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...