# Can i make elastic search read only? or to accept only GET methods?

**URL:** <https://discuss.elastic.co/t/can-i-make-elastic-search-read-only-or-to-accept-only-get-methods/7432>\
**Category:** Elasticsearch\
**Created:** [April 22, 2012, 1:07am UTC](https://discuss.elastic.co/t/can-i-make-elastic-search-read-only-or-to-accept-only-get-methods/7432 "2012-04-22T01:07:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas\_melendez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicolas_melendez/32/2908_2.png) [@nicolas\_melendez](https://discuss.elastic.co/u/nicolas_melendez)\
**Post date:** [April 22, 2012, 1:07am UTC](https://discuss.elastic.co/t/can-i-make-elastic-search-read-only-or-to-accept-only-get-methods/7432/1 "2012-04-22T01:07:02Z")

</div>

Hi there,  
i want to add data to elastic search and then make it read only. can  
it be possible?  
maybe only accep GET method or maybe somewhere there is a flag or  
something?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Mohit\_Chawla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohit_chawla/32/2243_2.png) [@Mohit\_Chawla](https://discuss.elastic.co/u/Mohit_Chawla)\
**Post date:** [April 22, 2012, 4:26am UTC](https://discuss.elastic.co/t/can-i-make-elastic-search-read-only-or-to-accept-only-get-methods/7432/2 "2012-04-22T04:26:55Z")

</div>

Hi,

On Sun, Apr 22, 2012 at 6:37 AM, nicolas melendez [nfmelendez@gmail.com](mailto:nfmelendez@gmail.com) wrote:

> Hi there,  
> i want to add data to Elasticsearch and then make it read only. can  
> it be possible?  
> maybe only accep GET method or maybe somewhere there is a flag or  
> something?

See the index.blocks.read\_only setting here :

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

---

<div class="post-metadata">

**Author:** ![nicolas\_melendez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nicolas_melendez/32/2908_2.png) [@nicolas\_melendez](https://discuss.elastic.co/u/nicolas_melendez)\
**Post date:** [April 22, 2012, 11:39am UTC](https://discuss.elastic.co/t/can-i-make-elastic-search-read-only-or-to-accept-only-get-methods/7432/3 "2012-04-22T11:39:42Z")

</div>

index.blocks.read\_only can be useful to present Elasticsearch as a public  
data read only service?  
i want to use it for an open government initiative in Buenos Aires and i  
like very much the raw Elasticsearch rest service.  
Thanks

On Sun, Apr 22, 2012 at 1:26 AM, Mohit Chawla \<[mohit.chawla.binary@gmail.com](mailto:mohit.chawla.binary@gmail.com)

> wrote:

> Hi,
> 
> On Sun, Apr 22, 2012 at 6:37 AM, nicolas melendez [nfmelendez@gmail.com](mailto:nfmelendez@gmail.com)  
> wrote:
> 
> > Hi there,  
> > i want to add data to Elasticsearch and then make it read only. can  
> > it be possible?  
> > maybe only accep GET method or maybe somewhere there is a flag or  
> > something?
> 
> See the index.blocks.read\_only setting here :
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html)

--  
_NM_  
_Nicolás Meléndez_  
_blog.melendez.com.ar [http://blog.melendez.com.ar](http://blog.melendez.com.ar)_

"P_eople over processes"_  
"Working Software over documentation"  
"Responding to change over following a plan"

Cell: +54 9 1157535454  
Twitter: @nfmelendez  
Skype: nfmelendez

\*Personal Site \*  
[http://www.melendez.com.ar](http://www.melendez.com.ar)

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 23, 2012, 4:04pm UTC](https://discuss.elastic.co/t/can-i-make-elastic-search-read-only-or-to-accept-only-get-methods/7432/4 "2012-04-23T16:04:53Z")

</div>

I think it's not a good idea. Theoretically, it's possible to turn off  
dynamic script execution and prohibit all requests except GET search  
requests using filtering reverse proxy or elasticsearch-jetty plugin.  
However, you are still exposing yourself to possible denial of service  
attacks. Elasticsearch provides extremely powerful query mechanism, which  
also allows creation of long-running queries that consume a lot of memory  
if you have an index of non-trivial size. I think you would want to have  
full control over the types of queries that users are allowed to send to  
elasticsearch.

On Sunday, April 22, 2012 7:39:42 AM UTC-4, nicolas melendez wrote:

> index.blocks.read\_only can be useful to present Elasticsearch as a  
> public data read only service?  
> i want to use it for an open government initiative in Buenos Aires and i  
> like very much the raw Elasticsearch rest service.  
> Thanks
> 
> On Sun, Apr 22, 2012 at 1:26 AM, Mohit Chawla \<  
> [mohit.chawla.binary@gmail.com](mailto:mohit.chawla.binary@gmail.com)\> wrote:
> 
> > Hi,
> > 
> > On Sun, Apr 22, 2012 at 6:37 AM, nicolas melendez [nfmelendez@gmail.com](mailto:nfmelendez@gmail.com)  
> > wrote:
> > 
> > > Hi there,  
> > > i want to add data to Elasticsearch and then make it read only. can  
> > > it be possible?  
> > > maybe only accep GET method or maybe somewhere there is a flag or  
> > > something?
> > 
> > See the index.blocks.read\_only setting here :
> > 
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html)
> 
> --  
> _NM_  
> _Nicolás Meléndez_  
> _blog.melendez.com.ar [http://blog.melendez.com.ar](http://blog.melendez.com.ar)_
> 
> "P_eople over processes"_  
> "Working Software over documentation"  
> "Responding to change over following a plan"
> 
> Cell: +54 9 1157535454  
> Twitter: @nfmelendez  
> Skype: nfmelendez
> 
> \*Personal Site \*  
> [http://www.melendez.com.ar](http://www.melendez.com.ar)

---

<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, 3:31am UTC](https://discuss.elastic.co/t/can-i-make-elastic-search-read-only-or-to-accept-only-get-methods/7432/5 "2017-07-06T03:31:20Z")

</div>


