<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-ietf-dnsop-cds-consistency-04" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" updates="7344, 7477" consensus="true">

<front>
<title abbrev="cds-consistency">Consistency for CDS/CDNSKEY and CSYNC is Mandatory</title><seriesInfo value="draft-ietf-dnsop-cds-consistency-04" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="P." surname="Thomassen" fullname="Peter Thomassen"><organization>SSE - Secure Systems Engineering GmbH</organization><address><postal><street>Hauptstraße 3</street>
<city>Berlin</city>
<code>10827</code>
<country>Germany</country>
</postal><email>peter.thomassen@securesystems.de</email>
</address></author>
<date year="2023" month="October" day="2"></date>
<area>Internet</area>
<workgroup>DNSOP Working Group</workgroup>

<abstract>
<t>Maintenance of DNS delegations requires occasional changes of the DS and
NS record sets on the parent side of the delegation.
RFC 7344 automates this for DS records by having the child publish
CDS and/or CDNSKEY records which hold the prospective DS parameters.
Similarly, RFC 7477 specifies CSYNC records to indicate a desired update
of the delegation's NS (and glue) records.
Parent-side entities (e.g. Registries, Registrars) typically discover
these records by querying them from the child, and then use them to
update the parent-side RRsets of the delegation accordingly.</t>
<t>This document specifies that when performing such queries, parent-side
entities MUST ensure that updates triggered via CDS/CDNSKEY and CSYNC
records are consistent across the child's authoritative nameservers,
before taking any action based on these records.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t><xref target="RFC7344"></xref> automates DNSSEC delegation trust maintenance by having the
child publish CDS and/or CDNSKEY records which hold the prospective DS
parameters.
Similarly, <xref target="RFC7477"></xref> specifies CSYNC records indicating a desired
update of the delegation's NS and associated glue records.
Parent-side entities (e.g. Registries, Registrars) can use these records
to update the corresponding records of the delegation.</t>
<t>A common method for discovering these signals is to periodically query
them from the child zone (&quot;polling&quot;).
For CSYNC, this is described in <xref target="RFC7477"></xref> Section 3.1 which advocates
limiting queries to just one authoritative nameserver.
The corresponding Section 6.1 of <xref target="RFC7344"></xref> (CDS/CDNSKEY) contains no
such provision for how specifically polling of these records should be
done.</t>
<t>Implementations are thus likely to retrieve records from just one
authoritative server, typically by directing queries towards a trusted
validating resolver.
While that may be fine if all authoritative nameservers are controlled
by the same entity (typically the Child DNS Operator), it does pose a
problem as soon as multiple providers are involved.
(Note that it is generally impossible for the parent to determine
whether all authoritative nameservers are controlled by the same
entity.)</t>
<t>In such cases, CDS/CDNSKEY/CSYNC records retrieved &quot;naively&quot; from one
nameserver only may be entirely inconsistent with those of other
authoritative servers.
When no consistency check is done, each provider may unilaterally
trigger a roll of the DS or NS record set at the parent.</t>
<t>As a result, adverse consequences can arise in conjunction with the
multi-signer scenarios laid out in <xref target="RFC8901"></xref>, both when deployed
temporarily (during a provider change) and permanently (in a redundant
multi-provider setup).
For example, a single provider may (accidentally or maliciously) cause
another provider's trust anchors and/or nameservers to be removed from
the delegation.
Similar breakage can occur when the delegation has lame nameservers.
More detailed examples are given in <xref target="scenarios"></xref>.</t>
<t>A single provider should not be in the position to remove the other
providers' records from the delegation.
To address this issue, this document specifies that parent-side entities
MUST ensure that the updates indicated by CDS/CDNSKEY and CSYNC record
sets are consistent across all of the child's authoritative nameservers,
before taking any action based on these records.</t>
<t>Readers are expected to be familiar with DNSSEC, including <xref target="RFC4033"></xref>,
<xref target="RFC4034"></xref>, <xref target="RFC4035"></xref>, <xref target="RFC6781"></xref>, <xref target="RFC7344"></xref>, <xref target="RFC7477"></xref>, and
<xref target="RFC8901"></xref>.</t>

