<?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 can I produce a list of users and their roles? in Security</title>
    <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460700#M10732</link>
    <description>&lt;P&gt;many nice answers here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/757480/rest-api-get-users-assigned-to-a-role.html"&gt;https://answers.splunk.com/answers/757480/rest-api-get-users-assigned-to-a-role.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/590031/how-can-i-get-list-of-users-from-rest-api.html"&gt;https://answers.splunk.com/answers/590031/how-can-i-get-list-of-users-from-rest-api.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/551303/query-to-find-out-users-belong-to-a-particular-rol.html"&gt;https://answers.splunk.com/answers/551303/query-to-find-out-users-belong-to-a-particular-rol.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/127844/how-can-i-generate-a-list-of-users-and-assigned-roles.html"&gt;https://answers.splunk.com/answers/127844/how-can-i-generate-a-list-of-users-and-assigned-roles.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2019 21:15:18 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2019-12-11T21:15:18Z</dc:date>
    <item>
      <title>How can I produce a list of users and their roles?</title>
      <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460699#M10731</link>
      <description>&lt;P&gt;How can I produce a list of users and their roles?  Maybe a rest call to produce such a list... &lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 20:40:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460699#M10731</guid>
      <dc:creator>danielbb</dc:creator>
      <dc:date>2019-12-11T20:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I produce a list of users and their roles?</title>
      <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460700#M10732</link>
      <description>&lt;P&gt;many nice answers here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/757480/rest-api-get-users-assigned-to-a-role.html"&gt;https://answers.splunk.com/answers/757480/rest-api-get-users-assigned-to-a-role.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/590031/how-can-i-get-list-of-users-from-rest-api.html"&gt;https://answers.splunk.com/answers/590031/how-can-i-get-list-of-users-from-rest-api.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/551303/query-to-find-out-users-belong-to-a-particular-rol.html"&gt;https://answers.splunk.com/answers/551303/query-to-find-out-users-belong-to-a-particular-rol.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/127844/how-can-i-generate-a-list-of-users-and-assigned-roles.html"&gt;https://answers.splunk.com/answers/127844/how-can-i-generate-a-list-of-users-and-assigned-roles.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 21:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460700#M10732</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-12-11T21:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I produce a list of users and their roles?</title>
      <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460701#M10733</link>
      <description>&lt;P&gt;Hi @danielbb,&lt;/P&gt;

&lt;P&gt;This question is similar to the one here : &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/127844/how-can-i-generate-a-list-of-users-and-assigned-roles.html"&gt;https://answers.splunk.com/answers/127844/how-can-i-generate-a-list-of-users-and-assigned-roles.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As @somesoni2 mentioned :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |rest /services/authentication/users splunk_server=local 
 |fields title roles realname|rename title as userName, realname as Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You will need admin privileges to get full result.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 21:16:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460701#M10733</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-12-11T21:16:57Z</dc:date>
    </item>
    <item>
      <title>Re: How can I produce a list of users and their roles?</title>
      <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460702#M10734</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| rest /services/authentication/users
| stats values(roles) by title
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This get you what you're looking for? (or close, you might have a different value for title, just try running the first part to see if the GET call returns what you're looking for at a high level).&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 21:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460702#M10734</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-12-11T21:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I produce a list of users and their roles?</title>
      <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460703#M10735</link>
      <description>&lt;P&gt;We ran this query on three environments and it produced the results. Is there a way to combine these three result sets? bearing in mind that the same users with different roles can exist in different environments.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 14:20:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460703#M10735</guid>
      <dc:creator>danielbb</dc:creator>
      <dc:date>2019-12-18T14:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I produce a list of users and their roles?</title>
      <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460704#M10736</link>
      <description>&lt;P&gt;We had to give full admin access in the past because they weren't able to discern what permissions were needed for some tools (ES, UBA, etc).&lt;BR /&gt;
Then we needed to audit and figure out who is able to do what and slowly remove those who don't need it.&lt;BR /&gt;
Several roles import the admin role and they have several different SH clusters.&lt;BR /&gt;
Here is what we ended up with to build an action list.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest/services/authentication/users
| dedup id
| rename title AS username roles AS role_direct
| mvexpand role_direct
| eval user=username . " = " . realname
| fields user role_direct
| appendpipe [
| rest/services/authorization/roles
| dedup id
| rename title AS role_direct
| eval role_add = role_direct
| eval combined_roles=mvappend(role_add,imported_roles)
| mvexpand combined_roles 
| fields role_direct, combined_roles]
| stats list(*) AS * BY role_direct
| mvexpand combined_roles
| rename combined_roles AS combined_role
| eval formatted_role=if(combined_role = role_direct,combined_role." (direct assignment)",combined_role." (inherited through ".role_direct.")")
| appendpipe [
| rest /services/authorization/roles 
| dedup id
| rename title AS combined_role
| fields combined_role capabilities]
| stats list(*) AS * BY combined_role
| mvexpand formatted_role
| mvexpand capabilities
| mvexpand user
| rename capabilities AS capability
| rename formatted_role AS "role (inheritance)"
| table user "role (inheritance)" capability
| search capability="edit_user"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Dec 2019 21:03:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460704#M10736</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-18T21:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I produce a list of users and their roles?</title>
      <link>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460705#M10737</link>
      <description>&lt;P&gt;See my answer in this post.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 21:04:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-can-I-produce-a-list-of-users-and-their-roles/m-p/460705#M10737</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-18T21:04:31Z</dc:date>
    </item>
  </channel>
</rss>

