<?xml version="1.0" encoding="utf-8"?>
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema
      validation and schema-aware editing --> 

<!DOCTYPE rfc [
  <!ENTITY filename "draft-eastlake-dnsop-rfc2931bis-sigzero-01">
  <!ENTITY nbsp     "&#160;">
  <!ENTITY zwsp     "&#8203;">
  <!ENTITY nbhy     "&#8209;">
  <!ENTITY wj       "&#8288;">
]>
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> --> 
<!-- This third-party XSLT can be enabled for direct transformations
in XML processors, including most browsers --> 
<!-- If further character entities are required then they should be
added to the DOCTYPE above. Use of an external entity file is not
recommended. --> 
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="info"
  docName="&filename;"
  ipr="trust200902"
  obsoletes="2931"
  submissionType="IETF"
  xml:lang="en"
  version="3">
<!-- 
    * docName should be the name of your draft * category should be
    one of std, bcp, info, exp, historic * ipr should be one of
    trust200902, noModificationTrust200902, noDerivativesTrust200902,
    pre5378Trust200902 * updates can be an RFC number as NNNN *
    obsoletes can be an RFC number as NNNN
-->


<!-- ____________________FRONT_MATTER____________________ -->

<front>
  <title abbrev="The DNS SIG(0) RR">Domain Name System (DNS) Public
  Key Based Request and Transaction Authentication ( SIG(0) )</title>
  
<!-- The abbreviated title is required if the full title is longer
     than 39 characters -->

   <seriesInfo name="Internet-Draft"
               value="&filename;"/>

   <author fullname="Donald E. Eastlake 3rd" initials="D."
           surname="Eastlake">
     <organization>Independent</organization>
     <address>
       <postal>
         <street>2386 Panoramic Circle</street>
         <city>Apopka</city>
         <region>Florida</region>
         <code>32703</code>
         <country>USA</country>
       </postal>        
       <phone>+1-508-333-2270</phone>
       <email>d3e3e3@gmail.com</email>
     </address>
   </author>
   
   <author fullname="Johan Stenstam" initials="J."
           surname="Stenstam">
     <organization>Swedish Internet Foundation</organization>
     <address>
        <email>johan.stenstam@internetstiftelsen.se</email>
     </address>
   </author>

   <date year="2025" month="3" day="3"/>

   <area>Operations</area>
   <workgroup>DNSOP</workgroup>

   <keyword></keyword>
   <!-- Multiple keywords are allowed.  Keywords are incorporated
        into HTML output files for use by search engines. --> 

   <abstract>
     <t>This document specifies use of the Domain Name System (DNS)
     SIG Resource Record (RR) to provide a public key based
     authentication of DNS requests and transactions. Such a resource
     record, because it has a "type covered" field of zero, is
     frequently called a "SIG(0)".  This document obsoletes RFC
     2931.</t>
   </abstract>

</front>


<!-- ____________________MIDDLE_MATTER____________________ -->
<middle>
    
<section> <!-- 1. -->
  <name>Introduction</name>

  <t>This document specifies use of the Domain Name System (DNS) SIG
  Resource Record (RR) to provide a public key based method to
  authenticate DNS requests and transactions.  Such a resource record,
  because it has a "type covered" field of zero, is frequently called
  a "SIG(0)".  This document obsoletes <xref target="RFC2931"/>.</t>

  <section>
    <name>Terminology</name>

<t>General familiarity with DNS terminology <xref target="RFC9499"/>
is assumed in this document.</t>
    
<t>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 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only
when, they appear in all capitals, as shown here.</t>

  </section>

</section>

<section>  <!-- 2. -->
  <name>SIG(0) Design Rationale</name>

<t>SIG(0) provides authentication and integrity protection for DNS
transactions and requests that is not provided by the DNSSEC RRSIG RR
specified in <xref target="RFC4034"/>.  The authenticated data origin
services of DNSSEC <xref target="RFC4035"/> either provide protected
data resource records (RRs) or authenticatable denial of their
existence.  Those services provide no protection for </t>

<ul spacing="compact">
  <li>glue records,</li>
  <li>DNS requests,</li>
  <li>the DNS message headers on requests or responses, and</li>
  <li>the overall integrity of a transaction, that is to say, that the
  response was issued in response to the request sent and neither was
  tampered with.</li>
</ul>

<t>Transaction authentication provides some cryptographic assurance to
a resolver that it is at least getting the DNS response message from
the server and that the received message is in response to the request
it sent.  This is accomplished by adding either a TSIG RR <xref
target="RFC8945"/> or, as specified herein, a SIG(0) RR, at the end of
the additional information section of the response which authenticates
the concatenation of the corresponding resolver request and the
server's response.</t>