<section anchor="requirements-notation"><name>Requirements Notation</name>
<t>The key words &quot;<bcp14>MUST</bcp14>&quot;, &quot;<bcp14>MUST NOT</bcp14>&quot;, &quot;<bcp14>REQUIRED</bcp14>&quot;,
&quot;<bcp14>SHALL</bcp14>&quot;, &quot;<bcp14>SHALL NOT</bcp14>&quot;, &quot;<bcp14>SHOULD</bcp14>&quot;, &quot;<bcp14>SHOULD NOT</bcp14>&quot;,
&quot;<bcp14>RECOMMENDED</bcp14>&quot;, &quot;<bcp14>NOT RECOMMENDED</bcp14>&quot;, &quot;<bcp14>MAY</bcp14>&quot;, and
&quot;<bcp14>OPTIONAL</bcp14>&quot; in this document are to be interpreted as described in
BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when, they appear in all
capitals, as shown here.</t>
</section>

<section anchor="terminology"><name>Terminology</name>

<dl>
<dt>Multi-provider setup:</dt>
<dd>A constellation where several providers independently operate authoritative
DNS service for a domain, usually for purposes of redundancy. This includes
setups both with and without DNSSEC.</dd>
<dt>Multi-signer setup:</dt>
<dd>A multi-provider setup for a DNSSEC-enabled domain with multiple independent
signing entities <xref target="RFC8901"></xref>. Such a setup may be permanent (for redundancy)
or temporary (for continuity of DNSSEC operation while changing the provider
of a domain that normally uses a single one).</dd>
</dl>
<t>Otherwise, the terminology in this document is as defined in <xref target="RFC7344"></xref>.</t>
</section>
</section>

<section anchor="processing-requirements"><name>Processing Requirements</name>
<t>This section defines consistency requirements for CDS/CDNSKEY/CSYNC
queries in the context of automatic delegation maintenance, updating
<xref target="RFC7344"></xref> Section 4.1 and <xref target="RFC7477"></xref> Sections 3.1 and 4.2.
Common ones are listed first, with type-specific consistency criteria
described in each subsection.</t>
<t>In all cases, consistency is REQUIRED across received responses only.
When a response cannot be obtained from a given nameserver, the Parental
Agent SHOULD attempt to obtain it at a later time, before concluding
that the nameserver is permanently unreachable and removing it from
consideration.
A retry schedule with exponential back-off is RECOMMENDED (such as after
5, 10, 20, 40, ... minutes).
To sidestep localized routing issues, the Parental Agent MAY also
attempt contacting the nameserver from another vantage point.</t>
<t>If an inconsistent state is encountered, the Parental Agent MUST abort
the operation.
Specifically, it MUST NOT delete or alter any existing RRset that would
have been deleted or altered, and MUST NOT create any RRsets that would
have been created, had the polling state been consistent.</t>
<t>To accommodate transient inconsistencies (e.g. replication delays), the
Parental Agent MAY retry the full process, repeating all queries.
A schedule with exponential back-off is RECOMMENDED.</t>
<t>Any pending queries can immediately be dequeued when encountering a
response that confirms the status quo (i.e. indicates no update).
This is because any subsequent responses could only confirm that nothing
needs to happen, or give an inconsistent result in which case nothing
needs to happen.
Queries MAY be continued across all nameservers for inconsistency
reporting purposes.</t>
<t>Existing requirements for ensuring integrity remain in effect.
In particular, DNSSEC signatures MUST be requested and validated for all
queries unless otherwise noted.</t>

<section anchor="cds-and-cdnskey"><name>CDS and CDNSKEY</name>
<t>To retrieve a Child's CDS/CDNSKEY RRset for DNSSEC delegation trust
maintenance, the Parental Agent, knowing both the Child zone name and
its NS hostnames, MUST ascertain that queries are made against all
(reachable) nameservers listed in the Child's delegation from the
Parent, and ensure that each key referenced in any of the received
answers is also referenced in all other received responses.</t>
<t>In other words, CDS/CDNSKEY records at the Child zone apex MUST be
fetched directly from each (reachable) authoritative server as
determined by the delegation's NS record set.
When a key is referenced in a CDS or CDNSKEY record set returned by
one nameserver, but is missing from a least one other nameserver's
answer, the CDS/CDNSKEY state MUST be considered inconsistent.</t>
<t>When CDS/CDNSKEY queries are performed for deploying the initial DS
record set (DNSSEC bootstrapping), responses cannot be directly
validated.
In this case, integrity checks according to <xref target="RFC8078"></xref> Section 3 (or
its successors) continue to apply.</t>
</section>

