Skip to content

Conversation

@jasontedor
Copy link
Member

When a security manager is present, the JVM will cache positive hostname lookups indefinitely. This can be problematic, especially in the modern world with cloud services where DNS addresses can change, or environments using Docker containers where IP addresses could be considered ephemeral. This behavior impacts cluster discovery, cross-cluster replication and cross-cluster search, reindex from remote, snapshot repositories, webhooks in Watcher, external authentication mechanisms, and the Elastic Stack Monitoring Service. The experience of watching a DNS lookup change yet not be reflected within Elasticsearch is a poor experience for users. The reason the JVM has this is guard against DNS cache posioning attacks. Yet, there is already a defense in the modern world against such attacks: TLS. With proper certificate validation, even if a resolver falls prey to a DNS cache poisoning attack, using TLS would neuter the attack. Therefore we have a policy with dubious security value that significantly impacts usability. As such we make the usability/security tradeoff towards usability, since the security risks are very low. This commit introduces new system properties that Elasticsearch observes to override the JVM DNS cache policy.

When a security manager is present, the JVM will cache positive hostname
lookups indefinitely. This can be problematic, especially in the modern
world with cloud services where DNS addresses can change, or
environments using Docker containers where IP addresses could be
considered ephemeral. This behavior impacts cluster discovery,
cross-cluster replication and cross-cluster search, reindex from remote,
snapshot repositories, webhooks in Watcher, external authentication
mechanisms, and the Elastic Stack Monitoring Service. The experience of
watching a DNS lookup change yet not be reflected within Elasticsearch
is a poor experience for users. The reason the JVM has this is guard
against DNS cache posioning attacks. Yet, there is already a defense in
the modern world against such attacks: TLS. With proper certificate
validation, even if a resolver falls prey to a DNS cache poisoning
attack, using TLS would neuter the attack. Therefore we have a policy
with dubious security value that significantly impacts usability. As
such we make the usability/security tradeoff towards usability, since
the security risks are very low. This commit introduces new system
properties that Elasticsearch observes to override the JVM DNS cache
policy.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@jasontedor
Copy link
Member Author

@elasticmachine run gradle build tests 1

Copy link
Member

@pickypg pickypg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasontedor
Copy link
Member Author

@elasticmachine run gradle build tests 1
@elasticmachine run gradle build tests 2

@jasontedor
Copy link
Member Author

@elasticmachine test this please

@jasontedor jasontedor merged commit 2afa7fa into elastic:master Dec 13, 2018
jasontedor added a commit that referenced this pull request Dec 13, 2018
When a security manager is present, the JVM will cache positive hostname
lookups indefinitely. This can be problematic, especially in the modern
world with cloud services where DNS addresses can change, or
environments using Docker containers where IP addresses could be
considered ephemeral. This behavior impacts cluster discovery,
cross-cluster replication and cross-cluster search, reindex from remote,
snapshot repositories, webhooks in Watcher, external authentication
mechanisms, and the Elastic Stack Monitoring Service. The experience of
watching a DNS lookup change yet not be reflected within Elasticsearch
is a poor experience for users. The reason the JVM has this is guard
against DNS cache posioning attacks. Yet, there is already a defense in
the modern world against such attacks: TLS. With proper certificate
validation, even if a resolver falls prey to a DNS cache poisoning
attack, using TLS would neuter the attack. Therefore we have a policy
with dubious security value that significantly impacts usability. As
such we make the usability/security tradeoff towards usability, since
the security risks are very low. This commit introduces new system
properties that Elasticsearch observes to override the JVM DNS cache
policy.
@jasontedor jasontedor deleted the override-dns-cache-policy branch December 13, 2018 16:08
@jasontedor
Copy link
Member Author

Thanks for reviewing @pickypg and @spinscale.

sebgl added a commit to sebgl/cloud-on-k8s that referenced this pull request Jun 10, 2019
Since we only support Elasticsearch 6.8+ and 7.1+, we have the following
commit already there in Elasticsearch:
elastic/elasticsearch#36570.

Hence we do not need to duplicate the fix manually into our own JVM
security options file.

Since there is now no need for this "default config map" volume in the
pod (only used for the jvm security options file so far), this commit
also removes it.
sebgl added a commit to elastic/cloud-on-k8s that referenced this pull request Jun 10, 2019
* Remove JVM DNS cache policy tweaks

Since we only support Elasticsearch 6.8+ and 7.1+, we have the following
commit already there in Elasticsearch:
elastic/elasticsearch#36570.

Hence we do not need to duplicate the fix manually into our own JVM
security options file.

Since there is now no need for this "default config map" volume in the
pod (only used for the jvm security options file so far), this commit
also removes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants