<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-vandijk-dprive-ds-dot-signal-and-pin-00" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" consensus="true">

<front>
<title abbrev="ds-dot-signal-and-pin">Signalling Authoritative DoT support in DS records, with key pinning</title><seriesInfo value="draft-vandijk-dprive-ds-dot-signal-and-pin-00" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="P." surname="van Dijk" fullname="Peter van Dijk"><organization>PowerDNS</organization><address><postal><street></street>
<city>Den Haag</city>
<country>Netherlands</country>
</postal><email>peter.van.dijk@powerdns.com</email>
</address></author>
<author initials="R." surname="Geuze" fullname="Robin Geuze"><organization>TransIP</organization><address><postal><street></street>
<city>Delft</city>
<country>Netherlands</country>
</postal><email>robing@transip.nl</email>
</address></author>
<author initials="E." surname="Bretelle" fullname="Emmanuel Bretelle"><organization>Facebook</organization><address><postal><street></street>
</postal><email>chantra@fb.com</email>
</address></author>
<date/>
<area>General</area>
<workgroup>dprive</workgroup>
<keyword>Internet-Draft</keyword>

<abstract>
<t>This document specifies a way to signal the usage of DoT, and the pinned keys for that DoT usage, in authoritative servers.
This signal lives on the parent side of delegations, in DS records.
To ensure easy deployment, the signal is defined in terms of (C)DNSKEY.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>Even quite recently, DNS was a completely unencrypted protocol, with no protection against snooping.
In the past few years, this landscape has shifted.
The connections between stubs and resolvers are now often protected by DoT, DoH, or other protocols that provide privacy.</t>
<t>This document introduces a way to signal, from the parent side of a delegation, that the name servers hosting the delegated zone support DoT, and with which TLS/X.509 keys.
This proposal does not require any changes in authoritative name servers, other than (possibly through an external process) actually offering DoT on port 853 <xref target="RFC7858"></xref>.
DNS registry operators (such as TLD operators) also need to make no changes, unless they filter uploaded DNSKEY/DS records on acceptable DNSKEY algorithms, in which case they would need to add algorithm TBD to that list.</t>
<t>This document was inspired by, and borrows heavily from, <xref target="I-D.bretelle-dprive-dot-for-insecure-delegations"></xref>.</t>
</section>

<section anchor="document-work"><name>Document work</name>
<t>This document lives <eref target="https://github.com/PowerDNS/parent-signals-dot/blob/master/draft-vandijk-dprive-ds-dot-signal-and-pin/draft-vandijk-dprive-ds-dot-signal-and-pin.md">on GitHub</eref>; proposed text and editorial changes are very much welcomed there, but any functional changes should always first be discussed on the IETF DPRIVE WG (dns-privacy) mailing list.</t>
</section>

<section anchor="conventions-and-definitions"><name>Conventions and Definitions</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when, they appear in all capitals, as shown here.</t>

<dl>
<dt>CDNSKEY record</dt>
<dd><t>as defined in <xref target="RFC7344"></xref><xref target="RFC8078"></xref></t>
</dd>
<dt>DS record</dt>
<dd><t>as defined in <xref target="RFC4034"></xref></t>
</dd>
<dt>DNSKEY record</dt>
<dd><t>as defined in <xref target="RFC4034"></xref></t>
</dd>
</dl>
</section>