<section anchor="csync"><name>CSYNC</name>
<t>A CSYNC-based workflow generally consists of (1) querying the CSYNC (and
possibly SOA) record to determine which data records shall be synchronized from
child to parent, and (2) querying for these data records (e.g. NS), before
placing them in the parent zone.
If the below conditions are not met during these steps, the CSYNC state
MUST be considered inconsistent.</t>
<t>When querying the CYSNC record, the Parental Agent MUST ascertain that
queries are made against all (reachable) nameservers listed in the
Child's delegation from the Parent, and ensure that the record's
immediate flag and type bitmap are equal across received responses.</t>
<t>The CSYNC record's SOA serial field and soaminimum flag might
legitimately differ across nameservers (such as in multi-provider
setups); equality is thus not required across responses.
Instead, for a given response, processing of these values MUST
occur with respect to the SOA record as obtained from the same
nameserver (preferably in the same connection).
The resulting per-response assessments of whether the update is
permissible MUST match across received responses.</t>
<t>Further, when retrieving the data record sets as indicated in the CSYNC
record (such as NS or A/AAAA records), the Parental Agent MUST ascertain
that all queries are made against all nameservers from which CSYNC
responses were received (preferably in the same connection), and ensure
that all return responses with equal rdata sets (including all empty).</t>
<t>Other CSYNC processing rules from <xref target="RFC7477"></xref> Section 3 remain in place without
modification. For example, when the type bitmap contains the A/AAAA flags,
corresponding address queries are only to be sent &quot;to determine the A and AAAA
record addresses for each NS record within a NS set for the child that are in
bailiwick&quot;, while out-of-bailiwick NS records are ignored. Also, when the NS
type flag is present, associated NS queries and consistency checks are to be
performed before any address queries to ensure &quot;that the right set of NS records
is used as provided by the current NS set of the child&quot;. (Quotes from
<xref target="RFC7477"></xref> Section 3.2.2; see also Section 4.3.)</t>
<t>CSYNC-based updates may cause validation or even insecure resolution to break
(e.g. by changing the delegation to a set of nameservers that do not
serve required DNSKEY records or do not know the zone at all).
Parental Agents SHOULD check that CSYNC-based updates, if applied, do not
break the delegation.</t>
</section>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document has no IANA actions.</t>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>The level of rigor mandated by this document is needed to prevent
publication of half-baked DS or delegation NS RRsets (authorized only
under an insufficient subset of authoritative nameservers), ensuring
that an operator in a (functioning) multi-provider setup cannot
unilaterally modify the delegation (add or remove trust anchors or
nameservers).
This applies both when the setup is intentional and when it is
unintentional (such as in the case of lame delegation hijacking).</t>
<t>As a consequence, the delegation's records can only be modified when
there is consensus across operators, which is expected to reflect the
domain owner's intentions.
Both availability and integrity of the domain's DNS service benefit from
this policy.</t>
<t>In order to resolve situations in which consensus about child zone
contents cannot be reached (e.g. because one of the nameserver
providers is uncooperative), Parental Agents SHOULD continue to accept
DS and NS/glue update requests from the domain owner via an
authenticated out-of-band channel (such as EPP <xref target="RFC5730"></xref>),
irrespective of the rise of automated delegation maintenance.
Availability of such an interface also enables recovery from a situation
where the private key is no longer available for signing the CDS/CDNSKEY
or CSYNC records in the child zone.</t>
</section>

<section anchor="acknowledgments"><name>Acknowledgments</name>
<t>David Blacka, Viktor Dukhovni, Wes Hardaker, Libor Peltan, Oli Schacher</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4033.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4034.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4035.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5730.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7344.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7477.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8078.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="LAME1" target="http://dx.doi.org/10.1145/3419394.3423623">
  <front>
    <title>Unresolved Issues</title>
    <author fullname="Gautam Akiwate" surname="Akiwate">
      <organization>UC San Diego</organization>
    </author>
    <author fullname="Mattijs Jonker" surname="Jonker">
      <organization>University of Twente</organization>
    </author>
    <author fullname="Raffaele Sommese" surname="Sommese">
      <organization>University of Twente</organization>
    </author>
    <author fullname="Ian Foster" surname="Foster">
      <organization>DNS Coffee</organization>
    </author>
    <author fullname="Geoffrey M. Voelker" surname="Voelker">
      <organization>UC San Diego</organization>
    </author>
    <author fullname="Stefan Savage" surname="Savage">
      <organization>UC San Diego</organization>
    </author>
    <author fullname="KC Claffy" surname="Claffy">
      <organization>CAIDA/UC San Diego</organization>
    </author>
    <author>
      <organization>ACM</organization>
    </author>
    <date year="2020" month="October" day="27"></date>
  </front>
  <seriesInfo name="DOI" value="10.1145/3419394.3423623"></seriesInfo>
