Re: [core] Benjamin Kaduk's No Objection on draft-ietf-core-resource-directory-26: (with COMMENT)

"Christian M. Amsüss" <christian@amsuess.com> Fri, 26 February 2021 15:32 UTC

Return-Path: <christian@amsuess.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A98ED3A0BF2; Fri, 26 Feb 2021 07:32:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M0XfUKz3dWt9; Fri, 26 Feb 2021 07:32:31 -0800 (PST)
Received: from prometheus.amsuess.com (prometheus.amsuess.com [5.9.147.112]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C4E0A3A0C35; Fri, 26 Feb 2021 07:32:29 -0800 (PST)
Received: from poseidon-mailhub.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bd]) by prometheus.amsuess.com (Postfix) with ESMTPS id B2DCE4008A; Fri, 26 Feb 2021 16:32:27 +0100 (CET)
Received: from poseidon-mailbox.amsuess.com (poseidon-mailbox.amsuess.com [IPv6:2a02:b18:c13b:8010:a800:ff:fede:b1bf]) by poseidon-mailhub.amsuess.com (Postfix) with ESMTP id 5FF15D3; Fri, 26 Feb 2021 16:32:26 +0100 (CET)
Received: from hephaistos.amsuess.com (unknown [IPv6:2a02:b18:c13b:8010:75d0:c9b0:c6c2:2ab5]) by poseidon-mailbox.amsuess.com (Postfix) with ESMTPSA id 2225B14E; Fri, 26 Feb 2021 16:32:26 +0100 (CET)
Received: (nullmailer pid 1691897 invoked by uid 1000); Fri, 26 Feb 2021 15:32:25 -0000
Date: Fri, 26 Feb 2021 16:32:25 +0100
From: "Christian M. Amsüss" <christian@amsuess.com>
To: Benjamin Kaduk <kaduk@mit.edu>
Cc: The IESG <iesg@ietf.org>, draft-ietf-core-resource-directory@ietf.org, core-chairs@ietf.org, core@ietf.org, jaime@iki.fi, jaime.jimenez@ericsson.com
Message-ID: <YDkUiTAo0YlEOMfw@hephaistos.amsuess.com>
References: <161301561820.4693.9535939287401361803@ietfa.amsl.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="c/tqedRag0XcgZzl"
Content-Disposition: inline
In-Reply-To: <161301561820.4693.9535939287401361803@ietfa.amsl.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/4-T8Wf8uw_XLAY1U6D0prQyg9L0>
Subject: Re: [core] Benjamin Kaduk's No Objection on draft-ietf-core-resource-directory-26: (with COMMENT)
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Feb 2021 15:32:34 -0000

Hello Ben,

thanks for the updates.

All but the last have, if any, editorial changes pending in the issue
tracker; on that certificates point I could use a short "yes that's what
I meant" or other suitable answer.

> [...], but seems to rather just be relating to the RD faithfully
> disseminating the information the RD retrieved from /.well-known/core
> discovery on the given server(s) (or otherwise learned via some other
> mechanism).
> In this sense the RD is just acting as a cache or efficiency aid, but
> the authoritative source of the information remains (in general) the
> server hosting the resource.  To be clear, I think the procedures that
> this document specifies are good and correct procedures for a client to
> perform, I'm just not sure whether "authorized" is the right term in
> these cases; "authoritative" might be more appropriate, in that the
> operation in question is to verify the information retrieved from the RD
> (which acts in some sense as an intermediary) at the more authoritative
> source.

To get these fine points right I think I'd need an updated security
glossary and a generally more aligned CoRE terminology on authority and
information sources.

IMO the right place for this is the further discussion on how to do
better in the space between "trust the RD" and "ask again". The
continuing work on CoRAL at https://github.com/core-wg/coral/issues/59
is a starting point.

>    [...]  For some time during this document's development, the URI
>    template "/.well-known/core{?ep,...}" has been in use instead.
> 
> (It's not entirely clear to me what the reader is expected to do with
> the information about the previous formulation.)

New readers can take it as a curious historical note -- but even though
a rought survey indicated that all implementations are straightforward
to upgrade, we might have missed some that took this mechanism that sat
there stable for most of the lifetime of this document for stable and
deployed based on it. For those cases, this gives the RD operator who
finds themselves confused by such a POST the hint to find where things
went wrong.

