<?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: Is it possible to set app permissions via the REST API? in Security</title>
    <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67979#M2235</link>
    <description>&lt;P&gt;This is possible and every EAI endpoint has a sub /acl endpoint on which to POST.  You should find some good information in the 'Object Sharing and ACL presentation/mutations' section below, if it's still not clear to you how to do it after going through that info, please reply and let us know exactly what you're running and what kind of result you're getting.&lt;/P&gt;

&lt;P&gt;Object Sharing and ACL presentation/mutations&lt;/P&gt;

&lt;P&gt;All endpoints that list user objects should support object sharing and access control list (ACL) presentation and mutation.&lt;/P&gt;

&lt;P&gt;ACL Presentation&lt;/P&gt;

&lt;P&gt;An ACL consists of the following fields:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;modifiable&lt;/CODE&gt;&lt;BR /&gt;
    Required. A boolean flag indicating whether the ACL is modifiable or not.&lt;BR /&gt;
&lt;CODE&gt;owner&lt;/CODE&gt;&lt;BR /&gt;
    Required. Username of the owner of this object, if an object is not owned by a user should be set to 'nobody'&lt;BR /&gt;
&lt;CODE&gt;perms&lt;/CODE&gt;&lt;BR /&gt;
    Required. A dictionary that maps action to a list of roles which can perform that action 
&lt;CODE&gt;sharing&lt;/CODE&gt;&lt;BR /&gt;
    The level at which this object is shared, can be one of: system, app, user, global&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;s:key name="acl"&amp;gt;
    &amp;lt;s:dict&amp;gt;
        &amp;lt;s:key name="modifiable"&amp;gt;false&amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="owner"&amp;gt;admin&amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="sharing"&amp;gt;user&amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="perms"&amp;gt;
            &amp;lt;s:dict&amp;gt;
               &amp;lt;s:key name="read"&amp;gt;&amp;lt;s:list&amp;gt;&amp;lt;s:item&amp;gt;admin&amp;lt;/s:item&amp;gt;&amp;lt;/s:list&amp;gt;&amp;lt;/s:key&amp;gt;
               &amp;lt;s:key name="write"&amp;gt;&amp;lt;s:list&amp;gt;&amp;lt;s:item&amp;gt;admin&amp;lt;/s:item&amp;gt;&amp;lt;/s:list&amp;gt;&amp;lt;/s:key&amp;gt;
            &amp;lt;/s:dict&amp;gt;
       &amp;lt;/s:key&amp;gt;
     &amp;lt;s:dict/&amp;gt;
&amp;lt;/s:key&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;ACL Modification
A request to modify the ACL of an object should POST on the 'acl' custom action of an object (url: ...endpoint/entity-name/acl). The entire ACL should be provided rather than a diff. The following parameters should be provided:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;perms.&amp;lt;action&amp;gt;&lt;/CODE&gt;&lt;BR /&gt;
    A comma delimited list of roles which can perform the given action&lt;BR /&gt;
&lt;CODE&gt;owner&lt;/CODE&gt;&lt;BR /&gt;
    The username of the new owner of the object&lt;BR /&gt;
&lt;CODE&gt;sharing&lt;/CODE&gt;&lt;BR /&gt;
    The level at which this object is shared, can be one of: system, app, user, global&lt;/P&gt;</description>
    <pubDate>Sat, 09 Oct 2010 05:36:21 GMT</pubDate>
    <dc:creator>Mick</dc:creator>
    <dc:date>2010-10-09T05:36:21Z</dc:date>
    <item>
      <title>Is it possible to set app permissions via the REST API?</title>
      <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67978#M2234</link>
      <description>&lt;P&gt;I'm trying to automate the creation of an App using either the Remote CLI or the REST API. This involves creating an Index, App, Role and User and tying them all together (the user in the Role, the default App for the Role is the new App and the Role's default Index is the created Index). The one thing it seems I can't do is set the Permissions on the App so only the users in that Role can access it. The only way to do this is to edit a config file but I'd like to be able to do this via the Remote CLI or REST API. Is this possible?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2010 05:13:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67978#M2234</guid>
      <dc:creator>mctester</dc:creator>
      <dc:date>2010-10-09T05:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set app permissions via the REST API?</title>
      <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67979#M2235</link>
      <description>&lt;P&gt;This is possible and every EAI endpoint has a sub /acl endpoint on which to POST.  You should find some good information in the 'Object Sharing and ACL presentation/mutations' section below, if it's still not clear to you how to do it after going through that info, please reply and let us know exactly what you're running and what kind of result you're getting.&lt;/P&gt;

&lt;P&gt;Object Sharing and ACL presentation/mutations&lt;/P&gt;

&lt;P&gt;All endpoints that list user objects should support object sharing and access control list (ACL) presentation and mutation.&lt;/P&gt;

&lt;P&gt;ACL Presentation&lt;/P&gt;

&lt;P&gt;An ACL consists of the following fields:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;modifiable&lt;/CODE&gt;&lt;BR /&gt;
    Required. A boolean flag indicating whether the ACL is modifiable or not.&lt;BR /&gt;
&lt;CODE&gt;owner&lt;/CODE&gt;&lt;BR /&gt;
    Required. Username of the owner of this object, if an object is not owned by a user should be set to 'nobody'&lt;BR /&gt;
&lt;CODE&gt;perms&lt;/CODE&gt;&lt;BR /&gt;
    Required. A dictionary that maps action to a list of roles which can perform that action 
&lt;CODE&gt;sharing&lt;/CODE&gt;&lt;BR /&gt;
    The level at which this object is shared, can be one of: system, app, user, global&lt;/P&gt;

