<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to retrieve password from password.conf in python script? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616886#M10810</link>
    <description>&lt;P&gt;Thanks for the additional information. Did you try connecting to Splunk Enterprise with the Python SDK through the connect function? See&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtoconnectpython" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtoconnectpython&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;After that, you should be able to retrieve passwords following the example at&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragepython/#Examples" target="_blank" rel="noopener"&gt;https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragepython/#Examples&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Oct 2022 21:02:17 GMT</pubDate>
    <dc:creator>tcole_splunk</dc:creator>
    <dc:date>2022-10-12T21:02:17Z</dc:date>
    <item>
      <title>How to retrieve password from password.conf in python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616520#M10801</link>
      <description>&lt;P&gt;Please help in reading the credentials from password.conf in python script.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 14:08:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616520#M10801</guid>
      <dc:creator>splunker2117</dc:creator>
      <dc:date>2022-10-10T14:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to retrieve password from password.conf in python script</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616529#M10802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/246365"&gt;@splunker2117&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if you launch your python script as a Splunk input, you can store password in encrypted mode in Splunk passing them from Splunk.&lt;/P&gt;&lt;P&gt;For more infos see at&amp;nbsp;&lt;A href="https://www.splunk.com/en_us/blog/security/storing-encrypted-credentials.html" target="_blank"&gt;https://www.splunk.com/en_us/blog/security/storing-encrypted-credentials.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/store-encrypted-secrets-in-a-splunk-app.html#:~:text=To%20store%20a%20secret%20in,a%20secret%20from%20the%20passwords" target="_blank"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/store-encrypted-secrets-in-a-splunk-app.html#:~:text=To%20store%20a%20secret%20in,a%20secret%20from%20the%20passwords&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.splunk.com/en_us/blog/security/storing-encrypted-credentials.html?_ga=2.20827064.164275633.1647202914-2144719424.1634111818&amp;amp;_gac=1.26356303.1648138710.CjwKCAjwrfCRBhAXEiwAnkmKmbCHk9mDoX7lbkAx6nO-uQZ16zPzb_egLcEQpg3wmh8PmVk5vBFYAxoCZNUQAvD_BwE&amp;amp;_gl=1*ekcpst*_ga*MjE0NDcxOTQyNC4xNjM0MTExODE4*_gid*MTY0Mjc1NjMzLjE2NDcyMDI5MTQ.*_gac*Q2p3S0NBandyZkNSQmhBWEVpd0Fua21LbWJDSGs5bURvWDdsYmtBeDZuTy11UVoxNnpQemJfZWdMY0VRcGczd21oOFBtVms1dkJGWUF4b0NaTlVRQXZEX0J3RS4xNjQ4MTM4NzEw" target="_blank"&gt;https://www.splunk.com/en_us/blog/security/storing-encrypted-credentials.html?_ga=2.20827064.164275633.1647202914-2144719424.1634111818&amp;amp;_gac=1.26356303.1648138710.CjwKCAjwrfCRBhAXEiwAnkmKmbCHk9mDoX7lbkAx6nO-uQZ16zPzb_egLcEQpg3wmh8PmVk5vBFYAxoCZNUQAvD_BwE&amp;amp;_gl=1*ekcpst*_ga*MjE0NDcxOTQyNC4xNjM0MTExODE4*_gid*MTY0Mjc1NjMzLjE2NDcyMDI5MTQ.*_gac*Q2p3S0NBandyZkNSQmhBWEVpd0Fua21LbWJDSGs5bURvWDdsYmtBeDZuTy11UVoxNnpQemJfZWdMY0VRcGczd21oOFBtVms1dkJGWUF4b0NaTlVRQXZEX0J3RS4xNjQ4MTM4NzEw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is to create a setup pdashboard in your App to insert pasword:&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.splunk.com/en_us/blog/tips-and-tricks/enable-first-run-app-configuration-with-setup-pages.html#:~:text=A%20setup%20page%20is%20a,the%20Splunk%20Web%20user%20interface" target="_blank"&gt;https://www.splunk.com/en_us/blog/tips-and-tricks/enable-first-run-app-configuration-with-setup-pages.html#:~:text=A%20setup%20page%20is%20a,the%20Splunk%20Web%20user%20interface&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 13:12:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616529#M10802</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-10T13:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve password from password.conf in python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616717#M10806</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;Just to add to what Giuseppe posted, you can retrieve credentials from passwords.conf using the storage/passwords REST API endpoint and the Splunk SDK for Python. Here is the documentation explaining how to do this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragepython" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragepython&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 17:11:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616717#M10806</guid>
      <dc:creator>tcole_splunk</dc:creator>
      <dc:date>2022-10-11T17:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve password from password.conf in python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616726#M10807</link>
      <description>&lt;P&gt;Here I do not want to expose admin credentials even. Is there any way to read password.conf without passing admin credentials. Basically I need to retrieve secrets while running custom command.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 18:51:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616726#M10807</guid>
      <dc:creator>splunker2117</dc:creator>
      <dc:date>2022-10-11T18:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve password from password.conf in python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616728#M10808</link>
      <description>&lt;P&gt;I'm not sure I understand. You need to pass in credentials in order to read passwords.conf, because this file is encrypted and you need to ensure secure access. In order to call the storage/passwords endpoint, the user needs to belong to a role with certain capabilities assigned. See&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragerbac" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragerbac&lt;/A&gt;&amp;nbsp;for more details.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 19:01:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616728#M10808</guid>
      <dc:creator>tcole_splunk</dc:creator>
      <dc:date>2022-10-11T19:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve password from password.conf in python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616803#M10809</link>
      <description>&lt;P&gt;Let me give you bit background&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/77476"&gt;@tcole_splunk&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I've script to run as custom command and secrets are stored in password.conf with the help of setuppage.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Now I am stuck where unable to read the secrets from password.conf to authenticate 3rd party API.&lt;/P&gt;&lt;P&gt;I've used multiple ways to read password.conf however it is failing to connect at initial stage where it call to splunk rest api to retrieve passwords.conf details. Goal is to get the session key without passing the hardcoded values so can use.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;service = client.Service(token=session_key,host="127.0.0.1", port=8089)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 12 Oct 2022 11:10:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616803#M10809</guid>
      <dc:creator>splunker2117</dc:creator>
      <dc:date>2022-10-12T11:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve password from password.conf in python script?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616886#M10810</link>
      <description>&lt;P&gt;Thanks for the additional information. Did you try connecting to Splunk Enterprise with the Python SDK through the connect function? See&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtoconnectpython" target="_blank"&gt;https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtoconnectpython&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;After that, you should be able to retrieve passwords following the example at&amp;nbsp;&lt;A href="https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragepython/#Examples" target="_blank" rel="noopener"&gt;https://dev.splunk.com/enterprise/docs/developapps/manageknowledge/secretstorage/secretstoragepython/#Examples&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 21:02:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-retrieve-password-from-password-conf-in-python-script/m-p/616886#M10810</guid>
      <dc:creator>tcole_splunk</dc:creator>
      <dc:date>2022-10-12T21:02:17Z</dc:date>
    </item>
  </channel>
</rss>

