# sg\_roles - admin/exists when restricting index

**URL:** <https://forum.search-guard.com/t/sg-roles-admin-exists-when-restricting-index/270>\
**Category:** Search Guard\
**Created:** [September 7, 2016, 5:51am UTC](https://forum.search-guard.com/t/sg-roles-admin-exists-when-restricting-index/270 "2016-09-07T05:51:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernie\_Carolan](https://avatars.discourse-cdn.com/v4/letter/b/8797f3/32.png) [@Bernie\_Carolan](https://forum.search-guard.com/u/Bernie_Carolan)\
**Post date:** [September 7, 2016, 5:51am UTC](https://forum.search-guard.com/t/sg-roles-admin-exists-when-restricting-index/270/1 "2016-09-07T05:51:02Z")

</div>

I use the PHP api to query elasticsearch. This works fine with Searchguard except when trying to restrict the query to a single index.  
The role is configured as follows:

> sg\_demouser:

> cluster:

> - cluster:monitor/nodes/info

> - cluster:monitor/health

> - indices:admin/template/get

- indices:admin/exists

> indices:

> ‘shakespeare’:

> ‘\*’:

> - READ

> - indices:admin/exists

> - indices:admin/mappings/fields/get\*

> - indices:admin/validate/query\*

> - indices:admin/get\*

> - indices:data/write/bulk\*

The privilege evaluator returns ‘No perm match for indices:admin/exists and [sg\_demouser, sg\_public]’

If I allow all for indices then the query works fine

> > sg\_demouser:

> > cluster:

> > - cluster:monitor/nodes/info

> > - cluster:monitor/health

> > - indices:admin/template/get

> - indices:admin/exists

> > indices:

> > ‘\*’:

> > ‘\*’:

> > - READ

> > - indices:admin/exists

> > - indices:admin/mappings/fields/get\*

> > - indices:admin/validate/query\*

> > - indices:admin/get\*

> > - indices:data/write/bulk\*

Any ideas what I might be doing wrong here?

---

<div class="post-metadata">

**Author:** ![searchguard\_google\_group](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/searchguard_google_group/32/462_2.png) [@searchguard\_google\_group](https://forum.search-guard.com/u/searchguard_google_group)\
**Post date:** [September 14, 2016, 7:48pm UTC](https://forum.search-guard.com/t/sg-roles-admin-exists-when-restricting-index/270/2 "2016-09-14T19:48:07Z")

</div>

what does your query look like?

can you post the es logfile on DEBUG level?

> **···**
>
> > Am 07.09.2016 um 07:51 schrieb Bernie Carolan \<bernie.carolan@gmail.com\>:
> > 
> > I use the PHP api to query elasticsearch. This works fine with Searchguard except when trying to restrict the query to a single index.  
> > The role is configured as follows:
> > 
> > sg\_demouser:  
> > &nbsp;&nbsp;cluster:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- cluster:monitor/nodes/info  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- cluster:monitor/health  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/template/get  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/exists  
> > &nbsp;&nbsp;indices:  
> > &nbsp;&nbsp;&nbsp;&nbsp;'shakespeare':  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'\*':  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- READ  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/exists  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/mappings/fields/get\*  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/validate/query\*  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/get\*  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:data/write/bulk\*
> > 
> > The privilege evaluator returns 'No perm match for indices:admin/exists and [sg\_demouser, sg\_public]'
> > 
> > If I allow all for indices then the query works fine
> > 
> > sg\_demouser:  
> > &nbsp;&nbsp;cluster:  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- cluster:monitor/nodes/info  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- cluster:monitor/health  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/template/get  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/exists  
> > &nbsp;&nbsp;indices:  
> > &nbsp;&nbsp;&nbsp;&nbsp;'\*':  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'\*':  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- READ  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/exists  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/mappings/fields/get\*  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/validate/query\*  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:admin/get\*  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- indices:data/write/bulk\*
> > 
> > Any ideas what I might be doing wrong here?
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Search Guard" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to search-guard+unsubscribe@googlegroups.com.  
> > To post to this group, send email to search-guard@googlegroups.com.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/36dc1c3d-8bd6-40b9-a4bd-84f0da22cbd0%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/36dc1c3d-8bd6-40b9-a4bd-84f0da22cbd0%40googlegroups.com%5C).  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).
