<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc6698 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.6698.xml">
<!ENTITY rfc7250 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.7250.xml">
<!ENTITY rfc7413 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7413.xml">
<!ENTITY rfc7626 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.7626.xml">
<!ENTITY rfc7766 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.7766.xml">
<!ENTITY rfc7816 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.7816.xml">
<!ENTITY rfc7858 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7858.xml">
<!ENTITY rfc8305 SYSTEM
"http://xml.resource.org/public/rfc/bibxml/reference.RFC.8305.xml">
<!ENTITY I-D.ietf-dprive-dtls-and-tls-profiles SYSTEM
"http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-dprive-dtls-and-tls-profiles.xml">
<!ENTITY I-D.ietf-tls-tls13 SYSTEM
"http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tls-tls13.xml">
<!ENTITY I-D.ietf-tls-dnssec-chain-extension SYSTEM
"http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tls-dnssec-chain-extension.xml">
<!ENTITY I-D.bortzmeyer-dprive-step-2 SYSTEM
"http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.bortzmeyer-dprive-step-2.xml">
<!ENTITY I-D.ietf-tls-sni-encryption SYSTEM
"http://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tls-sni-encryption.xml">
]>
<rfc docName="draft-bortzmeyer-dprive-resolver-to-auth-01"
     category="std" ipr="trust200902">
<?rfc toc="yes"?>
<?rfc strict="yes"?>
<front>
<title abbrev="DPRIVE resolver to authoritative">Encryption and
authentication of the DNS resolver-to-authoritative communication</title>
<author fullname="Stephane Bortzmeyer" initials="S." surname="Bortzmeyer">
<organization>AFNIC</organization>
<address><postal><street>1, rue Stephenson</street><code>78180</code><city>Montigny-le-Bretonneux</city><country>France</country></postal> <phone>+33 1 39 30 83 46</phone><email>bortzmeyer+ietf@nic.fr</email><uri>http://www.afnic.fr/</uri></address>
</author>
<date day="20" month="March" year="2018"/>
<workgroup>DNS Privacy (dprive) Working Group</workgroup>
<abstract>
  <t>This document proposes a mechanism for securing (privacy-wise)
  the communication between the DNS resolver and the authoritative name server.</t>
<t>REMOVE BEFORE PUBLICATION: this document should be discussed in the
IETF DPRIVE group, through its mailing list. The
source of the document, as well as a list of open issues, is currently
kept <eref
target="https://github.com/bortzmeyer/ietf-dprive-step-2">at Github</eref>.</t>
</abstract>
</front>