<t>Requests can also be authenticated by including a SIG(0) RR at the
end of the request's additional information section.  Authenticating
requests serves little function in DNS servers that predate the
specification of dynamic update except to enable more rigorous
enforcement of restrictions on which resolvers can make what requests
of the server. The method of signing requests specified herein is for
authenticating dynamic update requests <xref target="RFC3007"/>, TKEY
requests <xref target="rfc2930bis"/>, or other requests specified in
the future that require authentication.</t>

<t>Depending on the request authority it is sought to establish, the
private keys used in public key based request security belongs to
the host composing the DNS request message or other entity composing
the request or to a zone to be affected by the request or other
private keys. The corresponding public key(s) can be stored in and
retrieved from the DNS for verification as KEY RRs with a protocol
byte of 255 (ANY).</t>

</section>

<section>
  <name>Differences Between TSIG and SIG(0)</name>

  <t>A TSIG <xref target="RFC8945"/> RR can also be used for request
  and transaction authentication. There are significant differences
  between TSIG and SIG(0).</t>

<t>Because TSIG involves secret keys available at both the requester
and server the presence of such a key can imply that the other party
understands TSIG and likely has the same key installed.  Furthermore,
TSIG uses keyed hash authentication codes which are relatively
inexpensive to compute.  Thus, it is common to authenticate requests
with TSIG and to authenticate responses with TSIG if the corresponding
request is authenticated.</t>

<t>SIG(0) on the other hand, uses public key authentication, where the
public keys can be stored in DNS as KEY RRs and a private key is
stored at the signer.  Existence of such a KEY RR does not necessarily
imply that SIG(0) is implemented or enabled.  In addition, SIG(0)
involves relatively expensive public key cryptographic operations that
should be minimized and the verification of a SIG(0) involves
obtaining and verifying the corresponding KEY which can be an
expensive operation.  Indeed, a policy of using SIG(0) on all requests
and verifying it before responding would, for some configurations,
lead to a deadly embrace with the attempt to obtain and verify the KEY
needed to authenticate the request SIG(0) resulting in additional
requests accompanied by a SIG(0) leading to further requests
accompanied by a SIG(0), etc.  Furthermore, omitting SIG(0)s when not
required on requests halves the number of public key operations
required by the transaction.</t>

<t>For these reasons, SIG(0)s SHOULD only be used on requests when
necessary to authenticate that the requester has some required
privilege or identity.  SIG(0)s on transactions are defined in such a
way as to not require a SIG(0) on the corresponding request and still
provide transaction protection.  Which SIG(0)s are authenticated by
the server or required to be authenticated by the requester SHOULD be
a local configuration option.</t>

<aside><t>Both DNS transaction security and DNSSEC data security
originally used the SIG (type = 24) and KEY (type = 25) RRs.  DNSSEC
was changed to use the RRSIG (type = 46) and DNSKEY (type = 48) RRs
<xref target="RFC4034"/>; however, transaction security, including
TKEY <xref target="rfc2930bis"/> and SIG(0), continue to use the SIG
and KEY RRs.</t></aside>

</section>

<section>
  <name>The SIG(0) Resource Record</name>
  
<t>The structure of SIG resource records (RRs) is the same as the
structure of the RRSIG RR in <xref target="RFC4034"/> Section 4 except
as provided below.</t>

<t>The type of the SIG RR is 24. For SIG(0) RRs, the owner name,
class, TTL, and original TTL, are meaningless.  The TTL fields MUST be
zero and the CLASS field MUST be 255 (ANY), and these fields are ignored on
receipt. A TTL of zero decreases the risk that a DNS implementation
that does not understand SIG(0) will cache such an RR. To conserve
space, the owner name SHOULD be root (a single zero octet).</t>

<t>The inception and expiration times in SIG(0)s are for the purpose
of resisting replay attacks.  They should be set to form a time
bracket such that messages received outside that bracket can be
ignored.  In IP networks, this time bracket should not normally extend
further than 5 minutes into the past and 5 minutes into the
future.</t>

<t>For all transaction SIG(0)s, there MUST be a KEY RR associated with
the signer name with the public key corresponding to the private key
used to calculate the signature.  For general transaction
authentication and integrity, the signer field is a name of the
originating host; for example, the host domain name used may be the
inverse IP address mapping name for an IP address of the host if the
relevant KEY is stored there. For SIG(0)s on requests requiring
authentication, the signer relates to the authority being requested
such as authority to update a zone.</t>

<t>When SIG(0) authentication on a response is desired, that SIG RR
MUST be considered the highest priority of any additional information
for inclusion in the response. If the SIG(0) RR cannot be added
without causing the message to be truncated, the server MUST alter the
response so that a SIG(0) can be included, set the TC bit, and return
RCODE 0 (NOERROR).  The client should at this point retry the request
using TCP.</t>