>    *  If neither is present, a reference to the security session itself
>       is stored.  With (D)TLS, that is the connection itself, or the
>       session resumption information if available.  With OSCORE, that is
>       the security context.
> 
> Should we talk about whether the lifetime of registration entries is
> related to the various lifetimes of these credentials/identifiers?  DTLS
> without resumption is perhaps an interesting case, in that keeping the
> DTLS association "live" just to be able to update the registration
> information seems impractical, so perhaps some fixed cap would be
> applied on the lifetime in that case.  If resumption is used, the
> resumption information (ticket or session state) has some finite
> lifetime that could be used to bound the lifetime of the registration.
> IIRC an OSCORE security context can also have an expiration time;
> certificates and JWT/CWT have expiration time as well (though the
> procedures in the first bullet point would effectively allow a "renewal"
> operation), but the validity period (if any) of a raw public key would
> have to be provisioned along with that key (or just have RPK be handled
> akin to DTLS without resumption, I guess).

For DTLS, I expect that this is either done with resumption in mind, or
on connections that are kept alive for other reasons (like the proxying
from resource-directory-extensions). When resumption is used, the finite
lifetime of the ticket does not give an automatic limit to the
permissible lifetime, for (AFAIK) a new ticket can be obtained.

If lifetime limits base on the authorization are, they should be applied
consistently not only to first-come-first-remembered, but also to other
time-limited authorizations and other circumstances (eg. RDs that only
take long-lived registrations from specially authorized registrants like
CTs). 

These are, in general, hard for the device to act on -- its choices are
to not be discoverable (which, in models like LwM2M makes them not even
available for reconfiguration) or to spend more resources for keepalives
than it is configured to (which we currently have no means to express;
core-problem-details would help here).

Under those considerations, I expect that the RD taking the registration
even with a longer-than-comfortable-or-realistic lifetime is usually the
best option and should thus be the generally expected way of operation.
Other modes can be explored as well, and I've taken this up in the
resource-directory-extensions collection (but can't promise that
anything will come of it).

> Section 7.3
> 
>    In this case, the endpoint (and not the lookup clients) needs to be
>    careful to check the RD's authorization.
> 
> (It seems that something also needs to cause the RD to check the
> authorization of lookup clients to receive the information in question,
> which might be worth reiterating in this section.)

Queued for updated text as "The RD (always, but especially here) then
needs to verify any lookup client's authorization before reveling this
information directly (in resource lookup) or indirectly (when using it
to satisfy a resource lookup search criterion)".

> Section 7.5
> 
>    *  If the client's credentials indicate any subject name that is
>       certified by any authority which the RD recognizes (which may be
>       the system's trust anchor store), all those subject names are
>       stored.  [...]
> 
> I'm pretty sure the intent here is that only the subject names that are
> certified by the recognized authority(ies) are stored, in which case I'd
> suggest to s/all those/all such/.

Good point, queued up.

>       With X.509 certificates, the Common Name (CN) and the complete
>       list of SubjectAltName entries are stored.  In both cases, the
>       authority that certified the claim is stored along with the
>       subject, as the latter may only be locally unique.
> 
> (I can understand why the "store the whole list" logic is used, though
> there may be some subtleties about name constraints on the (X.509) CAs
> used, which is why we typically don't recomment treating the entire list
> of names in the certificate as validated from a single operation,
> instead preferring "is this certificate authenticated for this specific
> name?" when the specific target name is available.)
>
> [...]
>
> (Similar to my earlier parenthetical comment, the requirement for exact
> match of all subject name information is unusual.  In effect this is a
> way of pinning the set of names that the CA has chosen to include in a
> single certificate, which is arguably a stronger requirement than needed
> but should not lead to any unauthorized access.)

Not sure I get this right -- would

    If the client's credentials indicate any subject name that is
    certified by any authority which the RD recognizes **for that name**
    (which may be the system's trust anchor store), all those subject
    names are stored." 

be a suitable resolution?

I'd prefer to stick with the possibly suboptimal but at any rate easy to
implement rule. I expect the typical RD to be coming more from a JWT /
CWT / ACE background and not so much from an X.509 one. (Of course that
may be just my personal angle speaking). "Match all" is hard to get
wrong, even if it may be a tad stricter than absolutely necessary.

If we can phrase the rule better in a concise form that is still easy to
understand for implementers, let's get this last point right --
other than that, there can still be documented variations on this
policy.


BR
Christian

-- 
To use raw power is to make yourself infinitely vulnerable to greater powers.
  -- Bene Gesserit axiom