<?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-00">
  <!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>
 
   <date year="2024" month="10" day="21"/>

   <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 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 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 RFC 2931.</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 protection for DNS transactions and requests that
is not provided by the DNSSEC RRs 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.  These
services provide no protection for glue records, DNS requests, no
protection for the DNS message headers on requests or responses, and
no protection of the overall integrity of a transaction.</t>

<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 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 requests specified in the
future that require authentication.</t>

<t>The private keys used in public key based transaction security
belong to the host composing the DNS response message, not to any zone
involved.  Request authentication may also involve the private key of
the host or other entity composing the request or of a zone to be
affected by the request or other private keys depending on the request
authority it is sought to establish. 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 implies 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 and lengthy 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.  Whether 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 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, the signer field MUST be a name of the
originating host and there MUST be a KEY RR at that name with the
public key corresponding to the private key used to calculate the
signature.  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.</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.  This response consists of
only the question and a SIG(0) record, and has the TC bit set and
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)s at
the end of the request additional information section.  Such a SIG is
distinguished by having a "type covered" field of zero. It is calculated
for and signs the "data" consisting of (1) the SIG's RDATA section
entirely omitting (not just zeroing) the signature subfield itself,
(2) the DNS request message, including DNS header, but not the UDP/IP
header and before the RR counts have been adjusted for the
inclusion of the SIG(0).  That is</t>

<artwork align="center" type="ascii=art">
data = RDATA | ( request - 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 transaction signatures are calculated
by using a "data" of (1) the SIG's RDATA section omitting (not just
zeroing) the signature itself, (2) the entire DNS request message that
produced this response, including the request's DNS header but not its
UDP/IP header, and (3) the entire DNS response message, including DNS
header but not the UDP/IP header and before the response RR counts
have been adjusted for the inclusion of the SIG(0).</t>

<artwork align="center" type="ascii=art">
data = RDATA | full query | ( response - 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) (which is signed by the server
host key, not a zone key) 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 - 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 the 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 a response's SIG(0) check succeeds, such a transaction
authentication SIG does NOT directly authenticate the validity 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 a proper 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>
  <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, using TCP and
  maintaining a separate ID space for that TCP connection.</t>
  
</section>
</section>

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

<t>The inclusion of the SIG(0) inception and expiration time under the
signature improves resistance to replay attacks.</t>

<t>More TBD</t>

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

  <t>This document requires no IANA action.</t>

</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.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.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 RFC 2931</name>

  <ol>
    <li>Change to require KEY RRs used in connection with SIG(0) to
    have a protocol byte of 255 (ANY). RFC 2931 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>Editorial changes including updates to meet current Internet
    draft format requirements. Update references. Covert source to
    XMLv3.</li>
  </ol>
  
</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 RFC 2931, 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>
