Re: [dnssd] Roman Danyliw's Discuss on draft-ietf-dnssd-srp-22: (with DISCUSS and COMMENT)

Ted Lemon <mellon@fugue.com> Fri, 04 August 2023 22:24 UTC

Return-Path: <mellon@fugue.com>
X-Original-To: dnssd@ietfa.amsl.com
Delivered-To: dnssd@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B78A3C151534 for <dnssd@ietfa.amsl.com>; Fri, 4 Aug 2023 15:24:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.662
X-Spam-Level:
X-Spam-Status: No, score=-0.662 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, NUMERIC_HTTP_ADDR=1.242, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=fugue-com.20221208.gappssmtp.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hrek6IuaLiBs for <dnssd@ietfa.amsl.com>; Fri, 4 Aug 2023 15:23:56 -0700 (PDT)
Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com [IPv6:2607:f8b0:4864:20::c36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2298DC151520 for <dnssd@ietf.org>; Fri, 4 Aug 2023 15:23:55 -0700 (PDT)
Received: by mail-oo1-xc36.google.com with SMTP id 006d021491bc7-56c87f89178so1791069eaf.1 for <dnssd@ietf.org>; Fri, 04 Aug 2023 15:23:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fugue-com.20221208.gappssmtp.com; s=20221208; t=1691187835; x=1691792635; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QWrTIF4ERsUkL7Qerw6KnnaSw9QrmJKzTgEO9TZ6fAQ=; b=0i+5nKtx1wRupUhI+8kvrgt4C+j2rONIqbFl5xswTZHpqqEGg4/2W371WRCJwRho91 3AT2YdpkB5zgRQdBhtwB3qfoDKh/iRkIVmiS99s2Q/g86dU6iugWw9tRON4HN58MxVJm HgBPMK+6LT4iqjdYgw8q3y+0TKTOywQgPaOT79u1+kspyJAae/kKIEygPOFhSeFoZNbh VQgW4yxmJOVHwmsM2yv0jtCCc+TlwIUcgMlW8d1vfNCKXQJlXK0oyqW+CeS7nHmUCTwa 4DemOZHnv1zVCnSy1YWGK/F1TWx3AyhzL65smaA0zAm4EqRHWndR9dNi6EOgd4RHt2K6 w4IA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691187835; x=1691792635; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QWrTIF4ERsUkL7Qerw6KnnaSw9QrmJKzTgEO9TZ6fAQ=; b=e0UB86kquPuUuppfo37XRfniNsXcl+UERf/X+4CjMptbGWGdlZkjhPkTEK5sWGfz9/ KUyavUdOMhMe+wYabZh2H+qJ7YTcPYd0z3ZDuGzwcB3t2nitqszter6Tu2WVDZWgRurG rD6sPPpqMvvvFdqEFcbE/S52OiIYyD3uHA9U5mM0UgzHEfF1CB2YT504uGQRbkZKWCy2 0JkWQeb79oVWWSaM6YsoNhuCqF6wRDOBPXIhO2rKu9cIvQqD0okbZUIbzFf/Vz8CBe1T +egh1IoVGy2N5+vEyaMmRLJe3sTQbNU9IgUyqzomOknNiulRW8ducuQUkGwx9oivWgyi hJnw==
X-Gm-Message-State: AOJu0YywIsn4fGv9nLFJV5bjCNsb6HIsf/Os3YAtm+55LnlxF6i0tcJx iuk++cqJeMG5A57gFHT9zeHufsVn0xqqs6Zh5gVv+A==
X-Google-Smtp-Source: AGHT+IF6Ccgc3FUC7XU5xa6B/ZEmMZUo3kCAdCXc3mtx2ArG0gBMoMv76g05kn8IoH5BVVPFr3hrpiws6JHbmM/xQVE=
X-Received: by 2002:a05:6358:5287:b0:134:df7f:4093 with SMTP id g7-20020a056358528700b00134df7f4093mr3705836rwa.17.1691187834590; Fri, 04 Aug 2023 15:23:54 -0700 (PDT)
MIME-Version: 1.0
References: <168916947029.35616.7617672137943670782@ietfa.amsl.com>
In-Reply-To: <168916947029.35616.7617672137943670782@ietfa.amsl.com>
From: Ted Lemon <mellon@fugue.com>
Date: Fri, 04 Aug 2023 15:23:18 -0700
Message-ID: <CAPt1N1mEsR4h_PFyJBRd4Tvrjy+3PLpWkxiiRvSBi+Ro0P0HzA@mail.gmail.com>
To: Roman Danyliw <rdd@cert.org>
Cc: The IESG <iesg@ietf.org>, draft-ietf-dnssd-srp@ietf.org, dnssd-chairs@ietf.org, dnssd@ietf.org, dschinazi.ietf@gmail.com
Content-Type: multipart/alternative; boundary="00000000000021362d0602205a7d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dnssd/tjfqY9HYNsFUqJCR0VfJhHBEvsY>
Subject: Re: [dnssd] Roman Danyliw's Discuss on draft-ietf-dnssd-srp-22: (with DISCUSS and COMMENT)
X-BeenThere: dnssd@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Discussion of extensions to DNS-based service discovery for routed networks." <dnssd.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dnssd>, <mailto:dnssd-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dnssd/>
List-Post: <mailto:dnssd@ietf.org>
List-Help: <mailto:dnssd-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dnssd>, <mailto:dnssd-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 04 Aug 2023 22:24:01 -0000

On Wed, Jul 12, 2023 at 6:44 AM Roman Danyliw via Datatracker <
noreply@ietf.org> wrote:

> ** Documenting the risk of malicious, internal clients
>
> -- Section 1.
>
>    This is considered reasonably safe because it requires physical
>    presence on the network in order to advertise.
>
> -- Section 6.1.
>    SRP Updates have no authorization semantics other than FCFS.  This
>    means that if an attacker from outside of the administrative domain
>    of the registrar knows the registrar's IP address, it can in
>    principle send updates to the registrar that will be processed
>    successfully.
>
> The Security Considerations and introductory framing go to great lengths to
> helpfully describe the risk of malicious registrations from outside of the
> administrative domain.  However, I am unable to find any discussion of the
> risks malicious clients inside the administrative domain pose.  Is this a
> perimeter-based security model (trust everything once insider the
> network)?
> After initial compromise, a compromised system could register information
> that
> would support the steering of traffic to servers controlled by this
> attacker.
>
> I scanned how RFC6763, RFC3007, RFC2136 and RFC2137 handle it.  As an
> aside,
> note that none of their Security Considerations are said to be applicable.
> Section 5 of RFC2137 reminds us that dynamically configured domains are
> inherently less secure. Section 8.1 of RFC2136 comes closest with a
> mitigation
> of using IPsec, but it isn’t clear that is desired here.
>

The security model is explicitly discussed in Section  3.2.4, "How to
Secure It." We explicitly address your question in the second paragraph:

The goal of securing the DNS‑SD Registration Protocol is to provide the
best possible security given the constraint that service registration has
to be automatic. It is possible to layer more operational security on top
of what we describe here, but FCFS naming is already an improvement over
the security of mDNS.

The reality is that service registration is similar to things like router
advertisements. If I can send a router advertisement on the local network,
I can tell you what DNS resolver to use, and thereby advertise services to
you with no authentication at all. I can do the same with mDNS.
Fundamentally, what allows a device to advertise services on the network is
that the user connected the device to the network, and the network isn't
blocking traffic that would serve to advertise such services. There are
interesting problems to solve in the "add devices to the network" space,
but that's outside the scope of this document and indeed outside of the
charter of the working group. Fundamentally what we wanted here was an
improvement over the status quo ante, and I believe that's what we have.

It looks like section 6.1, "Source validation" actually talks about some of
the other risks in the area that you're concerned about, and that may have
been less obvious because of the too-narrow section heading. I've made the
following clarifications in the security considerations section which I
hope address this:

@@ -771,6 +771,9 @@
          on routers <xref target="RFC2827"/>. This would ordinarily be
accomplished by measures such as are described in
          <xref target="RFC7084" section="4.5" sectionFormat="of"/></t>

+      </section>
+      <section>
+       <name>Other DNS updates</name>
        <t>Note that these rules only apply to the validation of SRP
Updates.
          A server that accepts updates from SRP
          requestors may also accept other DNS updates, and those DNS
updates may be validated
@@ -783,7 +786,9 @@
          the service registration information with information provided by
an authenticated DNS update requestor.  An implementation
          that allows both kinds of updates should not allow DNS Update
requestors that are using different authentication and
          authorization credentials to update records added by SRP
requestors.</t>
-
+      </section>
+      <section>
+       <name>Risks of allowing arbitrary names to be registered in SRP
updates</name>
        <t>It is possible to set up SRP updates for a zone that is used for
non-DNSSD services. For example, imagine that you set
          up SRP service for example.com. SRP hosts can now register names
like "www" or "mail" or "smtp" in this domain. In addition,
          SRP updates using FCFS naming can insert names that are obscene
or offensive into the zone. There is no simple solution to
@@ -799,6 +804,18 @@
            names are generally available, or can be constructed
manually.</li>
        </ul>
       </section>
+      <section>
+       <name>Security of local service discovery</name>
+       <t>Local links can be protected by managed services such as RA
Guard <xref target="RFC6105"/>, but multicast services like
+         DHCP <xref target="RFC21321"/>, DHCPv6 <xref target="RFC8415"/>
and IPv6 Neighbor Discovery <xref target="RFC4861"/> are
+         most commonly unauthenticated and can't be controlled on
unmanaged networks, such as home networks and small-office
+         networks where no network management staff are present. In such
situations, an SRP service is actually more limited in
+         terms of security risks. This is discussed in more detail in
<xref target="how-to-secure"/>. The fundamental protection
+         for networks of this type is the user's choice of what devices to
add to the network. Work is being done in other
+         working groups and standards bodies to improve the state of the
art for network on-boarding and device isolation (e.g.,
+         <xref target="RFC8520"/> provides a means for constraining what
behaviors are allowed for a device in an automatic way),
+         but such work is out of scope for this document.</t>
+      </section>


** Section 1.
>    So we can only publish information that we feel safe in publishing
>    even though we do not have any basis for trusting the requestor.
>
> What is the basis of considering particular information “safe”?
>

The reasoning is explained here:

We reason that mDNS [RFC6762] allows arbitrary hosts on a single IP link to
advertise services [RFC6763], relying on whatever service is advertised to
provide authentication.

This is considered reasonably safe because it requires physical presence on
the network in order to advertise. An off-network mDNS attack is simply not
possible. Our goal with this specification is to impose similar
constraints. Because of this you will see in Section 3.3.1 that a very
restricted set of records with a very restricted set of relationships are
allowed. You will also see in Section 6.1 that we give advice on how to
prevent off-network attacks.


 Perhaps you are objecting to the word "safe," and I can't really say you
are wrong to so object, but what we mean by "safe" here is "we aren't
making things worse, and actually are making things a bit better."

** Section 3.1.2.  Editorial
>    ... the (proposed) special-
>    use domain name (see [RFC6761]) "default.service.arpa" is used.
>
> Remove “(proposed)” as this will be approved by the time the document is
> an RFC.
>

OK


> ** Section 3.1.2
>    In
>    other network environments, updates for names ending in
>    "default.service.arpa" may be rewritten internally to names with
>    broader visibility.
>
> How would a constrained client know which names in default.services.arpa to
> rewrite and which ones it should not?
>

Proposed fix:

-            visibility.  In other network environments, updates for names
ending in "default.service.arpa" may be rewritten internally
+            visibility.  In other network environments, updates for names
ending in "default.service.arpa" may be rewritten by the registrar


> ** Section 3.1
> Networks that are not constrained networks can have more complicated
>    topologies at the IP layer.
> ...
>
>    This creates the possibility of off-
>    network spoofing, where a device from a foreign network registers a
>    service on the local network in order to attack devices on the local
>    network.  To prevent such spoofing, TCP is required for such
>    networks.
>
> -- Is a registrar supposed to reject UDP based traffic when it thinks it is
> operating in a non-constrained environment?

-- Is it possible to for unconstrained and constrained nodes to use the same
> registrar?  If so, how would the registrar know the node type per each
> request
> (so it could reject UDP)?
>

I've updated the relevant paragraph as follows:

        <t>For UDP updates from constrained devices, spoofing would have to
be prevented with appropriate source address filtration
          on routers <xref target="RFC2827"/>. This would ordinarily be
accomplished by measures such as are described in
-         <xref target="RFC7084" section="4.5" sectionFormat="of"/></t>
-
+         <xref target="RFC7084" section="4.5" sectionFormat="of"/>. For
example, a stub router <xref target="draft-ietf-snac-simple"/>
+         for a constrained network might only accept UDP updates from
source addresses known to be on-link on that stub network, and might
+         further validate that the UDP update was actually received on the
stub network interface and not the interface connected to
+         the adjacent infrastructure link.</t>


** Section 3.2.4.1
>    a server that registers its service using DNS-SD Registration
>    protocol is given ownership of a name for an extended period of time
>    based on the key used to authenticate the DNS Update.
>
> Is it the key, or the lease lifetime requested when “registering” the key?
>

Oh, hah. This is a bare key, so it doesn't have a lifetime associated with
it, but this is probably worth clarifying! :)

