<?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: Need help on the splunk.entity.getEntities in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Need-help-on-the-splunk-entity-getEntities/m-p/570329#M10107</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/69461"&gt;@mbachhav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the user have appropriate capabilities to access password?&lt;/P&gt;&lt;P class="Typography__P-sc-7idj16-10 lndoTC"&gt;users require the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;list_storage_passwords&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;capability to read plain text secrets and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;admin_all_objects&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;capability to create, update, and delete secrets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
    <pubDate>Sat, 09 Oct 2021 14:33:25 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2021-10-09T14:33:25Z</dc:date>
    <item>
      <title>Need help on the splunk.entity.getEntities</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Need-help-on-the-splunk-entity-getEntities/m-p/569823#M10106</link>
      <description>&lt;DIV&gt;We have TA for Splunk and are using Splunk's internal library(&lt;SPAN&gt;splunk.entity&lt;/SPAN&gt;) to fetch the credentials from passwords.conf file using th&lt;SPAN&gt;e below code.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;On some Splunk enterprise instances below code is working properly and returning username and clear password. But on some Splunk enterprise instances and Splunk cloud, it has been observed that the value of&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;['eai:acl']['app']&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;is Null due to which exception has been raised by the code.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;We would like to know why some Splunk instances return the Null value for ['eai:acl']['app'].&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Code -&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;import splunk.entity as entity&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;myapp = 'APP-NAME'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;realm = 'APP-NAME-Api'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;try:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; entities = entity.getEntities(['admin', 'passwords'], namespace=myapp, owner='nobody', sessionKey=session_key) &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;except Exception as e:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; raise Exception("Could not get %s credentials from Splunk. Error: %s" % (myapp, str(e)))&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;for i, c in list(entities.items()):&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; if c['eai:acl']['app'] == myapp and c['realm'] == realm:&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return c['username'], c['clear_password']&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;SPAN&gt;raise Exception("No credentials found.")&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We also tried with the below CURL command but the field&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;['eai:acl']['app'] is missing in the response.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;curl -k -u &amp;lt;splunk_username&amp;gt;:&amp;lt;splunk_password&amp;gt; https://&amp;lt;host&amp;gt;:8089/services/storage/passwords&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 04:30:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Need-help-on-the-splunk-entity-getEntities/m-p/569823#M10106</guid>
      <dc:creator>mbachhav</dc:creator>
      <dc:date>2021-10-06T04:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on the splunk.entity.getEntities</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Need-help-on-the-splunk-entity-getEntities/m-p/570329#M10107</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/69461"&gt;@mbachhav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does the user have appropriate capabilities to access password?&lt;/P&gt;&lt;P class="Typography__P-sc-7idj16-10 lndoTC"&gt;users require the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;list_storage_passwords&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;capability to read plain text secrets and the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;admin_all_objects&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;capability to create, update, and delete secrets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一 &amp;nbsp; &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 14:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Need-help-on-the-splunk-entity-getEntities/m-p/570329#M10107</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-10-09T14:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on the splunk.entity.getEntities</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Need-help-on-the-splunk-entity-getEntities/m-p/571764#M10108</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Yes, a user has capabilities to access passwords and access to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;list_storage_passwords&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp; and&amp;nbsp;&lt;STRONG&gt;admin_all_objects&lt;/STRONG&gt;&amp;nbsp;capabilities.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 07:21:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Need-help-on-the-splunk-entity-getEntities/m-p/571764#M10108</guid>
      <dc:creator>mbachhav</dc:creator>
      <dc:date>2021-10-21T07:21:19Z</dc:date>
    </item>
  </channel>
</rss>

