-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Listen peer URLs accepts domain names incorrectly #6336
Comments
I tried to reproduce this on my machine:
From the log, etcd seems to be reporting a DNS error (oddly, it is not "no such host") and terminating:
However, etcd then restarts and can suddenly listen:
What's going on with your DNS? |
@heyitsanthony it's just an A record pointing to 172.17.0.21 from my dnsmasq. |
OK, I see. You're right there's no validation that it's not a domain name. Some cursory googling shows that some people rely on this behavior though. Is there a reason not to support binding to a domain name so long as the resolved IP is available for binding? /cc @xiang90 |
@heyitsanthony it just seems...wrong to me. You don't "bind" to domain names. You bind to an interface, so if its doing dns queries to "figure out" its IP and bind to that, that just seems way too magic and way too likely to be incorrect in practice. Imagine if the domain name is pointing to the IP of your load balancer, it would cause etcd to incorrectly try to bind using an IP it doesn't have, which seems like a bad thing. Also: this feels like a potential exploitation avenue, maybe @gtank has feelings on that though. This has always been documented this way, so I don't think breaking people is a huge concern IMO as its been documented this way for a long time. I know this because I was the one who pushed for the docs to explicitly call this out. I'm a bit curious if this ever got validated though..I recall when I asked for the docs to explicitly call out IPs only, that there was code to validate it,..but i might be imagining things. While I don't think this a feature etcd needs/should have, even if it was entirely a reasonable feature it probably shouldn't be allowed by default. If you wanted this to be a feature, it should be behind another option.. like |
Since etcd is security-relevant to several projects, we probably should err on the side of not letting a DNS compromise escalate (for example) to control of a Kubernetes cluster. If there's a user need for this exposure we can think through it again, but if there isn't then why not eliminate the risk? |
We should revert #6365. We can make a security note about using DNS in our docs but we just broke existing users without any transition or documentation updates. |
@hongchaodeng do you have a link to the kubernetes upstream issue? |
Here's my opinion: |
@heyitsanthony Probably we shall print out security warning to start with? |
@xiang90 no one is going to pay attention to those warnings. Let's just revert in 3.0 and do the full change in 3.1? If it's serious enough to warrant a lock out, I don't think it makes sense to bother with a warning. |
@heyitsanthony OK. Let's revert this for now. We can discuss about how to "fix" this later. |
Move this to 3.2. We only print our warning and communicate we are going to do this in 3.1 for compatibility and ux reasons. |
Address etcd-io#6336 (comment) about etcd-io#7236. Signed-off-by: Gyuho Lee <[email protected]>
Address etcd-io#6336 (comment) about etcd-io#7236. Signed-off-by: Gyuho Lee <[email protected]>
longer use dns-names see etcd-io/etcd#6336
From the docs: https://github.com/coreos/etcd/blob/master/Documentation/op-guide/configuration.md#--listen-peer-urls etcd should not allow domain names in listen-peer-urls, but I'm finding that it does.
I don't actually know if this causes any problems, but it seems like it shouldn't be allowed regardless if it does work.
Unfortunately, this was found in my setup of etcd 2.3.2 so I didn't test with 3.0.0 nor 2.3.7 since neither are included in the CoreOS image and I didn't have time to check if this is true of the latest releases. However, I believe it does work, as @dghubble's examples in coreos-baremetal set up etcd using the domain name as peer URLs, which he says has been working.
My etcd2.service is located in the gist along with logs. As you can see, I'm getting no validation errors, and etcd proudly proclaims it's listening on a domain name + port.
https://gist.github.com/chancez/2b97ae9d2b0c225e98ac964e740f27bd
The text was updated successfully, but these errors were encountered: