Repository navigation
DANE Server Authentication
tlshd can authenticate an RPC-with-TLS server with DNS-Based Authentication of Named Entities (DANE, RFC 6698) in place of, or in addition to, a PKIX chain of trust. The support shipped in ktls-utils 1.5.0 and is disabled by default.
The design is not recorded on this wiki. It is the subject of an Internet-Draft, which carries the rationale for every decision the implementation makes and is the document to read before changing the code:
- Using RPC-with-TLS with DNS-Based Authentication of Named Entities (draft-cel-nfsv4-rpc-tls-dane)
The draft's Implementation Status section describes what tlshd covers and what it does not, in terms of the draft's own sections.
The code lives in src/tlshd/dane.c and hooks both client handshake paths, the client-anonymous one and the mutually authenticated one. For each client handshake it:
- derives the reference name from the peer name the kernel supplied, and refuses to use a name that came from a reverse DNS lookup;
- queries the TLSA RRset with libunbound, using a local DNSSEC trust anchor, and expands secure CNAME chains;
- classifies the DNS outcome into one of five classes, and treats a lookup error as a failure rather than as permission to fall back to PKIX;
- filters the usable records and applies digest algorithm agility in its own code, so the classification does not depend on the TLS library's DANE internals;
- matches the server certificate against the selected TLSA records with GnuTLS's raw DANE verification interface, checking both the return value and the verification status word;
- logs an audit record for each evaluation.
Only certificate usage DANE-EE(3) is implemented in this round.
Two options in tlshd.conf(5) control it. dane selects the policy for client handshakes: off (the default), opportunistic, which uses a validated TLSA RRset when one is published and PKIX otherwise, or require, which fails the handshake unless DANE governs it. dane.trust_anchor names the DNSSEC root trust anchor file; without it tlshd tries the locations that common distributions use. The man page has the details.
The policy applies to every client handshake, because the handshake netlink protocol does not yet carry a per-handshake policy. Letting a kernel consumer name its own policy, and enforcing the draft's association-scope rules, are kernel work that has not been started.
DANE support needs gnutls-dane and libunbound at build time. configure enables it when it finds both. --with-dane makes a missing dependency a configuration error, and --without-dane skips the check. A build without DANE accepts dane off and refuses to start with any other setting. The README lists the package names for Fedora and Debian.
- Certificate usage DANE-TA(2).
- DTLS.
- Server-side and mutual-TLS DANE, which the DANCE working group's client-authentication profile would cover.
- NVMe/TCP, whose transport specification uses pre-shared keys only.
- The kernel side: a per-handshake policy in the netlink protocol, and the association-scope enforcement that belongs to the RPC client rather than to the handshake agent.
The implementation was exercised against public DANE test zones and a locally signed zone. The public zones at dane.huque.com cover a matching record, a record with a bad hash, secure CNAME expansion, and a secure-but-unusable RRset. dnssec-failed.org exercises the lookup error path.