Changed it to:

              First-Come First-Serve naming provides a limited degree of
security: a server that registers its service using
              DNS&nbhy;SD Registration protocol is given ownership of a
name for an extended period of time based on a lease
              specific to the key used to authenticate the DNS Update,
which may be longer than the lease associated with the
              registered records.

** Section 3.2.5.1
>    if there is no
>    writable stable storage on the SRP requestor, the SRP requestor MUST
>    be pre-configured with a public/private key pair in read-only storage
>    that can be used.  This key pair MUST be unique to the device.  A
>    device with rewritable storage should retain this key indefinitely.
>    When the device changes ownership, it may be appropriate to erase the
>    old key pair and install a new one.
>
> Thanks for discussing the issues around key management.
>
> -- In the case of compromised device with read-write storage, it seems
> like the
> key MUST be regenerated.
>
> -- What is the proposed behavior for a compromised device with read-only
> storage?
>
> -- In what cases would it NOT be appropriate to erase the key when the
> device
> changes ownership?
>

The document doesn't really talk about what to do when the device is
compromised. FWIW, these keys in their use in SRP aren't controlling
anything very dire. If you transfer the device to a new owner, the new
owner could only abuse the key by gaining access to the network to which it
was formerly connected and register it under the same key, or use the key
to register some other service on the network. Given that the trust
relationship for the device is out of scope for this document, I think that
more detail on this concern is also out of scope. My expectation is that a
commissioning protocol/process would take care of this sort of thing.