</reference>
<reference anchor="LAME2" target="http://dx.doi.org/10.1145/3487552.3487816">
  <front>
    <title>Risky BIZness</title>
    <author fullname="Gautam Akiwate" surname="Akiwate">
      <organization>UC San Diego</organization>
    </author>
    <author fullname="Stefan Savage" surname="Savage">
      <organization>UC San Diego</organization>
    </author>
    <author fullname="Geoffrey M. Voelker" surname="Voelker">
      <organization>UC San Diego</organization>
    </author>
    <author fullname="K C Claffy" surname="Claffy">
      <organization>CAIDA/UC San Diego</organization>
    </author>
    <author>
      <organization>ACM</organization>
    </author>
    <date year="2021" month="November" day="2"></date>
  </front>
  <seriesInfo name="DOI" value="10.1145/3487552.3487816"></seriesInfo>
</reference>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6781.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8901.xml"/>
</references>

<section anchor="scenarios"><name>Failure Scenarios</name>
<t>The following scenarios are examples of how things can go wrong when
consistency is not enforced by the parent during CDS/CDNSKEY/CSYNC
processing.
Other scenarios that cause similar (or perhaps even more) harm may
exist.</t>
<t>The common feature of these scenarios is that if one nameserver steps
out of line and the parent is not careful, DNS resolution and/or
validation will break down. When several DNS providers are involved,
this undermines the very guarantees of operator independence that
multi-provider configurations are expected to provide.</t>

<section anchor="ds-breakage-due-to-replication-lag"><name>DS Breakage due to Replication Lag</name>
<t>If an authoritative nameserver is lagging behind during a key rollover,
the parent may see different CDS/CDNSKEY RRsets depending on the
nameserver contacted. This may cause old and new DS RRsets to be
deployed in an alternating fashion. The zone maintainer, having detected
that the DS deployment was successful, may then confidently remove the
old DNSKEY from the zonefile, only to find out later that the DS RRset
has been turned back, breaking the delegation's DNSSEC chain of trust.</t>
<t>Checking for consistency minimizes this risk. In case the parent reports
consistency errors downstream, it can also help detect the replication
issue on the child side.</t>
</section>

<section anchor="escalation-of-lame-delegation-takeover"><name>Escalation of Lame Delegation Takeover</name>
<t>A delegation may include a non-existent NS hostname, for example due to
a typo or when the nameserver's domain registration has expired.
(Re-)registering such a non-resolvable nameserver domain allows a third
party to run authoritative DNS service for all domains delegated to that
NS hostname, serving responses different from those in the legitimate
zonefile.</t>
<t>This strategy for hijacking (at least part of the) DNS traffic and
spoofing responses is not new, but surprisingly common <xref target="LAME1"></xref><xref target="LAME2"></xref>.
It is also known that DNSSEC reduces the impact of such an attack,
as validating resolvers will reject illegitimate responses due to lack
of signatures consistent with the delegation's DS records.</t>
<t>On the other hand, if the delegation is not protected by DNSSEC, the
rogue nameserver is not only able to serve unauthorized responses
without detection; it is even possible for the attacker to escalate the
nameserver takeover to a full domain takeover.</t>
<t>In particular, the rogue nameserver can publish CDS/CDNSKEY records.
If those are processed by the parent without ensuring consistency with
other authoritative nameservers, the delegation will, with some patience, get
secured with the attacker's DNSSEC keys. Of course, as the parent’s query (or
sometimes queries) need to hit the attacker's nameserver, this requires some
statistical luck; but eventually it will succeed.
As responses served by the remaining legitimate nameservers are not
signed with these keys, validating resolvers will start rejecting them.</t>
<t>Once DNSSEC is established, the attacker can use CSYNC to remove other
nameservers from the delegation at will (and potentially add new ones
under their control).
This enables the attacker to position themself as the only party
providing authoritiative DNS service for the victim domain,
significantly augmenting the attack's impact.</t>
</section>

<section anchor="multi-provider-permanent-multi-signer"><name>Multi-Provider (Permanent Multi-Signer)</name>

<section anchor="ds-breakage"><name>DS Breakage</name>
<t>While performing a key rollover and adjusting the corresponding
CDS/CDNSKEY records, a provider could accidentally publish CDS/CDNSKEY
records that only include its own keys.</t>
<t>When the parent happens to retrieve the records from a nameserver
controlled by this provider, the other providers' DS records would be
removed from the delegation.
As a result, the zone is broken at least for some queries.</t>
</section>