<section anchor="summary"><name>Summary</name>
<t>To enable the signaling of DoT a new DNSKEY algorithm type TBD is added.
If a resolver with support for TBD encounters a DS record with the DNSKEY algorithm type TBD it MUST connect to the authoritative servers for this domain via DoT.
It MUST use the hashes attached to the DS records with DNSKEY algorithm type TBD to check whether the public key supplied by the authoritative nameserver is valid.
If the DoT connection is unsuccessful or the public key supplied the server does not match one of the DS digests, the resolver MUST NOT fall back to unencrypted Do53.</t>
<t>The pseudo DNSKEY record MUST contain Base64 encoded (<xref target="RFC4648"></xref> 4.) DER SubjectPublicKeyInfo as defined in <xref target="RFC5280"></xref> 4.1.2.7.
Since the cert provided by the TLS server over the wire is already DER encoded this makes for easy validation.
The pseudo DNSKEY algorithm type TBD is algorithm agnostic, like the TLSA record, since the DER encoded data already contains information about the used algorithm.
Algorithm support SHOULD be handled at the TLS handshake level, which means a DNS application SHOULD NOT need to be aware of the algorithm used by its TLS library.
The pseudo DNSKEY record MUST NOT be present in the zone.
The procedure for hashing the pseudo DNSKEY record is the same as for a normal DNSKEY as defined in RFC4034.</t>
<t>The pseudo DNSKEY type can be used in CDNSKEY and CDS (as defined in <xref target="RFC7344"></xref>) records. These records MAY be present in the zone.</t>
<t>For those familiar with TLSA (<xref target="RFC6698"></xref>), key matching for this protocol is identical to that provided by <tt>TLSA 3 1 0</tt> for (C)DNSKEY.
For the DS case, key matching is similar to <tt>TLSA 3 1 x</tt> where x is not zero, except that the rest of the (C)DNSKEY, including the owner name, gets prepended before hashing.</t>
</section>

<section anchor="example"><name>Example</name>
<t>This section will take you through the various parts of this specification, by example.</t>
<t>We assume that we are working with a domain <tt>example.com.</tt> with one name server, <tt>ns.example.com.</tt>.</t>

<section anchor="generating-and-placing-the-c-dnskey-ds-records"><name>Generating and placing the (C)DNSKEY/DS records</name>
<t>We will walk you through the CDNSKEY/DS generation, demonstrating it in terms of basic shell scripting and some common tools.</t>
<t>First, we extract the SubjectPublicKeyInfo:</t>

<artwork>openssl s_client -connect ns.example.com:853 &lt; /dev/null \
  | openssl x509 -noout -pubkey &gt; pubkey.pem
</artwork>
<t>This gives us a file <tt>pubkey.pem</tt> that looks like this (abridged):</t>

<artwork>-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxH2a6NxIcw5527b04kKy
...
71AWASNoX2GQh7eaQPDD9i8CAwEAAQ==
-----END PUBLIC KEY-----
</artwork>
<t>To turns this into a CDNSKEY:</t>

<ol>
<li><t>remove the header and footer</t>
</li>
<li><t>remove all newlines</t>
</li>
</ol>
<t>In other words:</t>

<artwork>openssl s_client -connect ns.example.com:853 &lt;/dev/null \
  | openssl x509 -noout -pubkey \
  | sed '1d;$d' \
  | tr -d '\n'
</artwork>
<t>Then we prepend</t>

<artwork>example.com. IN CDNSKEY 0 3 225
</artwork>
<t>so that we end up with</t>

<artwork>example.com. IN CDNSKEY 0 3 225 MIICIj...AAQ==
</artwork>
<t>If your registry accepts CDNSKEY, or DNSKEY via EPP, you are done - you can get your DS placed.</t>
<t>To generate the DS, do something like this:</t>

<artwork>echo example.com. IN DNSKEY 0 3 225 MIICIj...AAQ== \
  | ldns-key2ds -f -n -2 /dev/stdin
example.com.	3600	IN	DS	7573 225 2 fcb6...c26c
</artwork>
<t>[TODO: what if a server has different keys depending on crypto algorithm negotiation? probably need some words on that somewhere, perhaps not (only) in this section]</t>
</section>
</section>

<section anchor="implementation"><name>Implementation</name>
<t>The subsection titles in this section attempt to follow the terminology from <xref target="RFC8499"></xref> in as far as it has suitable terms.
'Implementation' is understood to mean both 'code changes' and 'operational changes' here.</t>

<section anchor="authoritative-server-changes"><name>Authoritative server changes</name>
<t>This specification defines no changes to query processing in authoritative servers.</t>
<t>If DoT-signaling DS records are published for a zone, all name servers for the zone (from both the parent-side and child-side NS RRsets) SHOULD offer DoT service on port 853, and when they do, they SHOULD do so using keys present in the DS RRset.
However, there are potential cases where this is not possible, like having multiple DNS providers.
In this case the name servers that do not support DoT SHOULD respond with a RST response on the port tcp/853 to prevent name resolution slow downs.</t>
</section>

