Ironman
Ironman

Reputation: 193

How to secure Elasticsearch

I have a Elasticsearch running on my server by default it runs on port 9200 and link is public means any one can insert, update, delete anything form anywhere. How do I make it secure like phpMyadmin which can be only accessed with the help of my code and not directly from browser or postman.

Upvotes: 2

Views: 1043

Answers (3)

uday
uday

Reputation: 142

I have enabled a relatively simple Nginx proxy that sits between my Elasticsearch and Kibana to configure authorized access to my dashboards and charts.

Look at my post here: https://udaysagars.wordpress.com/2016/04/04/how-i-configured-authorized-access-to-kibana-dashboards/

Also, you can view my application that uses this method here: http://udaysagar2177.github.io/ec2/twitter-analytics.html

Upvotes: 0

angadsg
angadsg

Reputation: 184

You can use the Elasticsearch basic authentication plugin - https://github.com/Asquera/elasticsearch-http-basic
The README there gives a good idea on how to set it up.

If you are using Kibana3 as a frontend to elasticsearch, you can secure it using https://github.com/fangli/kibana-authentication-proxy

Upvotes: 2

dejavu013
dejavu013

Reputation: 182

Elasticsearch does not perform authentication or authorization, leaving that as an exercise for the developer. Two popular ways I have seen are

  1. Setup your own proxy (Nginx/HAProxy) fronting elasticsearch - this way you exercise full control. You can also use the Elasticsearch-jetty plugin to have jetty level auth
  2. Shield - If budget permits use Shield which is a paid offering from Elasticsearch - https://www.elastic.co/products/shield

Even with these in place, depending on who you are exposing this to - you may want to disable certain things like dynamic scripting, throttles for DoS etc.

Upvotes: 5

Related Questions