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

RFE: Retry fetching of trust anchor for DNSSEC validation #408

Closed
jonathanunderwood opened this issue Oct 1, 2018 · 9 comments
Closed

Comments

@jonathanunderwood
Copy link

Currently stubby tries to retrieve a trust anchor on startup. If that fails, stubby gives up on DNSSEC validation. This can be problematic if stubby is started before the wan connection is fully up. In OpenWRT we work around this by using triggers. But it would b better if stubby would try to retrieve the trust anchor ahead of subsequent lookups, otherwise stubby will be silently not validating, and the user could be misled as to the validity of the returned records.

This was discussed here, and @saradickinson recommended raising an issue here for the attention of @wtoorop .

@wtoorop
Copy link
Contributor

wtoorop commented Oct 2, 2018

Acknowledged.

Failure of fetching the trust anchor results in context->trust_anchors_source to get value GETDNS_TASRC_FAILED (on lines 925 and 1589 of anchor.c).

This will prevent fetching, because context->trust_anchors_source needs to be GETDNS_TASRC_NONE (or GETDNS_TASRC_XML_UPDATE) before a fetching will start (see from line 594 in general.c).

One way around this might be to register the time when context->trust_anchors_source is set to GETDNS_TASRC_FAILED (in anchor.c) and then in general.c start fetching anyway when the failure was more than a configurable back off period.

@jonathanunderwood
Copy link
Author

I'm sure this thinking is faulty, but I'll ask anyway: If I've configured stubby to require dnssec validation, wouldn't I expect to get SERVFAIL until the trust anchor is in place? IOW, to me, it seems surprising to ever get non-validated responses from stubby if I've configured stubby to validate. What am I missing?

@saradickinson
Copy link
Contributor

The DNSSEC configuration is quite subtle and I can see why this leads to confusion fo users. None of the current settings do what you want (hard fail if I DNSSEC is configured but stubby can't fetch the trust anchor - I've talked to @wtoorop and agreed we need a new option for this and much better logging of the failure mode).

Have a read of this section of the API:
https://getdnsapi.net/documentation/spec/#31-extensions-for-dnssec

Stubby only SERVFAILS if the answer is BOGUS, without a trust anchor I believe everything comes back INDETERMINATE....

wtoorop added a commit that referenced this issue Nov 30, 2018
When this extension is set, GETDNS_DNSSEC_INDETERMINATE status will no
longer be returned.
@wtoorop
Copy link
Contributor

wtoorop commented Dec 31, 2018

It's in 1.5.0

@wtoorop wtoorop closed this as completed Dec 31, 2018
@jonathanunderwood
Copy link
Author

As far as I can see, the backoff time isn't exposed via the Stubby configuration, is it?

@wtoorop
Copy link
Contributor

wtoorop commented Jan 3, 2019

It should be, because stubby uses the getdns_context_config() function under the hood.

@wtoorop
Copy link
Contributor

wtoorop commented Jan 3, 2019

Just tested it and it works. I updated the example configuration file with an example: getdnsapi/stubby@006e43fd .

@jonathanunderwood
Copy link
Author

Great, thanks. I guess the same thing applies to the new TLS options as well?

@wtoorop
Copy link
Contributor

wtoorop commented Jan 4, 2019

Yes, I'll add those to the example config file as well (as you requested in getdnsapi/stubby#148 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants