# New ES REST plugin

**URL:** <https://discuss.elastic.co/t/new-es-rest-plugin/14751>\
**Category:** Elasticsearch\
**Created:** [December 6, 2013, 2:56pm UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751 "2013-12-06T14:56:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simone\_Scarduzio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simone_scarduzio/32/17128_2.png) [@Simone\_Scarduzio](https://discuss.elastic.co/u/Simone_Scarduzio)\
**Post date:** [December 6, 2013, 2:56pm UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/1 "2013-12-06T14:56:17Z")

</div>

Hi all,

I'm really new to ES plugin development, but today I wrote my own because I  
needed this feature which was not available. All the description is in the  
Github page.  
All in all, it's a very small RestFilter.  
I'm not even sure if I structured the code correctly, so I'd really  
appreciate a code review!

Thank you! 🙂

> **[sscarduzio/elasticsearch-readonlyrest-plugin](https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin)**
>
> elasticsearch-readonlyrest-plugin - Free Elasticsearch and Kibana security plugin: super-easy Kibana multi-tenancy, Encryption, Authentication, Authorization, Auditing

-Simone

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/30fceb1a-ceb3-4425-9485-bcdc4c525001%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/30fceb1a-ceb3-4425-9485-bcdc4c525001%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [December 6, 2013, 4:19pm UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/2 "2013-12-06T16:19:55Z")

</div>

Salve Simone,

Your installation instructions have links to my plugin. 🙂 Otherwise good  
job.

--  
Ivan

On Fri, Dec 6, 2013 at 6:56 AM, Simone Scarduzio [scarduzio@gmail.com](mailto:scarduzio@gmail.com)wrote:

> Hi all,
> 
> I'm really new to ES plugin development, but today I wrote my own because  
> I needed this feature which was not available. All the description is in  
> the Github page.  
> All in all, it's a very small RestFilter.  
> I'm not even sure if I structured the code correctly, so I'd really  
> appreciate a code review!
> 
> Thank you! 🙂
> 
> [GitHub - sscarduzio/elasticsearch-readonlyrest-plugin: Free Elasticsearch security plugin and Kibana security plugin: super-easy Kibana multi-tenancy, Encryption, Authentication, Authorization, Auditing](https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin)
> 
> -Simone
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/30fceb1a-ceb3-4425-9485-bcdc4c525001%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/30fceb1a-ceb3-4425-9485-bcdc4c525001%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCMf7arKMwkJQff67DSVHHptVb3Ax6e2XWkNdevPmY4jQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQCMf7arKMwkJQff67DSVHHptVb3Ax6e2XWkNdevPmY4jQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Simone\_Scarduzio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simone_scarduzio/32/17128_2.png) [@Simone\_Scarduzio](https://discuss.elastic.co/u/Simone_Scarduzio)\
**Post date:** [December 7, 2013, 8:36am UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/3 "2013-12-07T08:36:34Z")

</div>

Haha thanks Ivan, did you notice you are also in the README.md as well?  
Will fix the link soon, but once again thank you for taking the time to put  
together the tutorial in the first place!

I have one more question though.  
I'd like to allow indexing from selected hosts (localhost, mainly). I  
didn't find any clear way to do this in the ResFilter.process(RestRequest  
request, RestChannel channel, RestFilterChain filterChain) method. Looks  
like the API is not supporting me in offering the origin IP address. Am I  
missing something?

-Simone

On Friday, December 6, 2013 5:19:55 PM UTC+1, Ivan Brusic wrote:

> Salve Simone,
> 
> Your installation instructions have links to my plugin. 🙂 Otherwise good  
> job.
> 
> --  
> Ivan
> 
> On Fri, Dec 6, 2013 at 6:56 AM, Simone Scarduzio \<[scar...@gmail.com](mailto:scar...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi all,
> > 
> > I'm really new to ES plugin development, but today I wrote my own because  
> > I needed this feature which was not available. All the description is in  
> > the Github page.  
> > All in all, it's a very small RestFilter.  
> > I'm not even sure if I structured the code correctly, so I'd really  
> > appreciate a code review!
> > 
> > Thank you! 🙂
> > 
> > [GitHub - sscarduzio/elasticsearch-readonlyrest-plugin: Free Elasticsearch security plugin and Kibana security plugin: super-easy Kibana multi-tenancy, Encryption, Authentication, Authorization, Auditing](https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin)
> > 
> > -Simone
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/30fceb1a-ceb3-4425-9485-bcdc4c525001%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/30fceb1a-ceb3-4425-9485-bcdc4c525001%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/22e93ef7-95cc-46b3-8e2e-a28c83adcb5e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/22e93ef7-95cc-46b3-8e2e-a28c83adcb5e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 7, 2013, 10:37am UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/4 "2013-12-07T10:37:34Z")

</div>

