Re: [Rats] [Iot-directorate] Iotdir last call review of draft-ietf-rats-eat-13

Thomas Fossati <tho.ietf@gmail.com> Mon, 06 June 2022 09:01 UTC

Return-Path: <tho.ietf@gmail.com>
X-Original-To: rats@ietfa.amsl.com
Delivered-To: rats@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4D2CDC157B51; Mon, 6 Jun 2022 02:01:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.108
X-Spam-Level:
X-Spam-Status: No, score=-7.108 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 DtGqXKiu38mK; Mon, 6 Jun 2022 02:01:18 -0700 (PDT)
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 B209CC157B4D; Mon, 6 Jun 2022 02:01:18 -0700 (PDT)
Received: by mail-ej1-x636.google.com with SMTP id s12so20403782ejx.3; Mon, 06 Jun 2022 02:01:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RmMK+bj6R4ZihbTA1/YzgfdDD79HB5DTYfjsTUhNPKQ=; b=FyQxMA7dRv74cg/XoBW+Mt4VZWud8AsguRATRpqdrcz/94zbqJID6gT54sTa0E5at+ ii5S+nUh6gBPB1vKeB5avyt1AgJLh1jLKGqvDM35SRkaoh6FP9z8t4AvJ23rYT9PjZvQ Ed/oOmjBL4zC09lOSlYit5TOxWZ6FXTJ9bB74dYkUat7/WPBvuzwXa6/RbXQX+NREDsf nL2OaJksWuDYzkFNKqYC1JclernsEfTSvEVQZJHnuutYIk7v92zXH2O+GzZTF4P/u6BT kYBGdejON2+hUctttbi2IG8bMiue0vBYq5rEpuHESuDSEZSpSvJmnUa4rcP41ObrItZR N8cw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RmMK+bj6R4ZihbTA1/YzgfdDD79HB5DTYfjsTUhNPKQ=; b=Tv5h43YnKQJCnt0oke+SQhRf5M/kjkqxBZBHcDLSi55GVoSy6Tm4hCbWFkR7RwgkQQ qWbQtp3AMAcFsEODJh6zD4uHL5sa3yQn83t6VAHCNqNeejDGmR/xYu3CAxEJChgKv54n dwcqq4piyiNJKd1n5PWlDPCUyPq+tgbJCX0BEWdsufKk8Am6ByOknhUOtes/4PJDPH0G PEn1S9AjMXsxYfhrZ5ceoslHDC74OrPGNeA5n7BZw5VaO+/xbJZEJhHGqg4I7a5Ps1Q2 MYbbngga7gin8UvUs6LHu5cl5rYWNrQM4hvOHLopQeYu+HPKybjysUJgkC1SQrlsfK1f y3pw==
X-Gm-Message-State: AOAM530Fuw2uM+KYj9OHwU2m6NuUlUftJIlHTLZQ52UoHk53dMjY48n/ 0ZOerY8Md7ZzqKeYj1RtLSO/d88U4DzSir0R0GPjNlsdGBY=
X-Google-Smtp-Source: ABdhPJyKLfLStvu4RROk2rCplUbFBKVfyD5qbL4EGbocP+lQUVgBE0ss4A7CIFU4of96w5J1eSaAPemvCjkHIR2GYb4=
X-Received: by 2002:a17:907:3d89:b0:6f9:1fc:ebf3 with SMTP id he9-20020a1709073d8900b006f901fcebf3mr20601919ejc.403.1654506076754; Mon, 06 Jun 2022 02:01:16 -0700 (PDT)
MIME-Version: 1.0
References: <165443386776.35361.12898474920348394274@ietfa.amsl.com> <CAObGJnNp3haHUUcTi0XcGxDJq1Dy+t=i1bkAn8miYRA29M8ydQ@mail.gmail.com> <0bd8b6d4-803e-5883-236e-e7dd9d352840@lear.ch>
In-Reply-To: <0bd8b6d4-803e-5883-236e-e7dd9d352840@lear.ch>
From: Thomas Fossati <tho.ietf@gmail.com>
Date: Mon, 06 Jun 2022 10:01:05 +0100
Message-ID: <CAObGJnOjgc=AWbqwT-6vFCNUQq-qQhVnqwktCu5x-MP2-gS9sA@mail.gmail.com>
To: Eliot Lear <lear@lear.ch>
Cc: IETF IoT Directorate <iot-directorate@ietf.org>, draft-ietf-rats-eat.all@ietf.org, last-call@ietf.org, rats <rats@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/rats/GYjBtuVm6aCF4HL925pP1btcI_U>
Subject: Re: [Rats] [Iot-directorate] Iotdir last call review of draft-ietf-rats-eat-13
X-BeenThere: rats@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Remote ATtestation procedureS <rats.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rats>, <mailto:rats-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rats/>
List-Post: <mailto:rats@ietf.org>
List-Help: <mailto:rats-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rats>, <mailto:rats-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 06 Jun 2022 09:01:22 -0000