<section anchor="ns-breakage"><name>NS Breakage</name>
<t>A similar scenario affects the CSYNC record, which is used to update the
delegation's NS record set at the parent.
The issue occurs, for example, when a provider accidentally includes
only their own set of hostnames in the local NS record set, or publishes
an otherwise flawed NS record set.</t>
<t>If the parent then observes a CSYNC signal and fetches the flawed NS
record set without ensuring consistency across nameservers, the
delegation may be updated in a way that breaks resolution or silently
reduces the multi-provider setup to a single-provider setup.</t>
</section>
</section>

<section anchor="bogus-provider-change-temporary-multi-signer"><name>Bogus Provider Change (Temporary Multi-Signer)</name>
<t>Transferring DNS service for a domain name from one (signing) DNS
provider to another, without going insecure, necessitates a brief period
during which the domain is operated in multi-signer mode:
First, the providers include each other's signing keys as DNSKEY and
CDS/CDNSKEY records in their copy of the zone.
Once the parent detects the updated CDS/CDNSKEY record set at the old
provider, the delegation's DS record set is updated.
Then, after waiting for cache expiration, the new provider's NS
hostnames can be added to the zone's NS record set, so that queries
start balancing across both providers.
(To conclude the hand-over, the old provider is removed by inverting
these steps with swapped roles.)</t>
<t>The multi-signer phase of this process breaks when the new provider,
perhaps unaware of the situation and its intricacies, fails to include
the old provider's keys in the DNSKEY (and CDS/CDNSKEY) record sets.
One obvious consequence of that is that whenever the resolver happens to
retrieve the DNSKEY record set from the new provider, the old provider's
RRSIGs do no longer validate, causing SERVFAIL to be returned.</t>
<t>However, an even worse consequence can occur when the parent performs
their next CDS/CDNSKEY scan:
It may then happen that the incorrect CDS/CDNSKEY record set is fetched
from the new provider and used to update the delegation's DS record set.
As a result, the old provider (who still appears in the delegation) is
prematurely removed from the domain's DNSSEC chain of trust.
The new DS record set authenticates the new provider's DNSKEYs only, and
DNSSEC validation fails for all answers served by the old provider.</t>
</section>
</section>

<section anchor="change-history-to-be-removed-before-publication"><name>Change History (to be removed before publication)</name>

<ul>
<li>draft-ietf-dnsop-cds-consistency-04</li>
</ul>
<blockquote><t>Clarify that existing CSYNC NS and glue processing rules remain in place</t>
<t>Editorial changes</t>
<t>Clean up &quot;multi-homing&quot; and define &quot;multi-provider&quot;/&quot;multi-signer&quot;</t>
</blockquote>
<ul>
<li>draft-ietf-dnsop-cds-consistency-03</li>
</ul>
<blockquote><t>Clarify that CSYNC updates should not break delegations</t>
<t>Describe consistency requirements for CSYNC soaminimum</t>
<t>Editorial changes</t>
</blockquote>
<ul>
<li>draft-ietf-dnsop-cds-consistency-02</li>
</ul>
<blockquote><t>Retry before assuming a nameserver is permanently unreachable</t>
</blockquote>
<ul>
<li>draft-ietf-dnsop-cds-consistency-01</li>
</ul>
<blockquote><t>Make nits tool happy</t>
<t>New failure mode: DS Breakage due to Replication Lag</t>
<t>Point out zero overhead if nothing changed, and need for OOB interface</t>
<t>Editorial changes</t>
<t>Moved Failure Scenarios to appendix</t>
</blockquote>
<ul>
<li>draft-ietf-dnsop-cds-consistency-00</li>
</ul>
<blockquote><t>Point out zero overhead if nothing changed, and need for OOB interface</t>
<t>Editorial changes.</t>
</blockquote>
<ul>
<li>draft-thomassen-dnsop-cds-consistency-03</li>
</ul>
<blockquote><t>Describe risk from lame delegations</t>
<t>Acknowledgments</t>
<t>Say what is being updated</t>
<t>Editorial changes.</t>
<t>Retry mechanism to resolve inconsistencies</t>
</blockquote>
<ul>
<li>draft-thomassen-dnsop-cds-consistency-02</li>
</ul>
<blockquote><t>Don't ignore DoE responses from individual nameservers (instead,
  require consistency across all responses received)</t>
</blockquote>
<ul>
<li>draft-thomassen-dnsop-cds-consistency-01</li>
</ul>
<blockquote><t>Allow for nameservers that don't respond or provide DoE (i.e. require
  consistency only among the non-empty answers received)</t>
<t>Define similar requirements for CSYNC.</t>
<t>Editorial changes.</t>
</blockquote>
<ul>
<li>draft-thomassen-dnsop-cds-consistency-00</li>
</ul>
<blockquote><t>Initial public draft.</t>
</blockquote></section>

</back>

</rfc>
