Skip to content
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

nixos/security/acme: Add DNS resolver option #99948

Merged
merged 1 commit into from Oct 7, 2020
Merged

nixos/security/acme: Add DNS resolver option #99948

merged 1 commit into from Oct 7, 2020

Conversation

jsimonetti
Copy link
Contributor

Motivation for this change

When using the ACME DNS-01 challenge, there is a possibility of a
failure to resolve the challenge if the record is not propagated
fast enough. To circumvent this generic DNS problem, this adds
a setting to explicitly tell the ACME provider to use a certain DNS
resolver to lookup the challenge.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • [ X ] NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • [ X ] Fits CONTRIBUTING.md.

When using the ACME DNS-01 challenge, there is a possibility of a
failure to resolve the challenge if the record is not propagated
fast enough. To circumvent this generic DNS problem, this adds
a setting to explicitly tell the ACME provider to use a certain DNS
resolver to lookup the challenge.

Signed-off-by: Jeroen Simonetti <jeroen@simonetti.nl>
@andir
Copy link
Member

andir commented Oct 7, 2020

Thanks for this PR!

Do you have some details on how the issue did surface for you? Just yesterday I filed a PR that fixed a race of ACME with local resolvers (#99901). Could this maybe also fix your issue?

That being said, there is no reason not to support the option you are proposing.

Overall 👍 to this.

@jsimonetti
Copy link
Contributor Author

jsimonetti commented Oct 7, 2020

Hi @andir
I encountered this when using DNS-01 with cloudflare as the DNS provider. If I did not use their 1.1.1.1 server as resolver, the request for the challenge would fail on the letsencrypt end. I only recently changed from a docker based setup to using the acme nix module.
I have seen this same behaviour on the docker setup I had and other linux machines too and adding the specific option resolved it there also. This leads me to believe it has something to do with the DNS propagation being slow either with letsencrypt or cloudflare and nothing with the module itself.

I can't really comment on the unbound issue, as I do not use that.

@andir
Copy link
Member

andir commented Oct 7, 2020

Interesting. This looks good to me. Let us see what the @NixOS/acme team thinks about this.

Copy link
Contributor

@m1cr0man m1cr0man left a comment

Choose a reason for hiding this comment

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

This looks good! dnsResolver is a good name for the argument. I don't think we need any extra tests for this.

@andir andir merged commit 9cc924a into NixOS:master Oct 7, 2020
@jsimonetti jsimonetti deleted the acme-dnsresolver branch October 7, 2020 14:12
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.

None yet

5 participants