</section>
<section>
  <name>Calculating Request and Transaction SIG(0)s</name>

<t>A DNS request may be optionally signed by including one SIG(0) at
the end of the request additional information section.  Such a SIG RR
is distinguished by having a "type covered" field of zero. It is
calculated for and signs the "data" consisting of</t>
<ol spacing="compact">
  <li>the SIG(0)'s RDATA section entirely omitting (not just zeroing)
  the signature subfield itself, and</li>
  <li>the DNS request message, including DNS header, but not the
  UDP/IP header and before the SIG(0) RR has been added so that, for
  example, counts have not yet been adjusted for the inclusion of the
  SIG(0).</li>
</ol>
<t>That is</t>

<artwork align="center" type="ascii=art">
data = RDATA | ( request without SIG(0) )
</artwork>
    
<t>where "|" is concatenation and RDATA is the RDATA of the SIG(0)
being calculated omitting the signature itself.</t>

<t>Similarly, a SIG(0) can be used to secure a response and the
request that produced it.  Such a transaction signature is calculated
by using a "data" consisting of</t>

<ol spacing="compact">
  <li>the SIG(0)'s RDATA section omitting (not just zeroing) the
  signature itself,</li>
  <li>the entire DNS request message that produced this response,
  including the request's DNS header and any SIG(0) that was present
  but not its UDP/IP header, and</li>
  <li>the entire DNS response message, including DNS header but not
  the UDP/IP header and before the SIG(0) has been added so that, for
  example, response RR counts have not yet been adjusted for the
  inclusion of the SIG(0).</li>
</ol>

<artwork align="center" type="ascii=art">
data = RDATA | full request | ( response without SIG(0) )
</artwork>

<t>where "|" is concatenation and RDATA is the RDATA of the SIG(0)
being calculated less the signature itself.</t>

<t>Verification of a response SIG(0) by the requesting resolver shows
that the query and response were not tampered with in transit, that
the response corresponds to the intended query, and that the response
comes from the queried server.</t>

<t>In the case of a DNS message via TCP, a SIG(0) on the first data
packet is calculated with "data" as above and for each subsequent
packet, it is calculated as follows:</t>

<artwork align="center" type="ascii=art">
data = RDATA | ( DNS payload without SIG(0) ) | previous packet
</artwork>

<t>where "|" is concatenations, RDATA is as above, and previous packet
is the previous DNS payload including DNS header and SIG(0) but
not the TCP/IP header.  As an alternative, TSIG may be used after, if
necessary, setting up a key with TKEY <xref target="rfc2930bis"/>.</t>

<t>Except where needed to authenticate an update, TKEY, or similar
privileged request, servers are not required to check a request
SIG(0).</t>

<t>Requests and responses can either have a TSIG RR or a SIG(0) RR but
not both.</t>

</section>
<section>
  <name>Processing Responses and SIG(0) RRs</name>

<t>If a SIG RR is at the end of the additional information section of
a response and has a type covered of zero, it is a transaction
signature covering the response and the request that produced the
response.</t>

<t>If the time a SIG(0) on a request is received is outside the
interval indicated by the inception and expiration times in the SIG(0),
the BADTIME error is returned.</t>

<t>If a response's SIG(0) check succeeds, such a transaction
authentication SIG does NOT directly authenticate the validity of any
data RRs in the message.  However, it authenticates that they were
sent by the queried server and have not been altered in transit.
(Only an RRSIG RR <xref target="RFC4034"/> signed by the zone or a key
tracing its authority to the zone or to resolver configuration can
directly authenticate data RRs, depending on resolver policy.) If a
resolver or server does not implement transaction and/or request
SIG(0)s, it MUST ignore them without error where they are optional and
treat them as failing where they are required.</t>

<section anchor="edns">
  <name>Original ID and Error Return</name>

  <t>Since SIG(0) does not provide for an Original ID field as
  provided in TSIG <xref target="RFC8945"/> and does not provide an
  error field as provided in TSIG and TKEY <xref
  target="rfc2930bis"/>, the Original ID of a request with a SIG(0)
  may be provided, and errors are returned in an EDNS(0) RR
  as an option <xref target="RFC6891"/> with option code TBD. </t>

  <figure align="center">
    <name>SIG(0) Original ID and Error Return EDNS Option</name>
    <artwork>
                +0 (MSB)                            +1 (LSB)
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
0: |                       OPTION-CODE = TBD                       |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
2: |                       OPTION-LENGTH = 4                       |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
4: |                       Original ID                             |
   +-                                                             -+
6: |                       Error return value                      |
   +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
    </artwork>
  </figure>
  
</section>

