# Running custom plugin queries in X-Pack enabled Elasticsearch

**URL:** https://discuss.elastic.co/t/running-custom-plugin-queries-in-x-pack-enabled-elasticsearch/188279
**Category:** Elasticsearch
**Created:** [July 1, 2019, 9:58am UTC](https://discuss.elastic.co/t/running-custom-plugin-queries-in-x-pack-enabled-elasticsearch/188279 "2019-07-01T09:58:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ccnoufal](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@ccnoufal](https://discuss.elastic.co/u/ccnoufal)
#### Post date: [July 1, 2019, 9:58am UTC](https://discuss.elastic.co/t/running-custom-plugin-queries-in-x-pack-enabled-elasticsearch/188279/1 "2019-07-01T09:58:39Z")

</div>

I am running queries against a custom plugin called join search plugin. This was working without enabling security using x-pack. But when security is enabled using x-pack I am not able to run the custom queries.

I had configured user hercules and role as well.  
I am getting following respone.

{"error":{"root\_cause":[{"type":"security\_exception","reason":"action [indices:data/read/join-search] is unauthorized for user [hercules]"}],"type":"security\_exception","reason":"action [indices:data/read/join-search] is unauthorized for user [hercules]","caused\_by":{"type":"illegal\_state\_exception","reason":"only scroll related requests are known indices api that don't support retrieving the indices they relate to"}},"status":403}

Here is my roles.yml

```
hecules:
  cluster: ['monitor']
  indices:
    - names ['*']
	  privileges:
	    - all

```

user\_roles.yml:  
`hercules:hercules`

It seems this action indices:data/read/join-search is not authorized for the Hercules user having hercules role. I think x-pack is not able to detect the action.  
Do you have any idea why this is not still authoring even after all privileges are given ?  
Please come with solutions

---

<div class="post-metadata">

### Author: ![ccnoufal](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@ccnoufal](https://discuss.elastic.co/u/ccnoufal)
#### Post date: [July 16, 2019, 9:40am UTC](https://discuss.elastic.co/t/running-custom-plugin-queries-in-x-pack-enabled-elasticsearch/188279/2 "2019-07-16T09:40:37Z")

</div>

> [@ccnoufal](#):
>
> indices:data/read/join-search

Here  
action : indices:data/read/join-search is one of the Action defined by my plugin. I think x-pack is not able to authorize this action.  
Do you have any idea how can I add this action to Elasticsearch to authorize this action ?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 13, 2019, 9:40am UTC](https://discuss.elastic.co/t/running-custom-plugin-queries-in-x-pack-enabled-elasticsearch/188279/3 "2019-08-13T09:40:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
