Actual resolution of the DNS zone name in Lexicon-based DNS plugins#9838
Open
adferrand wants to merge 7 commits intocertbot:mainfrom
Open
Actual resolution of the DNS zone name in Lexicon-based DNS plugins#9838adferrand wants to merge 7 commits intocertbot:mainfrom
adferrand wants to merge 7 commits intocertbot:mainfrom
Conversation
3 tasks
21525e0 to
e51333f
Compare
|
Hi, are you please going to continue with this PR? Lexicon-based tests are failing again in my project and I am hoping for this PR to fix it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First, let's recap the situation this PR and the code it replaces is meant to handle.
There is a tricky corner case to manage in DNS-01 challenges: the issuance of certificates for third-level or more domains (eg.
sub.domain.net). Indeed given that a DNS-01 challenge is supposed to create a TXT record on the `_acme_challenge.sub.domain.net FQDN, the acme client has to determine if:_acme_challenge.subhas to be created in the DNS zonedomain.net(usual case)_acme_challengehas to be created in the DNS zonesub.domain.netbecause the DNS zonedomain.netdeclares a domain delegation forsub.domain.net.The current approach in Lexicon-based DNS plugins is to basically try recursively to setup the underlying Lexicon client on an theoritical DNS zone
sub.domain.net, thendomain.net, thennet. The first zone where the authentication does not fail is selected as the actual DNS zone to operator.This works, but it has several drawbacks:
Until recently Lexicon had a similar limitation with third-level or more domains, and needed an additional configuration parameter,
delegatedto instruct it of the actual DNS zone if its name was not a second-level domain.Since version
3.17.0, I have introduced a proper resolution of the DNS zone for a given FQDN on which the record should be created. This is enabled by the boolean configuration parameterresolve_zone_name, and it leverages the methoddns.resolver.zone_for_namefromdnspython.This PR raises the requirement of Lexicon to
3.17.0and leverage this mechanic in the recent base authenticator classLexiconDNSAuthenticatorintroduced by #9746. As a consequence, the workaround introduced by #9821 is not needed anymore. I also removed the tests related the recursion of authentication attempts.Please note that I do not change the behavior for the old base classes, considering that the plugins in the community have to migrate anyway as part of the plan described in #9776, and so would benefit of this improvment as part of the migration process. Please not also that this PR do not change the existing functionality and so do not manage resolution of CNAMEs. This would not have its place in Lexicon, since it is just a DNS utility. In my opinion resolution of CNAMEs is part of the DNS-01 challenge strategies and should be taken care by the acme client (I do that in
dnsrobocertfor instance).