<section>
  <name>Special Considerations for Forwarding Servers</name>
  
  <t>A server acting as a forwarding server of a DNS message SHOULD
  check for the existence of a SIG(0) record. If it cannot verify the
  SIG(0), the server MUST forward the message unchanged including the
  SIG(0). If the SIG(0) passes all checks and verifies, the forwarding
  server MUST, if possible, include a SIG(0) or TSIG of its own to the
  destination or the next forwarder. If no transaction security is
  available to the destination and the message is a query, and if the
  corresponding response has the AD flag (see <xref
  target="RFC4035"/>) set, the forwarder MUST clear the AD flag before
  adding the SIG(0) to the response and returning the result to the
  system from which it received the query.</t>

  <t>A forwarded SIG(0) is not verifiable unless the original
  transaction ID is preserved by, for example,</t>
  <ul>
    <li>using TCP and maintaining a separate ID space for that TCP
    connection between the forwarder and the server or next forwarder
    or</li>
    <li>forwarding the EDNS option specified in <xref
    target="edns"/>.</li>
  </ul>
  
</section>
</section>

<section>
  <name>Security Considerations</name>

  <t>Private keys used to create SIG(0) RRs are very sensitive
  information and all available steps should be taken to protect them
  on every host on which they are stored. Such hosts may need to be
  physically protected. If they are multi-user machines, great care
  should be taken so that unprivileged users have no access to private
  keying material.</t>
  
<t>The inclusion of the SIG(0) inception and expiration time under the
signature improves resistance to replay attacks.</t>

<t>More?</t>

</section>
<section>
  <name>IANA Considerations</name>

  <t>IANA is requested to assign an EDNS OPT number in the "DNS EDNS0
  Option Codes (OPT)" Registry as follows:</t>

  <table>
    <thead>
      <tr><th>Value</th><th>Name</th><th>Status</th><th>Reference</th></tr>
    </thead>
    <tbody>
      <tr><td>TBD</td><td>SIGZERO</td><td>Standard</td><td>[this
      document]</td></tr> 
    </tbody>
  </table>

</section>
            
</middle>


<!-- ____________________BACK_MATTER____________________ -->
<back>

<references>
  <name>Normative References</name>

<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml"/>
<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.4034.xml"/>
<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.4035.xml"/>
<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.6891.xml"/>
<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>

</references>

<references>
  <name>Informative References</name>

  <reference anchor="rfc2930bis"
	     target="https://datatracker.ietf.org/doc/draft-eastlake-dnsop-rfc2930bis-tkey/">
    <front>
      <title>Secret Key Agreement for DNS (TKEY Resource
      Record)</title>
      <author fullname="Donald E. Eastlake 3rd" initials="D."
	      surname="Eastlake"/>
      <author fullname="Mark Andrews" initials="M."
	      surname="Andrews"/>
    </front>
    <seriesInfo name="work in" value="process"/>
  </reference>

<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2931.xml"/>
<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.3007.xml"/>
<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8945.xml"/>
<xi:include
  href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9499.xml"/>

</references>

<section>
  <name>Changes from <xref target="RFC2931"/></name>

  <ol spacing="compact">
    <li>Change to require KEY RRs used in connection with SIG(0) to
    have a protocol byte of 255 (ANY). (<xref target="RFC2931"/> also
    permitted a protocol byte of 3.</li>
    <li>Change implementation requirement for the TTL and CLASS field
    of SIG(0) RRs from SHOULD be zero and 255, respectively, to MUST
    have those values and are ignored on receipt.</li>
    <li>Add section on considerations for forwarding servers.</li>
    <li>Remove statement that TCP support for SIG(0) is OPTIONAL.</li>
    <li>Specify an EDNS option to convey the original ID and return an
    extended error code.</li>
    <li>Editorial changes including updates to meet current Internet
    draft format requirements. Update references. Convert source to
    XMLv3.</li>
  </ol>
  
</section>

<section>
  <name>Change History</name>

  <t>RFC Editor: Please delete this section before publication.</t>

  <section>
    <name>From -00 to -01</name>
    <ol spacing="compact">
      <li>Add section on error return via EDNS and and add IANA
      request for an EDNS OPT number.</li>
      <li>Clarify that a SIG(0) public key can be associated with a
      zone or otherwise indicate authorization.</li>
      <li>Add author.</li>
      <li>Editorial Changes.</li>
    </ol>
  </section>
</section>

<section anchor="Acknowledgements" numbered="false">
  <name>Acknowledgements</name>

<t>The comments and suggestions of the following are gratefully
acknowledged:</t>

<t indent="4">tbd</t>

<t>The comments and suggestions of the following persons were
incorporated into <xref target="RFC2931"/>, which was the previous
version of this document, and are gratefully acknowledged:</t>

<t indent="4">Olafur Gudmundsson, Ed Lewis, Erik Nordmark, Brian
Wellington.</t>

</section>

</back>

</rfc>
