<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs),
     please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
     (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space
     (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->

<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
        category="std" consensus="true"
        docName="draft-huque-dnsop-compact-lies-01"
        ipr="trust200902" updates="" obsoletes=""
        submissionType="IETF" xml:lang="en"
        tocInclude="true" tocDepth="4"
        symRefs="true" sortRefs="true" version="3">

  <!-- ***** FRONT MATTER ***** -->

  <front>

    <title abbrev="Compact Denial of Existence in DNSSEC">
       Compact Denial of Existence in DNSSEC
    </title>
    <seriesInfo name="Internet-Draft" value="draft-huque-dnsop-compact-lies"/>

    <author fullname="Shumon Huque" initials="S." surname="Huque">
      <organization>Salesforce</organization>
      <address>
        <postal>
          <street>415 Mission Street, 3rd Floor</street>
          <city>San Francisco</city>
          <region>CA</region>
          <code>94105</code>
          <country>United States of America</country>
        </postal>
        <email>shuque@gmail.com</email>
      </address>
    </author>

    <author fullname="Christian Elmerot" initials="C." surname="Elmerot">
      <organization>Cloudflare</organization>
      <address>
        <postal>
          <street>101 Townsend St.</street>
          <city>San Francisco</city>
          <region>CA</region>
          <code>94107</code>
          <country>United States of America</country>
        </postal>
        <email>elmerot@cloudflare.com</email>
      </address>
    </author>

    <date day="3" month="3" year="2023"/>
    <!-- Meta-data Declarations -->

    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <keyword>Internet-Draft</keyword>
    <keyword>DNS</keyword>
    <keyword>DNSSEC</keyword>
    <keyword>Denial of Existence</keyword>
    <keyword>Compact Denial of Existence</keyword>
    <keyword>Compact Answers</keyword>
    <keyword>Black Lies</keyword>
    <keyword>NXDOMAIN</keyword>
    <keyword>NODATA</keyword>
    <keyword>Empty Non-Terminal</keyword>

    <abstract>
     <t>
       This document describes a technique to generate a signed DNS response
       on demand for a non-existent name by claiming that the name exists
       but doesn't have any data for the queried record type. Such answers
       require only one minimal NSEC record, allow online signing servers
       to minimize signing operations and response sizes, and prevent zone
       content disclosure.
     </t>
    </abstract>

  </front>

  <middle>

    <section numbered="true" toc="default">
      <name>Introduction and Motivation</name>
      <t>
        RFC EDITOR: PLEASE REMOVE THIS PARAGRAPH BEFORE PUBLISHING:
        The source for this draft is maintained in GitHub at:
        https://github.com/shuque/id-dnssec-compact-lies
      </t>
      <t>
        One of the functions of the Domain Name System Security Extensions
        (DNSSEC) <xref target="RFC4033" /> <xref target="RFC4034" />
        <xref target="RFC4035" /> <xref target="RFC5155" /> is
        "Authenticated Denial of Existence",
        i.e. proving that a DNS name or record type does not exist.
        Normally, this is done by means of signed NSEC or NSEC3 records.
        In the precomputed signature model, these records chain together
        existing names, or cryptographic hashes of them in the zone. In
        the online signing model, described in NSEC and NSEC3 "White Lies"
        <xref target="RFC4470" /> <xref target="RFC7129" />,
        they are used to dynamically compute an epsilon
        function around the queried name. A 'type bitmap' in the data field
        of the NSEC or NSEC3 record asserts which resource record types are
        present at the name.
      </t>
      <t>
        The response for a non-existent name requires up to 2 signed NSEC
        records or up to 3 signed NSEC3 records (and for online signers,
        the associated cryptographic computation), to prove that (1) the
        name did not explicitly exist in the zone, and (2) that it could
        not have been synthesized by a wildcard.
      </t>
      <t>
        This document describes an alternative technique, "Compact Denial
        of Existence" or "Compact Answers",
        to generate a signed DNS response on demand for a non-existent
        name by claiming that the name exists but has no resource records
        associated with the queried type, i.e. it returns a NODATA response
        rather than an NXDOMAIN response. A NODATA response (which has a
        response code of NOERROR, and an empty ANSWER section) requires
        only one NSEC record matching the queried name. This has two
        advantages: the DNS response size is smaller, and it reduces the
        online cryptographic work involved in generating the response.
      </t>
      <t>
        The use of minimally covering NSEC records also prevents
        adversaries from enumerating the entire contents of DNS zones
        by walking NSEC chains.
      </t>
    </section>

    <section numbered="true" toc="default">
      <name>Distinguishing NXDOMAIN from Empty Non-Terminal Names</name>
      <t>
        Since NODATA responses are generated for non-existent names, and
        there are no defined record types for the name, the NSEC type
        bitmap in the response will only contain "NSEC" and "RRSIG".
        Tools that need to accurately identify non-existent names in
        responses cannot rely on this specific type bitmap because Empty
        Non-Terminal (ENT) names (which positively exist) also have no
        record types at the name and will return exactly the same type
        bitmap.
      </t>
      <t>
        Today, some specific implementations of Compact Answers avoid the
        NXDOMAIN identification problem by synthesizing the NSEC type
        bitmap for ENTs to include all record types supported except for
        the queried type. This has the undesirable effect of no longer
        being able to reliably determine the existence of ENTs, and of
        making the Type Bitmaps field potentially larger than it needs to
        be. It also has the potential to confuse validators and others
        tools that infer type existence from the NSEC record.
      </t>
      <t>
        This document defines the use of a synthetic Resource Record
        type to signal the presence of a non-existent name. The
        mnemonic for this RR type is "NXNAME" and its type code is [TBD].
        This RR type is added to the NSEC type bitmap for responses
        to non-existent names (in addition to the required RRSIG and
        NSEC types). The moniker NXNAME is chosen to clearly
        distinguish it from the response code NXDOMAIN.
      </t>
      <t>
        No special handling of this RR type is required on the part of
        DNS resolvers. However, a resolver could optionally use the
        presence of the RR type to modify the response code in the answer
        it relays back to downstream non-validating clients from NODATA to
        NXDOMAIN.
      </t>
      <t>
        An alternative way to distinguish NXDOMAIN from ENT is to
        define the synthetic Resource Record type for ENTs instead,
        as specified in <xref target="ENT-SENTINEL" format="default"/>,
        and this has already been deployed in the field. This typically
        imposes less work on the server since NXDOMAIN responses are a
        lot more common than ENTs. And at the time it was deployed it
        allowed a common bitmap pattern ("NSEC RRSIG") to identify
        NXDOMAIN across this and other implementations that returned
        a broad bitmap pattern for Empty Non-Terminals. However, the
        advantage of the NXNAME RR type is that it explicitly identifies
        NXDOMAIN responses, and allows them to be distinguished conclusively
        from potential ENT responses in other online signing NSEC
        implementations.
      </t>
    </section>

    <section numbered="true" toc="default">
      <name>Generating Responses</name>

    <t>
    This section describes various types of answers generated by
    authoritative servers implementing Compact Denial of Existence.
    </t>

    <section numbered="true" toc="default">
      <name>Responses for Non-Existent Names</name>
      <t>
        When the authoritative server receives a query for a non-existent
        name in a zone that it serves, a NODATA response (response code
        NOERROR, empty Answer section) is generated with a dynamically
        constructed NSEC record with the owner name matching the queried
        name (QNAME).
      </t>
      <t>
        The Next Domain Name field SHOULD be set to the immediate
        lexicographic successor of the QNAME. The Type Bit Maps field
        MUST only have the bits set for the following RR Types: RRSIG,
        NSEC, and NXNAME.
      </t>
      <t>
        For example, a request for the non-existing name a.example.com would
        cause the following NSEC record to be generated (in DNS presentation
        format):
      </t>
      <artwork name="" type="" align="left" alt=""><![CDATA[
          a.example.com. 3600 IN NSEC \000.a.example.com. RRSIG NSEC NXNAME
        ]]></artwork>

      <t>
        The NSEC record MUST have corresponding RRSIGs generated.
      </t>
    </section>

    <section numbered="true" toc="default">
      <name>Responses for Non-Existent Types</name>
      <t>
        When the authoritative server receives a query for a name
        that exists, but has no resource record sets associated with
        the queried type, it generates a NODATA response, with
        a dynamically constructed signed NSEC record in the Additional
        Section. The owner name of the NSEC record matches the queried
        name. The Next Domain Name field is set to the immediate lexicographic
        successor of the QNAME. The Type Bitmaps field lists the available
        Resource Record types at the name.
      </t>
      <t>
        An Empty Non-Terminal is a special subset of this category,
        where the name has no resource record sets of any type (but
        has descendant names that do). For a query for an Empty
        Non-Terminal, the NSEC type bitmap will only contain RRSIG
        and NSEC. (Note that this is substantially different than the
        ENT response in precomputed NSEC, where the NSEC record "covers"
        the ENT and has the Next Domain Name field set to the next
        lexicographic descendent of the ENT in the zone.)
      </t>
    </section>

    <section numbered="true" toc="default">
      <name>Responses for Wildcard Matches</name>
      <t>
        For wildcard matches, the authoritative server will provide
        a dynamically signed response that claims that the queried
        name exists explicitly. Specifically, the answer RR set will
        have an RRSIG record demonstrating an exact match (i.e. the
        label count in the RRSIG RDATA will be equal to the number of
        labels in the query name minus the root label). This obviates
        the need to include an NSEC record in the Additional section
        of the response that shows that no closer match than the wildcard
        was possible.
      </t>
      <t>
        For a Wildcard NODATA match (where the queried name matches
        a wildcard but no data for the queried type exists), a response
        akin to a non-wildcard NODATA is returned. The Answer section
        is empty, and the Additional section contains a single NSEC
        record that matches the query name with a type bitmap
        representing the list of types available at the wildcard.
      </t>
    </section>

    </section>

    <section numbered="true" toc="default">
      <name>Operational Implications</name>
      <t>
        A signed zone at an authoritative server implementing Compact
        Answers will never return a response with a response code of
        NXDOMAIN. Tools that rely on accurately determining non-existent
        names will need to infer them from the presence of the NXNAME
        RR type in the type bitmap of the NSEC record in NODATA responses
        from these servers. The response code in the DNS header cannot
        be authenticated, so inferring the status of a response from
        signed data in the body of the DNS message is more secure.
      </t>
      <t>
        Address lookup functions typically invoked by applications will
        continue to work, although extra invocations of these
        functions (and corresponding extra DNS queries) may be caused.
        For example, a NODATA response to the lookup of an AAAA record
        for a non-existent name, can cause an application to issue another
        query at the same name for an A record. Whereas a NXDOMAIN
        response to the first query would correctly suppress additional
        queries for other types at that name. Address lookup functions
        could be enhanced to examine the NSEC type bitmaps in responses
        to accurately determine non-existent names, however they would
        need to issue DNSSEC enabled queries and potentially deal with
        middleboxes interfering with the delivery of DNSSEC signed
        responses.
      </t>
    </section>

    <section numbered="true" toc="default">
      <name>Implementation Status</name>
      <t>
        Cloudflare, NS1, and Amazon Route53 currently implement the base
        Compact Answers scheme. NS1 additionally implements the Empty
        Non-Terminal distinguisher in the NSEC type bitmap, using the
        private RR type code 65281. There are no implementations yet
        that use the NXNAME distinguisher RR type.
      </t>
    </section>

    <section numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
        Online signing of DNS records requires authoritative servers
        for the DNS zone to have access to the private signing keys.
        Exposing signing keys on Internet reachable servers makes them
        more vulnerable to attack.
      </t>
      <t>
        Additionally, generating signatures on-demand is more
        computationally intensive than returning pre-computed
        signatures. Although the Compact Lies scheme reduces the
        number of online signing operations compared to previous
        techniques like White Lies, it still may make authoritative
        servers more vulnerable to computational denial of service
        attacks than pre-computed signatures. The use of signature
        algorithms (like those based on Elliptic Curves) that have
        a comparatively low cost for signing is recommended.
      </t>
    </section>

    <section anchor="Acknowledgements" numbered="true" toc="default">
      <name>Acknowledgements</name>
      <t>
        The Compact Lies technique (then called "Black Lies") was
        originally proposed in
        <xref target="COMPACT-LIES" format="default"/> by F. Valsorda
        and O. Gudmundsson, and implemented by Cloudflare. The Empty
        Non-Terminal distinguisher RR type was originally proposed in
        <xref target="ENT-SENTINEL" format="default"/> by S. Huque.
        The NXNAME type is based on the FDOM type proposed in
        <xref target="NXDOMAIN-TYPE" format="default"/> by O. Gudmundsson
        and F. Valsorda.
      </t>
    </section>

    <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
        IANA is requested to allocate a new DNS Resource Record type
        code for NXNAME in the DNS parameters registry, from the meta type
        range.
      </t>
      <artwork name="" type="" align="left" alt=""><![CDATA[
         NXNAME  [TBD]  NXDOMAIN Distinguisher for Compact Denial of Existence
        ]]></artwork>
    </section>

  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>

    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4033.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4034.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4035.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.4470.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5155.xml"/>
        <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7129.xml"/>
      </references>
      <references>
        <name>Informative References</name>
      <reference anchor="COMPACT-LIES"
                 target="https://tools.ietf.org/html/draft-valsorda-dnsop-black-lies">
        <front>
          <title>Compact DNSSEC Denial of Existence or Black Lies</title>
          <author fullname="Filippo Valsorda" initials="F" surname="Valsorda" />
          <author fullname="Olafur Gudmundsson" initials="O" surname="Gudmundsson" />
          <date />
        </front>
      </reference>
      <reference anchor="ENT-SENTINEL"
                 target="https://www.ietf.org/archive/id/draft-huque-dnsop-blacklies-ent-01.html">
        <front>
          <title>Empty Non-Terminal Sentinel for Black Lies</title>
          <author fullname="Shumon Huque" initials="S" surname="Huque" />
          <date />
        </front>
      </reference>
      <reference anchor="NXDOMAIN-TYPE"
                 target="https://tools.ietf.org/html/draft-ogud-fake-nxdomain-type/">
        <front>
          <title>Signaling NSEC record owner name nonexistence</title>
          <author fullname="Olafur Gudmundsson" initials="O" surname="Gudmundsson" />
          <author fullname="Filippo Valsorda" initials="F" surname="Valsorda" />
          <date />
        </front>
      </reference>
      </references>
    </references>

  </back>

</rfc>