hi Eliot,

On Sun, Jun 5, 2022 at 4:25 PM Eliot Lear <lear@lear.ch> wrote:
> Maybe what is not immediately clear is that EAT is not a complete
> protocol but a framework.
>
> What is provided is a specification of a token.  That's how I reviewed it.

I had a very similar conversation with Carsten (and Henk) a while ago.
He had a similar reaction to yours.
Maybe two clues are not yet a proof, but they start looking more than
a coincidence to me :-)

> The EAT framework provides:
> * A type system -- the base claims-set & a few aggregation types;
> * Security envelopes based on COSE, JOSE;
> * CBOR and JSON serialisations;
> * A number of pre-defined semantics (the defined "claims") that one
> can readily reuse.
>
> All good.  In fact, that's so well stated that perhaps you should say it in the draft just so.

WFM, though this is for the document editors to decide.

> So, a mechanism to identify specific kinds of EAT-based PDUs needs to
> be there from the onset, otherwise one wouldn't know how to
> instantiate the framework for their use case.  And that's precisely
> the role of the profiles.
>
> I'd suggest that Section 7 is still problematic as specified.  Let's start with Section 7.2.1:
>
>    The profile should indicate whether the token format should be CBOR,
>    JSON, both or even some other encoding.  If some other encoding, a
>    specification for how the CDDL described here is serialized in that
>    encoding is necessary.
>
>    This should be addressed for the top-level token and for any nested
>    tokens.  For example, a profile might require all nested tokens to be
>    of the same encoding of the top level token.
>
> Can you give an example of when this would not be entirely clear from context?

(If I understand correctly your question) the problem the text is
hinting at would arise in presence of "Nested-Token"s (see [1] and
subsections), which may be in a different serialisation than the outer
EAT.  A profile indication (either in the media type [2], or in a
top-level profile claim) would make the decoding context entirely
clear to the receiver.

[1] https://datatracker.ietf.org/doc/html/draft-ietf-rats-eat#section-4.2.19.1.2
[2] https://www.ietf.org/archive/id/draft-lundblade-rats-eat-media-type-00.html

>    In some cases CDDL may be created that replaces CDDL in this or other
>    document to express some profile requirements.
>
> Not only is this counter-cultural, but it would require an Updates:
> header on any such profile, and would further just be plain out
> confusing.
>
> I don't think the "Updates" would be required: the CDDL defines a type
> constraint that is applicable to the specific profile, it doesn't
> modify the base type.
>
> But that is precisely what the text I quoted states.

Yeah, having re-read that bit with fresh eyes, I think you're right.
The text can be made more precise in terms of what kind of "CDDL
rewriting" is allowed.

> As an aside, I think I should congratulate you for actually generating compliant SVG graphics!

Thanks! I am just an old ASCII artist trying to make a living in this
new world of scalable vectors :-)

> Coming more to the point, why is it the working group could not settle on many of the contents inside that profile document?  This profile seems like an out for the working group not having resolved some differences.  Are there those who want nonce values other than 32, 48, or 64 bytes?  If so, what brings about the difference and can it be resolved?

The 32/48/64 restriction comes from the PSA Attestation API [3].  It's
a "local" constraint that applies to the nonce type due to certain
decisions taken by the PSA API designers, it's not universal.

[3] https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git/tree/interface/include/psa/initial_attestation.h#n36

> Also, some of the contents of the profile you refer to demonstrate the peril:  a nonce can be presented in three different ways.  Why?  Why does it matter that you not use an array when conveying a single nonce?  All that does is add additional branches.  Worse, if parsing has to occur based on multiple profiles, as will happen, the amount of code needed to do this is likely to balloon.

In our implementation (on the verifier side) the way it composes is
the following: We have a generic EAT library that deals with EAT
claims individually; creating the PSA profile consists of grabbing the
three claims we reuse from the EAT library, defining our own
(implementation-id, security-lifecycle & co.) and putting them
together into one "PSA object."   When a PSA token comes in (normally
identified by its media type), the first thing we do is call the CBOR
decoder to try and roughly map the binary blob to the layout of our
PSA object.  Then we call a validation method that goes through all
the claims and applies the type constraints for the EAT stuff as well
as ours.  There is no extra branching in the EAT library, the type
specialisation is dealt with in the profile specific code.

Hope this helps make the topic a bit clearer.

Cheers, and thanks again for the great discussion.

-- 
Thomas