I would be worried if this key were being used for authenticating something
other than SRP updates, however, so I've added the following:

    The policy described here for managing keys assumes that the keys are
only used for SRP. If a key that is used for SRP
     is also used for other purposes, the policy described here is likely
to be insufficient. The policy stated here should
     not be applied in such a situation: a policy appropriate to the full
set of uses for the key must be chosen. Specifying
     such a policy is out of scope for this document.</t>


> ** Section 3.2.5.*  It appears field experience of some kind if being cited
> (with the use of “typically”).  Can it be cited?  Is this typical behavior
> recommended?
>
> -- Section 3.2.5.2: “There is no specific requirement for how this is
> done;
> typically, however, the requestor will append a number to the  referred
> name.“
>
> -- Section 3.2.5.3: “The lifetime of the DNS-SD PTR, SRV, A, AAAA and TXT
> records [RFC6763] uses the LEASE field of the Update Lease option, and is
> typically set to two hours.”
>
> Is this 2 hour lease time a recommended or default value?
>
> -- Section 3.2.5.3: “The lifetime of the KEY records is set using the
> KEY-LEASE
> field of the Update Lease Option, and should be set to a much longer time,
> typically 14 days.”
>
> Is 14 days a recommended value?



> Section 5.1 later says “A default limit of two hours for the Lease and 14
> days
> for the SIG(0) KEY are currently thought to be good choices.”
>

