Restricting Connections with IP Filteringedit

You can apply IP filtering to application clients, node clients, or transport clients, in addition to other nodes that are attempting to join the cluster.

If a node’s IP address is on the blacklist, X-Pack security will still allow the connection to Elasticsearch, but it will be dropped immediately, and no requests will be processed.

Elasticsearch installations are not designed to be publicly accessible over the Internet. IP Filtering and the other security capabilities of X-Pack security do not change this condition.

Enabling IP filteringedit

X-Pack security features an access control feature that allows or rejects hosts, domains, or subnets.

You configure IP filtering by specifying the and settings in in elasticsearch.yml. Allow rules take precedence over the deny rules. "" ""

The _all keyword can be used to deny all connections that are not explicitly allowed. [ "", "", "", "" ] _all

IP filtering configuration also support IPv6 addresses. "2001:0db8:1234::/48" "1234:0db8:85a3:0000:0000:8a2e:0370:7334"

You can also filter by hostnames when DNS lookups are available. localhost '*'

Disabling IP Filteringedit

Disabling IP filtering can slightly improve performance under some conditions. To disable IP filtering entirely, set the value of the setting in the elasticsearch.yml configuration file to false. false

You can also disable IP filtering for the transport protocol but enable it for HTTP only. false true

Specifying TCP transport profilesedit

TCP transport profiles enable Elasticsearch to bind on multiple hosts. X-Pack security enables you to apply different IP filtering on different profiles. _all _all

When you do not specify a profile, default is used automatically.

HTTP Filteringedit

You may want to have different IP filtering for the transport and HTTP protocols. localhost '*' _all

Dynamically updating ip filter settingsedit

In case of running in an environment with highly dynamic IP addresses like cloud based hosting, it is very hard to know the IP addresses upfront when provisioning a machine. Instead of changing the configuration file and restarting the node, you can use the Cluster Update Settings API. For example:

curl -XPUT localhost:9200/_cluster/settings -d '{
    "persistent" : {
        "" : ""

You can also dynamically disable filtering completely:

curl -XPUT localhost:9200/_cluster/settings -d '{
    "persistent" : {
        "" : false

In order to avoid locking yourself out of the cluster, the default bound transport address will never be denied. This means you can always SSH into a system and use curl to apply changes.