0

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.

1 Answers1

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