<section anchor="validating-resolver-changes"><name>Validating resolver changes</name>
<t>If a resolver succesfully uses DoT with a nameserver as specified in this document, it MAY assume DoT is always available for that nameserver.
However, it MAY NOT assume that the connection is properly pinned unless there is a DS record available for the domain it is currently resolving.</t>
</section>

<section anchor="stub-resolver-changes"><name>Stub resolver changes</name>
<t>This specification defines no changes to stub resolvers.</t>
</section>

<section anchor="zone-validator-changes"><name>Zone validator changes</name>
<t>This section covers both the 'online' type of zone validator, such as Zonemaster, and the 'offline full zone' type, such as <tt>validns</tt> and <tt>dnssec-verify</tt>.</t>
<t>Checks for child DNSKEY records based on parent DS records algorithms, and checks for zone RRSIG algorithms based on DNSKEY algorithms, MUST not be applied to algorithm TBD.
[NOTE: rephrase this in terms of the Zone Signing column at  <eref target="https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml">https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml</eref> ?]</t>
<t>DNSKEY validity checks MAY verify correct DER syntax in DNSKEY Public Key content when algorithm is TBD.</t>
</section>

<section anchor="domain-registry-changes"><name>Domain registry changes</name>
<t>Any pre-delegation or periodic checks by registries should honor the Zone validator changes from the previous section.</t>
<t>This specification trusts that appearance of TBD in <eref target="https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml">https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml</eref> will eventually lead registries to accept DS/(C)DNSKEY submissions for algorithm TBD.</t>
<t>Registries that limit the total number of DS records for a delegation SHOULD consider having a separate limit for algorithm TBD DS records, as their management is separate from actual DNSSEC key management.</t>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>This document defines a way to convey, authoritatively, that resolvers must use DoT to do their queries to the name servers for a certain zone.
By doing so, that exchange gains confidentiality, data integrity, peer entity authentication.</t>
</section>

<section anchor="implementation-status"><name>Implementation Status</name>
<t>[RFC Editor: please remove this section before publication]</t>
<t>This section records the status of known implementations of the protocol defined by this specification at the time of posting of this document, and is based on a proposal described in <xref target="RFC6982"></xref>.
The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs.
Please note that the listing of any individual implementation here does not imply endorsement by the IETF.
Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors.
This is not intended as, and must not be construed to be, a catalog of available implementations or their features.
Readers are advised to note that other implementations may exist.</t>
<t>According to RFC 6982, &quot;this will allow reviewers and working groups to assign due consideration to documents that have the benefit of running code, which may serve as evidence of valuable experimentation and feedback that have made the implemented protocols more mature.  It is up to the individual working groups to use this information as they see fit&quot;.</t>

<section anchor="poc"><name>PoC</name>
<t>Some Proof of Concept code showing the generation of the (C)DNSKEY, and the subsequent hashing by a client (which should match one of the DS records with algo TBD), in Python and Go, is available at <eref target="https://github.com/PowerDNS/parent-signals-dot/tree/master/poc">https://github.com/PowerDNS/parent-signals-dot/tree/master/poc</eref></t>
</section>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document updates the IANA registry &quot;DNS Security Algorithm Numbers&quot; at <eref target="https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml">https://www.iana.org/assignments/dns-sec-alg-numbers/dns-sec-alg-numbers.xhtml</eref></t>
<t>The following entries have been added to the registry:</t>

<sourcecode type="ascii-art">+--------------+----------------+
| Number       | TBD            |
| Description  | DoT signal+pin |
| Mnemonic     | DOTPIN         |
| Zone signing | N              |
| Trans sec.   | N              |
| Reference    | RFC TBD2       |
+--------------+----------------+
</sourcecode>
</section>

<section anchor="acknowledgements"><name>Acknowledgements</name>
<t>Great input was received from
Job Snijders,
Petr Spacek,
Pieter Lexis,
Ralph Dolmans,
Remi Gacogne,
and Vladimir Cunat.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6982.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7858.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8078.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4034.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.bretelle-dprive-dot-for-insecure-delegations.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7344.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4648.xml"/>
</references>
<references><name>Informative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6698.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8499.xml"/>
</references>

</back>

</rfc>
