I have an elasicsearch instance running on my server. I have to configure it in such a way that it's only accessible via my local computer's public IP. I tried changing network.host:
to my local IP but its not working. can anyone tell me what m I doing wrong.
Asked
Active
Viewed 163 times
0

Tushar Chevulkar
- 21
- 1
- 4
-
you are looking at netowork.host in a wrong way. Read http://stackoverflow.com/questions/42019852/how-do-i-enable-remote-access-in-elasticsearch-5-2-0-from-selected-devices-compu/42020369#42020369 – user3775217 Mar 07 '17 at 07:27
-
So is there any way that I can achieve what I want ? – Tushar Chevulkar Mar 07 '17 at 07:48
-
you want to secure it only to access your IP or you just want to enable remote access ? – user3775217 Mar 07 '17 at 07:59
-
only my local computer should be allowed. – Tushar Chevulkar Mar 07 '17 at 20:01
-
@TusharChevulkar: On your server this is a job of a firewall or iptables rules, which denies all traffic from anywhere, but allows from your client ip-address. – cinhtau Mar 07 '17 at 20:34
1 Answers
1
Then i can suggest you two things here.
1) Either you put nginx reverse proxy in front of your elasticsearch server and filter the ip address you want to allow to connect elasticsearch.
In nginx.conf file in /usr/local/nginx/conf/ , for more info
location / {
# block one workstation
deny 192.168.1.1;
# allow anyone in 192.168.1.0/24
allow 192.168.1.0/24;
# drop rest of the world
deny all;
}
2) Or you can use elastic shield plugin which comes with X-pack and you can use IP filtering feature to restrict the access to your elasticcluster.
In elasticsearch.yml file
shield.transport.filter.allow: "192.168.0.1"
shield.transport.filter.deny: "192.168.0.0/24"
Also you can edit these settings using their REST api
curl -XPUT localhost:9200/_cluster/settings -d '{
"persistent" : {
"shield.transport.filter.allow" : "172.16.0.0/24"
}
}'
read more here. Thanks

user3775217
- 4,675
- 1
- 22
- 33