mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2194] [RFC] DNSSEC validation: configuration syntax #914
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#914
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @japaric on GitHub (Apr 24, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2194
Motivation
Currently, the recursive resolver (AKA "recursor") component of the
hickory-dnsbinary has DNSSEC validation disabled and cannot be enabled through its configuration options.We want to be able to enable DNSSEC validation in the resolver.
Use cases
We want to support these use cases:
and when DNSSEC validation is enabled we have these sub- use cases:
Prior art
unboundTo enable DNSSEC validation and use an externally-managed trust anchor, one has to set the
server.trust-anchor-filesetting to the path to the trust anchor fileTo enable DNSSEC validation and use a self-managed (RFC5011) trust anchor, one has to set the
server.auto-trust-anchor-filesetting to the path to an initial trust anchor fileAn initial trust anchor file can be generated using the
unbound-anchortool.More details about
auto-trust-anchor-fileandunbound-anchorcan be found in https://nlnetlabs.nl/documentation/unbound/howto-anchor/In both cases, the syntax of the trust anchor file is a newline-separated list of DNS records:
BIND (
named)named's configuration syntax is more complex. In thenamed.conffile, DNSSEC validation can be enabled / disabled using theoptions.dnssec-validationoption:The trust anchor is configured in the file
/etc/bind/bind.keys, which uses BIND-specific syntax instead of the DNS record syntax.The
static-keycolumn indicates whether the key is externally managed (static-key) or managed according to RFC5011 (initial-key).Current state
The recursive resolver component is enabled and configured using a
[[zones]]section that looks like this:Where the
storesentry corresponds toRecursiveConfigwhentypeisrecursor.Proposal
Although
hickory-dnsconfiguration file is modeled after (BIND)named's configuration file, I would propose using a configuration syntax closer tounbound's. Namely, adding these two fields toRecursiveConfigtrust_anchor_filerfc5011None_Some(_)falsetrust_anchor_fileis static keySome(_)truetrust_anchor_fileis initial keyThe syntax of the trust anchor file will be a newline-separated list of DNS records, either DS or DNSKEY records
This proposal can be implemented incrementally. We can add only
trust_anchor_filefirst and only support static keys. We can then addrfc5011when RFC5011 is implemented (if we want to implement it).Alternatives
If we foresee supporting different trust anchor management strategies we could use a single
enumfield instead of an extra boolean field. Something like this:@djc commented on GitHub (Apr 24, 2024):
How does
DnssecValidationget represented in TOML? I like that the enum approach is more explicit.@japaric commented on GitHub (Apr 24, 2024):
to use an
enumwithserde/tomlwe need to give pick a name for the tag field that will hold the enum variant name.if we give the tag the name "mode" then the TOML would look like this
@djc commented on GitHub (Apr 25, 2024):
That looks good to me.
@japaric commented on GitHub (May 13, 2024):
given that we added a
security_awaresetting in #2196 we need to consider its interaction withdnssec_validation. to performdnssec_validation, the recursor needs to besecurity_awareso we have a few options to represent these two settintgs:one way is to keep the
security_awareboolean next to thednssec_validationenum we discussed, i.e.in this case
security_aware: false+DnssecValidation::{InitialKey,StaticKey}should be rejected with an error.and possibly we'll want to accept this configuration
where the omitted
security_awareis understood to betrueeven though normally it defaults totruethe other set of options are to turn
security_awareinto an enum that wrapsDnssecValidation.or use a "flatter" representation with a single enum that captures the 4 cases.
both of these options don't allow "impossible" configurations (e.g.
security_aware: false+DnssecValidation::InitialKey) that need to be linted for after the serde deserialization@djc commented on GitHub (May 13, 2024):
I think I prefer the flatter representation.
Can you be explicit about what the difference is between security awareness and validation? In particular, being security aware without validating seems like a strange proposition.
@japaric commented on GitHub (May 13, 2024):
in practice, being a non-validating, security-aware, recursive resolver means that the DO (DNSSEC_OK) flag in client queries is respected, meaning that the response to the client will include DNSSEC data. This lets the client do the validation on its own, like
delvdoes.A validating (which implies also being security-aware) recursive resolver can be forced into behaving as a non-validating one by setting the CD (Checking Disabled) flag in the client's query.
Finally, a security-unaware, recursive resolver will ignore the DO flag in client queries and never report DNSSEC data back.
unboundand BIND, at least as packaged in Debian, are always security-aware but DNSSEC validation is opt-in.@djc commented on GitHub (May 14, 2024):
Makes sense, thanks for the explanation! I think conveying similar context via comments in the configuration/implementation etc would be helpful.
@bluejekyll commented on GitHub (May 18, 2024):
I like this suggestion. Right now we compile in the trust-anchors, from here:
github.com/hickory-dns/hickory-dns@ede83dc7d6/crates/proto/src/rr/dnssec/trust_anchor.rs (L23-L24)I think we might want to continue supporting that in addition to any future support for the RFC5011 standard. I don't think I see that as an option in your list...
@japaric commented on GitHub (May 22, 2024):
the
InitialKeyvariant (of theDnssecenum) corresponds to RFC5011. BIND uses theinitial-keyproperty (key?) in its settings to configure an initial key that's used to implement RFC5011.I'm not sure if BIND or unbound hard-code a trust anchor in their source but the
bind9(Debian) package includes the file/etc/bind/bind.keys, which configures key 20326 (from 2017) as an "initial-key"; that is the trust anchor is provided in a separate file, not as part of the binary.If we want to support a trust anchor built into the
hickory-dnsbinary we could convert thefilefield in theInitialKeyandStaticKeyvariants into anOption<PathBuf>where theNonevariant means "use the built-in trust anchor".@bluejekyll commented on GitHub (May 22, 2024):
I like the built-in keys as it makes the key management simpler for initializing those roots.
@japaric commented on GitHub (Jun 18, 2024):
update here: as I'm implementing this RFC I realized
hickory-dnsis using thebasic-tomlcrate which does not support serializing nor deserializingenumvariants that have fields like the ones (Dnssec) we want to use here. thetomlcrate does support suchenums so I'll use thetomlcrate in an initial implementation. we can discuss if we want to switch totomlor change the layout ofDnssec