<middle>
  <section anchor="intro" title="Introduction and background">
    <t>To improve the privacy of the DNS user (<xref
    target="RFC7626"/>), the standard solution is to encrypt the
    requests with TLS (<xref target="RFC7858"/>). We use this
    DNS-over-TLS solution as well here, since it is standardized,
    already implemented in many programs, and relies on a well-known
    security protocol (inventing a new security protocol is quite
    dangerous). But just encrypting, without authenticating the remote
    server, leaves the user's privacy vulnerable to active
    man-in-the-middle attacks. <xref target="RFC7858"/> and <xref
    target="I-D.ietf-dprive-dtls-and-tls-profiles"/> describe how to
    authenticate the DNS resolver, in the stub-to-resolver link. We
    describe here authentication of the authoritative name server, in
    the resolver-to-authoritative link.</t>
    <t>A stub DNS resolver has only a
    few resolvers, and there is typically a pre-existing
    relationship. But a resolver speaks to many authoritative name
    servers, without any prior relationship. This means that, for
    instance, having a static key for the resolver makes sense while
    it would be clearly unrealistic for the authoritative server.</t>
    <t>Instead, we rely on DANE (<xref target="RFC6698"/>). Authoritative name servers are known by name (obtained from zone
    delegation). The manager of the ns1.example.net name server adds
    a TLSA record under example.net. The client establishes the TLS
    session, then authenticate in the normal DANE way.</t>
    <t>The original charter of the DPRIVE working group<!--
    https://datatracker.ietf.org/wg/dprive/charter/ -->, in force at
    the time of this draft, says "The primary focus of this Working
    Group is to develop mechanisms that provide confidentiality
    between DNS Clients and Iterative Resolvers" and adds "but it may
    also later consider mechanisms that provide confidentiality
    between Iterative Resolvers and Authoritative Servers". This
    document is here for this second step, "between Iterative
    Resolvers and Authoritative Servers". It will probably require a
    rechartering of the group.</t>
  </section>

  <section anchor="solution" title="Rules">
    <t>A DNS full-service resolver who needs to query an authoritative
    name server establishes a TLS-over-TCP session with this
    authoritative name server. If the DNS material to perform DANE
    authentication is sent in the TLS session (<xref
    target="I-D.ietf-tls-dnssec-chain-extension"/>), it uses it. Otherwise,
    the resolver queries TLSA records (<xref
    target="RFC6698"/>) for this name
    server and authenticates the key or certificate of the server this
    way. If the name server is ns1.example.net, the TLSA record to
    query is _853._tcp.ns1.example.net.</t>
    <t>Note that the server MAY use raw
    public keys (<xref target="RFC7250"/>) and so there is not always a
    certificate. If the server uses raw public keys, the TLSA
    record's Selector field must be 1 (SPKI,
    SubjectPublicKeyInfo).</t>
    <t>The recommended order is to try TLS before querying the
    TLSA records. True, DANE signals if the server is willing to make
    DNS-over-TLS (and can therefore save a TLS attempt) but cannot
    guarantee that it will work (for instance if a middlebox blocks
    port 853). Also, the
    DANE records may be transferred in the TLS session, not through
    the DNS.</t>
    <t>If the TLS session establishement fails, or if the DANE
    authentication fails, the result depends on whether the resolver
    runs in strict or opportunistic mode (<xref
    target="I-D.ietf-dprive-dtls-and-tls-profiles"/>). In strict mode,
    the resolver MUST stop using this authoritative name server, and
    MUST try other servers of the DNS zone. In opportunistic mode, the
    resolver MUST use the authoritative name server despite the
    failure. It MAY try other name servers of the zone before, in the
    hope they will accept TLS and be authenticated. To avoid a
    chicken-and-egg problem, the resolver, even in strict mode, MAY use unsecure servers for
    the meta-queries (getting the TLSA records). More specifically:
    <list style="empty">
<t>(0)The resolver remembers the keys of the authoritative name
servers (in the same way it remembers the lowest RTT among an NS
RRset),</t>
<t>(1)When the resolver needs to talk to a server (say
ns2.example.net) for which it does
not know the key, it does a TLSA request for
_853._tcp.ns2.example.net,</t>
<t>(2)If the resolution of this request requires that we talk to the same server for which we’re searching for
the TLSA record, the resolver connects to this server with TLS to port
853, does not bother to authenticate, and sends the query. This step offers no
authentication.</t>
    </list>
    (See also <xref
    target="I-D.ietf-dprive-dtls-and-tls-profiles"/>, section 5.)
    A resolver MAY use the knowledge of
    TLS authentication it has to choose an authoritative name server
    among a NS RRset.