The ES REST module does not expose Netty channels for examination in a REST  
action.

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHqD-75DscLLb-4DZ%3DuwzHDterTzVdo5CgaED9-dqRJhQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHqD-75DscLLb-4DZ%3DuwzHDterTzVdo5CgaED9-dqRJhQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Simone\_Scarduzio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simone_scarduzio/32/17128_2.png) [@Simone\_Scarduzio](https://discuss.elastic.co/u/Simone_Scarduzio)\
**Post date:** [December 7, 2013, 12:08pm UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/5 "2013-12-07T12:08:37Z")

</div>

Hi Jorg, thanks for quick response.  
I'm curious about the reason behind this design decision.  
Or is it a sort of statement, since I understood that ES team is afraid of bloating the project with security?

-Simone

-Simone

On Saturday, 7 December 2013 at 11:37, [joergprante@gmail.com](mailto:joergprante@gmail.com) wrote:

> The ES REST module does not expose Netty channels for examination in a REST action.
> 
> Jörg
> 
> --  
> You received this message because you are subscribed to a topic in the Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit [https://groups.google.com/d/topic/elasticsearch/IGaKwn5Zosw/unsubscribe](https://groups.google.com/d/topic/elasticsearch/IGaKwn5Zosw/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com) ([mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com)).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHqD-75DscLLb-4DZ%3DuwzHDterTzVdo5CgaED9-dqRJhQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHqD-75DscLLb-4DZ%3DuwzHDterTzVdo5CgaED9-dqRJhQ%40mail.gmail.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/E4BAEADEDC794E979E858BB478B27AC8%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/E4BAEADEDC794E979E858BB478B27AC8%40gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 7, 2013, 4:21pm UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/6 "2013-12-07T16:21:49Z")

</div>

I can't speak for ES core team.

From what I can imagine is that from an architectural view, it would be  
rather unpleasant to have implementation dependent details exposed to  
plugins using ES REST API (here: Netty 3.x socket channels, and Netty seems  
not considering providing socket channel adapters  
[https://github.com/netty/netty/pull/1050](https://github.com/netty/netty/pull/1050) which would ease switching  
implementations without ES REST API change).

Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG244Utip6GinvWqiE8t06tKB%3DM2G16RCXb4yLSvrRLBg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoG244Utip6GinvWqiE8t06tKB%3DM2G16RCXb4yLSvrRLBg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Hendrik](https://avatars.discourse-cdn.com/v4/letter/h/839c29/32.png) [@Hendrik](https://discuss.elastic.co/u/Hendrik)\
**Post date:** [December 7, 2013, 10:48pm UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/7 "2013-12-07T22:48:00Z")

</div>

Hi Simone,

maybe this is interesting for you

> **[GitHub - salyh/elasticsearch-security-plugin: Kerberos, LDAP, Active...](https://github.com/salyh/elasticsearch-security-plugin)**
>
> Kerberos, LDAP, Active Directory, PKI/SSL/TLS and host/ip based ACL coarse-grained and document level security for elasticsearch (Authentication, Authorization, Auth, Spnego, ACL, Mutual authentica...

Am Samstag, 7. Dezember 2013 17:21:49 UTC+1 schrieb Jörg Prante:

> I can't speak for ES core team.
> 
> From what I can imagine is that from an architectural view, it would be  
> rather unpleasant to have implementation dependent details exposed to  
> plugins using ES REST API (here: Netty 3.x socket channels, and Netty seems  
> not considering providing socket channel adapters  
> [Implement socket channel adapter by md-5 · Pull Request #1050 · netty/netty · GitHub](https://github.com/netty/netty/pull/1050) which would ease switching  
> implementations without ES REST API change).
> 
> Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/50fc5225-03db-4860-be07-cd27f82c54b2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/50fc5225-03db-4860-be07-cd27f82c54b2%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Simone\_Scarduzio](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simone_scarduzio/32/17128_2.png) [@Simone\_Scarduzio](https://discuss.elastic.co/u/Simone_Scarduzio)\
**Post date:** [December 8, 2013, 8:53pm UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/8 "2013-12-08T20:53:01Z")

</div>

Hi Hendrik,

I saw that plugin already. I think it's solving a different problem:  
authentication and permissions. What I want to achieve is public  
availability of a subset of the API.  
Another thing I don't want to throw away is the Netty based HTTP stack,  
especially if the alternative is Tomcat!

However, I was bored about the fact I could not have the remote address  
available by ES REST module and I used reflection to obtain just what I  
wanted. I evolved quite a bit my plugin during the weekend. Now supports IP  
address whitelist, reject requests by regular expressions, custom reject  
string and configuration via conf/elasticsearch.yml

> **[GitHub - sscarduzio/elasticsearch-readonlyrest-plugin: Free Elasticsearch...](https://github.com/sscarduzio/elasticsearch-readonlyrest-plugin/)**
>
> Free Elasticsearch security plugin and Kibana security plugin: super-easy Kibana multi-tenancy, Encryption, Authentication, Authorization, Auditing - GitHub - sscarduzio/elasticsearch-readonlyrest-...

Pretty satisfied with the result 🙂

On Saturday, December 7, 2013 11:48:00 PM UTC+1, Hendrik wrote:

> Hi Simone,
> 
> maybe this is interesting for you  
> [GitHub - salyh/elasticsearch-security-plugin: Kerberos, LDAP, Active Directory, PKI/SSL/TLS and host/ip based ACL coarse-grained and document level security for elasticsearch (Authentication, Authorization, Auth, Spnego, ACL, Mutual authentication)](https://github.com/salyh/elasticsearch-security-plugin)
> 
> Am Samstag, 7. Dezember 2013 17:21:49 UTC+1 schrieb Jörg Prante:
> 
> > I can't speak for ES core team.
> > 
> > From what I can imagine is that from an architectural view, it would be  
> > rather unpleasant to have implementation dependent details exposed to  
> > plugins using ES REST API (here: Netty 3.x socket channels, and Netty seems  
> > not considering providing socket channel adapters  
> > [Implement socket channel adapter by md-5 · Pull Request #1050 · netty/netty · GitHub](https://github.com/netty/netty/pull/1050) which would ease switching  
> > implementations without ES REST API change).
> > 
> > Jörg

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e13a7ff6-16e6-4a5c-813d-127ff71666f8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e13a7ff6-16e6-4a5c-813d-127ff71666f8%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:02am UTC](https://discuss.elastic.co/t/new-es-rest-plugin/14751/9 "2017-07-06T02:02:36Z")

</div>