&lt;P&gt;Example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;s:key name="acl"&amp;gt;
    &amp;lt;s:dict&amp;gt;
        &amp;lt;s:key name="modifiable"&amp;gt;false&amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="owner"&amp;gt;admin&amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="sharing"&amp;gt;user&amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="perms"&amp;gt;
            &amp;lt;s:dict&amp;gt;
               &amp;lt;s:key name="read"&amp;gt;&amp;lt;s:list&amp;gt;&amp;lt;s:item&amp;gt;admin&amp;lt;/s:item&amp;gt;&amp;lt;/s:list&amp;gt;&amp;lt;/s:key&amp;gt;
               &amp;lt;s:key name="write"&amp;gt;&amp;lt;s:list&amp;gt;&amp;lt;s:item&amp;gt;admin&amp;lt;/s:item&amp;gt;&amp;lt;/s:list&amp;gt;&amp;lt;/s:key&amp;gt;
            &amp;lt;/s:dict&amp;gt;
       &amp;lt;/s:key&amp;gt;
     &amp;lt;s:dict/&amp;gt;
&amp;lt;/s:key&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;ACL Modification
A request to modify the ACL of an object should POST on the 'acl' custom action of an object (url: ...endpoint/entity-name/acl). The entire ACL should be provided rather than a diff. The following parameters should be provided:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;perms.&amp;lt;action&amp;gt;&lt;/CODE&gt;&lt;BR /&gt;
    A comma delimited list of roles which can perform the given action&lt;BR /&gt;
&lt;CODE&gt;owner&lt;/CODE&gt;&lt;BR /&gt;
    The username of the new owner of the object&lt;BR /&gt;
&lt;CODE&gt;sharing&lt;/CODE&gt;&lt;BR /&gt;
    The level at which this object is shared, can be one of: system, app, user, global&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2010 05:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67979#M2235</guid>
      <dc:creator>Mick</dc:creator>
      <dc:date>2010-10-09T05:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set app permissions via the REST API?</title>
      <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67980#M2236</link>
      <description>&lt;P&gt;That link is broken and Googling "Object Sharing and ACL presentation/mutations" didn't provide any useful results.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2010 00:33:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67980#M2236</guid>
      <dc:creator>tpedone</dc:creator>
      <dc:date>2010-10-12T00:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set app permissions via the REST API?</title>
      <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67981#M2237</link>
      <description>&lt;P&gt;That's an internal Splunk URL I believe.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2010 01:07:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67981#M2237</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-10-12T01:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set app permissions via the REST API?</title>
      <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67982#M2238</link>
      <description>&lt;P&gt;This is theoretically possible, but a lot of work. All functions in the Splunk UI and most in the CLI call the REST API, so anything that can be done can be done directly with REST calls.&lt;/P&gt;

&lt;P&gt;However, the API is currently unpublished and unsupported for admin operations, as of 4.1.5. (It is supported and documented right now for running and getting results and status of searches.) It is expected that eventually it will be supported, but I don't have a timeline.&lt;/P&gt;

&lt;P&gt;In the meantime, you can look at the rest API by going to &lt;A href="https://localhost:8089/services" rel="nofollow"&gt;https://localhost:8089/services&lt;/A&gt; and &lt;A href="https://localhost:8089/servicesNS/" rel="nofollow"&gt;https://localhost:8089/servicesNS/&lt;/A&gt; (or whatever your Splunkd URL is) in Firefox/Chrome/Safari (it works in IE, but it doesn't apply the stylesheet and therefore isn't as readable or clickable), logging in with a Splunk admin account, and exploring some of the API calls.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2010 01:08:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67982#M2238</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-10-12T01:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set app permissions via the REST API?</title>
      <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67983#M2239</link>
      <description>&lt;P&gt;I've reviewed the information at the /services URI and can add the App but it's not clear from the API how to edit the permissions.  Accessing /services/apps/local/myapp shows the "perms" element as well as the "read" and "write" sub elements as does /services/apps/local/myapp/acl but it's not clear how to format my POST to modify those values.  I've tried "read=admin" but it didn't recognize "read" as a valid element.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2010 01:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/67983#M2239</guid>
      <dc:creator>tpedone</dc:creator>
      <dc:date>2010-10-12T01:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to set app permissions via the REST API?</title>
      <link>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/606996#M16235</link>
      <description>&lt;P&gt;The curl call that changes an app permission looks like :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;curl -s -k -u admin:&amp;lt;ADMIN_PASSWORD&amp;gt; --request POST "https://localhost:8089//services/apps/local/&amp;lt;APP_NAME&amp;gt;/acl" -d sharing=global -d owner=nobody&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The required &lt;EM&gt;sharing&lt;/EM&gt;&amp;nbsp; parameter indicates how the resource is shared:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;I&gt;sharing&lt;/I&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;UL&gt;&lt;LI&gt;&lt;DIV class=""&gt;app: Shared within a specific app&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class=""&gt;global: (Default) Shared globally to all apps.&lt;/DIV&gt;&lt;/LI&gt;&lt;LI&gt;&lt;DIV class=""&gt;user: Private to a user&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The details are available here:&amp;nbsp;&lt;A href="http://&amp;nbsp;https://docs.splunk.com/Documentation/Splunk/latest/RESTUM/RESTusing" target="_self"&gt;REST API doc&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 08:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Is-it-possible-to-set-app-permissions-via-the-REST-API/m-p/606996#M16235</guid>
      <dc:creator>ddessy_splunk</dc:creator>
      <dc:date>2022-07-26T08:54:27Z</dc:date>
    </item>
  </channel>
</rss>