This spec defines a mechanism. Defining policies is out of scope. The
reason we were so vague is that we do not feel qualified to be less vague.
How implementations determine key lifetimes is likely to be dependent on
the context. For example, what is the "recommended" TTL for a DNS AAAA
record? I can give you some examples of how it is typically used, but I
don't think that adds value here—it feels like it would just be confusing.


> ** Section 6.1
>    Registrars should therefore be configured to reject
>    updates from source addresses outside of the administrative domain of
>    the registrar.
>
> What are the circumstances under which registrars would not reject updates
> outside of the administrative domain?  Why isn’t s/should therefore be
> configured/MUST be configured/
>

Again, you're asking us to make definite policy statements. The reason we
say "should" here is that we expect the implementor and/or operator to
follow the recommendations we have given unless they have some good reason
not to.


> ** Section 6.1
>    This would ordinarily be accomplished by measures such as
>    are described in Section 4.5 of [RFC7084]
>
> Is there IPv4 guidance?  This reference only discusses IPv6 routers.
>

The section we are referencing here points to BCP 38, which covers IPv4 and
IPv6, so I think we're okay here.


> ** Section 8.2
>    It is not possible
>    to register a PKI certificate for a subdomain of 'service.arpa.'
>    because it is a locally-served domain name.
>
> Is this saying that one couldn’t get a PKI certificate from a public CA
> (as in,
> for the Web PKI/CAB Forum-compliant CA)?  Couldn’t an administrative domain
> running its own CA to issue certificates with these names, especially since
> this shouldn’t be an internet exposed service.
>

That won't work, because the name isn't globally unique. As a device roams
from one administrative domain to another, things will work in exactly one
such domain if such a CA is being operated. This is way, way out of scope.
The only reason we're talking about this here is because IANA insisted that
we add this text. If it were up to me we'd delete most of this section. We
aren't forbidding something here that we ought not to forbid: an
administrative domain that wants to have PKI on an internal domain should
use an internal domain that is part of the global namespace (e.g.
silicon-valley.example.com, for a company whose public domain name is
example.com). They should not use a name that is not globally unique.

Anyway, thanks for the review! I hope these proposed changes and responses
sufficiently address your concerns. Was nice to talk to you f2f in San
Francisco! :)