-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Avoid to have infinite recursion in DNS lookups when resolving CNAMEs #4918
Conversation
This will avoid killing Consul when a Service.Address is using CNAME to a Consul CNAME that creates an infinite recursion. This will fix hashicorp#4907
d8349bc
to
c02465a
Compare
Tests do pass while not updated in github UI |
LGTM |
This also improve quite a bit tests stability ;) |
Cool thanks, don't have cycles for this immediately although at a glance it looks like a good fix, I'll put it in our backlog of things to look over properly! |
will also probably fix #4040 |
@pearkes this one will probably allow you closing 2 issues at once and fixes a real bug causing DoS |
@pearkes @mkeeler do you think you might have a look ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me and I can see that it would fix the problem.
One thing to note is that I don't think it would fix a problem where resolving a CNAME points to another external name which then points back to the original name within Consul. I don't think we can mitigate that scenario in Consul but regardless its good to state the limitations of the fix.
@mkeeler you are right, it would not. But resolvers usually have this kind of protection. It however protect Consul itself from crashing |
@mkeeler thank you very much! |
This will avoid killing Consul when a Service.Address is using CNAME
to a Consul CNAME that creates an infinite recursion.
This will fix #4907