</t>
   <t>As of this revision, we do not expect resolvers to use strict mode, since the encryption and
 authentication modes described in this document are not yet supported in authoritative name servers.</t>
    </section>

   <section title="Operational considerations">
      <t>DNS-over-TLS depends on TCP, and the resolver and the
      authoritative name server must therefore support persistent TCP
      connections (<xref target="RFC7766"/>, specially section 6.2.1).</t>
      <t>A resolver may have a lot of client-side state, when managing hundreds of connections to remote
      authoritative servers (<xref target="tdns"/>).</t>
      <t>The latency when connecting to a authoritative name
      server is certainly an issue. TLS 1.3 and TCP Fast Open (<xref
      target="RFC7413"/>) may help.</t>
      <t>Open question: do we require a minimum TLS version of 1.3?
      (<xref target="I-D.ietf-tls-tls13"/>)</t>
      <t>Because the resolver cannot know in advance if the TLS
      connection will work (even if there is a DANE record), using
      parallel attempts ("happy eyeballs", <xref target="RFC8305"/>) is
      important. A resolver working in opportunistic mode should try
      ports 53 and 853 in parallel.</t>
      <t>An authoritative name server cannot know if the resolver
      authenticated it, nor how. In the future, it may be interesting
      to have an EDNS option to signal a successful authentication, or
      a failure, but this is out of scope currently.</t>
      <t>If it is a concern that the same authoritative name servers
      are used for ordinary DNS and for encrypted DNS, there are
      several ways to address this concern. A server operator may use front-end systems dispatching
      requests to ports 53 and 853 to different servers.</t>
      <t>A resolver must be configurable to operate in strict or
      opportunistic modes.  Until the features described herein are
      widely supported, opportunistic mode should not be the default
      since strict mode would yield frequent failures. A resolver may have a
      configuration mechanism to be in strict mode only for some domains.</t>
  </section>
    
  <section title="IANA Considerations">
     <t>No action for IANA. This section can be deleted.</t>
  </section>

  <section anchor="security" title="Security Considerations">
     <t>The state to be kept in both the client and the server may
     make some denial-of-service attacks easier. Following the advice contained
     in section 10 of <xref target="RFC7766"/> is recommended.</t>
     <t>In opportunistic mode, there is no guarantee to have a secure
     use of the DNS, or even a guarantee to be informed of a
     problem. Opportunistic mode is a "best effort" privacy
     service. Even in strict mode, some leaks may occur, through the
     DANE meta-queries, and through SNI indication (<xref
     target="I-D.ietf-tls-sni-encryption"/>) in the TLS session.</t>
     <t>Neither transport encryption nor authentication protect DNS
     users from authentic servers which nonetheless
     abuse users’ privacy once they’ve received their queries. These techniques must
     therefore be combined with data minimization techniques (<xref
     target="RFC7816"/>).</t>
</section>

</middle>

<back>

<references title='Normative References'>
  &rfc6698;
  &rfc7858;
  &I-D.ietf-dprive-dtls-and-tls-profiles;
</references>

<references title='Informative References'>
  &rfc7250;
  &rfc7413;
  &rfc7626;
  &rfc7766;
  &rfc7816;
  &rfc8305;
  &I-D.ietf-tls-tls13;
  &I-D.ietf-tls-dnssec-chain-extension;
  &I-D.ietf-tls-sni-encryption;
  &I-D.bortzmeyer-dprive-step-2;

<reference anchor="tdns"
	   target="http://www.isi.edu/~johnh/PAPERS/Zhu16b.pdf">
  <front>
    <title>T-DNS: Connection-Oriented DNS to Improve Privacy and
    Security; USC/ISI Technical Report ISI-TR-706</title>
    <author initials="Z." surname="Liang" fullname="Liang Zhu"/>
    <author initials="D." surname="Wessels" fullname="Duane Wessels"/>
    <author initials="H." surname="Zi" fullname="Zi Hu"/>
    <author initials="J." surname="Heidemann" fullname="John Heidemann"/>
    <author initials="A." surname="Mankin" fullname="Allison Mankin"/>
    <author initials="N." surname="Somaiya" fullname="Nikita Somaiya"/>
  <date month="August" year="2014"/>
  </front>
</reference>

</references> 

<section title="Acknowledgments">
   <t>Thanks to Bill Woodcock for a detailed review.</t>
</section>

<section title="Alternatives">
  <t>A number of other possible solutions to this problem may be found in in <xref target="I-D.bortzmeyer-dprive-step-2"/>.</t>
</section>

</back>

</rfc>



