Network Working Group M. Bretelle Internet-Draft Facebook Intended status: Standards Track March 11, 2019 Expires: September 12, 2019 Encoding DNS-over-TLS (DoT) Subject Public Key Info (SPKI) in Name Server name draft-bretelle-dprive-dot-spki-in-ns-name-00 Abstract This document describes a mechanism to exchange the Subject Public Key Info (SPKI) ([RFC5280] Section 4.1.2.7) fingerprint associated with a DNS-over-TLS (DoT [RFC7858]) authoritative server by encoding it as part of its name. The fingerprint can thereafter be used to validate the certificate received from the DoT server as well as being able to discover support for DoT on the server. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on September 12, 2019. Copyright Notice Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of Bretelle Expires September 12, 2019 [Page 1] Internet-Draft dot-spki-in-ns-name March 2019 the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 2 3. Validating a remote DoT server . . . . . . . . . . . . . . . 3 4. Encoding data in a domain name label . . . . . . . . . . . . 3 4.1. Formatting DoT SPKI in name server name. . . . . . . . . 4 4.1.1. Example . . . . . . . . . . . . . . . . . . . . . . . 4 4.2. Handling by the recursive servers . . . . . . . . . . . . 4 4.2.1. Servers supporting this specification . . . . . . . . 4 4.2.2. Servers not supporting this specification . . . . . . 5 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 7.1. Normative References . . . . . . . . . . . . . . . . . . 5 7.2. Informative References . . . . . . . . . . . . . . . . . 7 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 7 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 1. Introduction This document describes a mechanism to exchange the Subject Public Key Info (SPKI) ([RFC5280] Section 4.1.2.7) fingerprint associated with a DNS-over-TLS (DoT [RFC7858]) authoritative server by encoding it as part of its name. The fingerprint can thereafter be used to validate the certificate received from the DoT server as well as being able to discover support for DoT on the server. 2. Terminology A server that supports DNS-over-TLS is called a "DoT server" to differentiate it from a "DNS Server" (one that provides DNS service over any other protocol), likewise, a client that supports this protocol is called a "DoT client" The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. Bretelle Expires September 12, 2019 [Page 2] Internet-Draft dot-spki-in-ns-name March 2019 3. Validating a remote DoT server While DoT provides protection against eavesdropping and on-path tampering of the DNS queries exchanged with an authoritative server, a recursive server that is talking to a remote DoT server needs a mechanism to authenticate that the name server it is communicating with is indeed the one that the authority of the zone manages or has delegated responsibility to. A common mechanism is to have TLS certificates issued by "Certification Authorities" (CAs), those CA public keys are used as trust anchors, and through a chain of trust, a leaf TLS certificate can be validated. Any CA is able to issue a certificate for any domain, which can have its drawbacks ([RFC6698] Section 1.1). Another method is to leverage DANE/TLSA ([RFC6698]), in which case a recursive resolver would be provided the certificate or SPKI hash over DNS and validate it using DNSSEC ([RFC4033], [RFC4034], and [RFC4035]). This document describes a mechanism to signal to a recursive resolver that DoT is supported by the authoritative name server as well as providing a fingerprint of the SPKI to expect from the name server, this is done by formatting a special first label for the name servers. Recursive servers that understand the naming convention detailed in this document will be able to upgrade their connection to the authoritative server to TLS, while the ones that don't will transparently use the name servers as a standard UDP/53 and TCP/53 servers. This format is heavily inspired from [dnscurve]. 4. Encoding data in a domain name label A label is limited to a maximum of 63 octets ([RFC1035] Section 2.3.4) and has a limited set of characters that can be used ([RFC1035] Section 2.3.1), limiting both the amount of data that can be embedded in a label as well as the encoding format. The set of character used by Base32 encoding ([RFC4648] Section 6), without padding character, is suitable to be used in a label. Base32 encodes a 5-bit group into 1 byte which allows to encode up to 39 bytes within the 63 bytes space of a label. floor(63 * 5 / 8) While this limits what can be encoded in a label, there is enough space to store the hash produced by sha256 which requires 32 bytes, leaving 7 bytes to spare. Bretelle Expires September 12, 2019 [Page 3] Internet-Draft dot-spki-in-ns-name March 2019 4.1. Formatting DoT SPKI in name server name. The formatting of a name server is defined as follow: