Re: [Ace] review draft-ietf-ace-oauth-authz-02

Ludwig Seitz <ludwig@sics.se> Mon, 18 July 2016 16:27 UTC

Return-Path: <ludwig@sics.se>
X-Original-To: ace@ietfa.amsl.com
Delivered-To: ace@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 541F312DAE8 for <ace@ietfa.amsl.com>; Mon, 18 Jul 2016 09:27:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.601
X-Spam-Level:
X-Spam-Status: No, score=-2.601 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=sics-se.20150623.gappssmtp.com
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 PBV7-Evzaia3 for <ace@ietfa.amsl.com>; Mon, 18 Jul 2016 09:26:58 -0700 (PDT)
Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A484C12DAE7 for <ace@ietf.org>; Mon, 18 Jul 2016 09:26:57 -0700 (PDT)
Received: by mail-wm0-x22f.google.com with SMTP id f126so110436093wma.1 for <ace@ietf.org>; Mon, 18 Jul 2016 09:26:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sics-se.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to; bh=tlkeoVLoFWTVuL47cwU4RMRTrg8o3jhSZHBmimminug=; b=BaZud7Ayb7odSFrkK/5wTwZT1xkO36QfN2nPPai0HHfRDl0Rv0M+NMJX9gZhD44BZD upXsRp4stFgwpb4766ZmiNM0mGk2afZppDhX7reC1ZUzxV0UkwY3WfcY53DhDbLCvHUn XXTrtOukKRD8ylqyR3l2qziphMX+IlodTwRUVjCUju30JnXsKFcYjIjqvx09YM/Yc1NI k6Xxrk2V0qN+zMoUAtakuHPuw7IlWvciyA7krTz08JBkDf0pPQ+j+J7peNi6Kwp5Se8P OHqZH6l7UTEL0bq+pfr+NmDM+8vqP/4WKIglcz3XPgwfF75L65Zxu1jgMZoSO6G0XYaP BrvQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to; bh=tlkeoVLoFWTVuL47cwU4RMRTrg8o3jhSZHBmimminug=; b=cx9MtKCrWVGrwABec8rCUYHRC72sdHyqZsA8T2wDSNzs1cokpUhgWw24AoMLATFPax 7giiolXKBBqAOvL1hkZ43xtjSURdwy8vmrnf+noYf6MLrLEzw5tmDLcljgTTl/PJFyfD ILbgoLFrl/GOYsARJLyX2DkX1mH2JovRcjKF0zlhwJhJupFHWjeHsgoMOiEu8WagJRK6 7rb8EvLFXbuwk+hAvAZNgAQohhOppJ1KnzhCV6WUf9AJJoBN7CgrYKLnk33hagW6vxb6 y+GILZh07ocIs+/PQFO6Rx9CkIwZqgDvBR7M3reX7EedgkGdxm9EaGJBPJUYz2JC8cLY s4DA==
X-Gm-Message-State: ALyK8tJYeLcm8MKQLAja8J+8x5yk9/t3uYELnkA46ZOqbLArEkFhjLPoYX73FPKQDq2/oZXe
X-Received: by 10.28.37.2 with SMTP id l2mr39268394wml.23.1468858869240; Mon, 18 Jul 2016 09:21:09 -0700 (PDT)
Received: from [10.59.1.107] ([80.156.72.98]) by smtp.gmail.com with ESMTPSA id n26sm17503432wmi.3.2016.07.18.09.21.07 for <ace@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 09:21:08 -0700 (PDT)
From: Ludwig Seitz <ludwig@sics.se>
To: ace@ietf.org
References: <CAD2CPUFJi7QizdOwPOtkTd21VRREjarD+tvwmM0sN9h=Qy-+Yw@mail.gmail.com>
Message-ID: <578D01F1.9040909@sics.se>
Date: Mon, 18 Jul 2016 18:21:05 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0
MIME-Version: 1.0
In-Reply-To: <CAD2CPUFJi7QizdOwPOtkTd21VRREjarD+tvwmM0sN9h=Qy-+Yw@mail.gmail.com>
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="------------ms050805050505030608050800"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ace/xBM_aDNUTNatIMWGvrxJmFOhWyk>
Subject: Re: [Ace] review draft-ietf-ace-oauth-authz-02
X-BeenThere: ace@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "Authentication and Authorization for Constrained Environments \(ace\)" <ace.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ace>, <mailto:ace-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ace/>
List-Post: <mailto:ace@ietf.org>
List-Help: <mailto:ace-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ace>, <mailto:ace-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Jul 2016 16:27:01 -0000

On 2016-07-08 17:04, Renzo Navas wrote:
> Hi ace wg,
> Hi Ludwig, Göran, et al.
>
~snip~

Thank you Renzo for taking the time to do this review. Please find my 
comments inline.

Regards,

Ludwig

>
> ----------------------------------------------------------------
> Review of https://tools.ietf.org/html/draft-ietf-ace-oauth-authz-02
> ---------------------------------------------------------------
>
> 4. Protocol Interactions
> "The consent of the resource owner, for giving a client access to a
> protected resource, can be pre-configured authorization policies or
> dynamically at the time when the request is sent."
>
> "when the request is sent": The request we are talking is the Resource
> Request (Client already has the access token) or the token request? I
> believe is Resource Request.
> would it be good to explicit where this authz. policies are
> pre-configured (at the AS? were enforced before at the token request
> and are now embedded on the Access token; or at the RS?);
> and how the consent can be dynamically determined (will involve
> interaction with the Res Owner : RS to RO; RS to AS to RO ?).
> All this is out of scope of the draft, however I believe making
> explicit at least where the authz policies are pre-conf can be a good
> idea, just a suggestion.
> (My understanding is that they are at the AS; and were enforced at the
> token request; if introspection is used, can be enforced again at the
> resource request).
>

Sorry this is a case of bad word-choice by me. The idea is of course 
that the AS determines the consent of the RO at the time of the access 
token request (i.e. C -> AS). This can be either done by asking the RO 
or by using authorization policies defined by the RO previously at the 
AS. I'm adding an issue about this.


> 4. Messages Flows description: A-F:
> Would it be too redundant to state which security properties needs
> each messages, or it will be clearer? (A,B,D,E,F encrypted+integrity
> protected. C does not)
> This is just a question/suggestion; each message sec. requ. are stated
> in other parts of the draft (early on section 4, and on section 5 and
> 6...).
>

This could depend on the profiles, e.g. message B could need to be 
encrypted (if a symmetric PoP key is transferred) or just integrity 
protected (if a asymmetric PoP key is used). Therefore I'd rather not 
make these kind of statements here.

>
> 5.  Framework
> Proof-of-Possession
> FROM           " i.e. that the authenticated token holder is bound to
> the token."
> to Something like " i.e. that the token holder can prove being a
> holder of the key bound to the token"
>

Sounds good.


>
> 5.  Framework
> "In OAuth 2.0 the communication with the Token and the Introspection
> resources at the AS (...) This framework RECOMMENDS to use CoAP instead and
> RECOMMENDS the use of the following alternative instead of Uri-query
> parameters: The sender (client or RS) encodes the parameters of its
> request as a CBOR map and submits that map as the payload of the POST
> request.  The Content-format MUST be "application/cbor" in that case."
>
> If we use plain cbor on top of coap this means we are using dtls  to
> protect the messages.
>
> If we are protecting the messages with cose, should we not use the
> Content-Format: "application/cose;cose-type=cose-encrypt" ?
>
> All the examples of the doc use appplication/cbor; however, can be
> useful to mention somewhere (here?) that if cose is used the content
> format is "application/cose"?
>

Correct, if we add other security wrappers around the data we may need 
to change the Content-format. I'll add an issue about this.


>
> ----------------------
> 6.  The 'Token' Resource
> "Communication between the client and the token resource at the AS
> MUST be integrity protected and encrypted.  Furthermore AS and client
> MUST perform mutual authentication. Profiles of this framework are
> expected to specify how authentication and communication security is
> implemented."
>
> Is it worthy (.. is it accurate?) to express that the Token Request,
> from C to AS might not be source-authenticated, and the AS -in that
> case- can authenticate the request ("a posteriori") with the
> client_id/client_secret?
> The buzz in my head came because authentication of the client can be
> done at dtls/cose level (that, for me, its not a must), and also with
> the client credentials inside the request.
> I think that the description on the text is generic enough so any
> interpretation of how to authenticate the C towards AS, is OK.
> In any case I send to you this (confusing) thoughts I had when I first
> read this sentence. Authentication can be done at communication level
> with the PSK C-AS , and also with the client_secret (maybe this is an
> "application authentication"...).
>
>
You are right, we should clarify these options ... creating an issue


>
> 6.  The 'Token' Resource
> "The figures of this section uses CBOR diagnostic notation without the
> integer abbreviations for the parameters or their values for better
> readability."
> (already did this comment) is worth mentioning that if cose is used,
> the coap messages content-type are application/cose, and we show the
> cbor plaintext payload?
>

Yes that was the intention of these examples. I'll check if that needs 
clarification.

> -------------------
>
>
> 6.1.  Client-to-AS Request
> Figure 3: Example request for an access token bound to an asymmetric key.
> "grant_type" : "token"
>
> I have not found the definition of grant_type "token" , should not be
> "client_credentials"? (
> https://tools.ietf.org/html/rfc6749#section-4.4.2 )
>

Good catch! I think that was just an error.

> ------------
> 6.2.  AS-to-Client Response
> Figure 5: Example AS response with an access token bound to a symmetric key.
> "{ "access_token" : b64'SlAV32hkKG ...
>        (...),
>       "token_type" : "pop",
>       "alg" : "HS256",
>       "cnf" : {
>         "COSE_Key" : { ...."
>
> how does the "alg" field of the token response relates to the
> "key_alg" from the COSE_Key object if present, they must match , or
> cose_key alg must be a super-set of this "alg"?
> In 6.4.2 this "alg" is defined, Now that I read the passage
> attentively, this "alg" field in the token response is only used for
> the initial PoP; then the key can be used with other algorithms (e.g.
> to encrypt with aes-ccm). OK.
> I left this comment to show the confusion that produced the "alg"
> field at two different levels, maybe its worthy to briefly tell the
> difference/purpose of each one in contrast to each other.
> ------------

The intention is of course that 'alg' is used to identify the initial 
PoP procedure, this may include generating further keys for 
communication security. Obviously the key_alg parameter, if present, 
should identify the same algorithm as the alg parameter.

I'll add an issue to clarify this.


>
> 6.4.4.  Confirmation
>
> "COSE_Encrypted  In this case the 'cnf' parameter contains an
> encrypted symmetriic key destined for the client."
> (typo "symmetriic").

Noted.

> Is it needed to encrypt the symmetric key inside cnf?

If the channel is not secure this would be necessary. Otherwise you can 
just use a COSE_Key inside 'cnf'

> Was not assumed that the communication between AS and Client was
> already protected (the whole response was integrity protected and
> encrypted).
> Or it was a general statement, and this is a particular case? In any
> case, fields outside cnf should be at least integrity protected.
>

It might be the case that this is not really needed. I'll go through the 
use cases and check. This comes from the fact that we copied the 
properties of the 'cnf' parameter form RFC7800, which includes an 
encrypted key.

>
> GENERAL OBSERVATION (already did on section 4): Can be a good idea to
> specify for each message which kind of security properties
> (confidentiality, integrity/data authentication)'
> we need and at what level/layer (e.g: transport layer/application
> layer, Cose_key field needs confidentiality but the rest only
> integrity, etc.)?
>
I think that depends on the specific contents of the message, so I'm not 
sure if it can be said generally for each message.



> -----------
>
> 7.  The 'Introspect' Resource
> " Finally the AS SHOULD to verify that the RS"
> remove/"to" ?
> ------------
>
Noted


>
> 7.4.  Client Token
>
> Personally I believe this is a very relevant use case.
> This "client token" solution is elegant, and easy to understand on the
> context on the rest of the framework.
>
> ------------
>
> 8.2.  Token Expiration
> "RS verifies these by comparing them to values from its internal clock
> as defined in [RFC7519].
> In this case the RS must have a real time chip (RTC) or some other ..."
> Shall it say "real time clock (RTC)"?
> Its worthy to be more clear and say that the internal clock should
> reflect the current date/time, or at least be synchronized with the
> issuer-of-the-token's clock (the AS)?
>

I'll clarify this.

> ----------------------
>
> Appendix C.  Deployment Examples
>
> Comment: I found it VERY useful to see the real exchange of messages.
>
>
> C.1.  Local Token Validation
> " The token includes the claim "aif" with the authorized
>    access that an owner of the temperature device can enjoy.  The
>    'aif' claim, issued by the AS, informs the RS that the owner of
>    the token, that can prove the possession of a key is authorized to"
>
> The first sentence should not say: ".. that an owner of the of the
> token, that can prove the possession of a key can enjoy" instead of
> the "owner of the temperature device" ?
>

Sorry all the examples in the appendices are not up to date, we intended 
to remove the 'aif' claim from this document for the time being and 
missed this section.

>
> C.1. Local Token Validation
>
> About "AIF" claim
>
> should not reference
> https://tools.ietf.org/html/draft-bormann-core-ace-aif-03 somewhere?
>
> "aif" claim is only mentioned on appendix C, what happened on the rest
> of the document? (is not a valid claim?)
> In cbor web token
> (https://tools.ietf.org/html/draft-ietf-ace-cbor-web-token-00#appendix-A.3
> ) , the only reference of aif is on Appendix 3!
> shall we give more visibility for the aif claim on the main body of the doc?
>

See comment above.

> --------------------------------------------
>
> C.2.  Introspection Aided Token Validation
>
> "Figure 23: Request and Response Payload for C offline"
> "COSE_Key" : {
>           "kid" : b64'c29tZSBwdWJsaWMga2V5IGlk',
>           "kty" : "oct",
>           "alg" : "HS256",
> "
>
> * Should not be: "kty": "Symmetric " ?

I'll check that.

>
> * "alg", supossedly this is key_alg that specifies "Key usage
> restriction to this algorithm".
> "HS256", I found a reference on json web token, and says "indicates
> that this token is signed using HMAC-SHA256."
> Should not be put on "alg" the algorithm that will be used on the
> DTLS-PSK performed later? e.g.: "AES-CCM-16-64-128"?

This is actually not quite clear in the COSE draft. Table 3 suggests the 
parameter should be called 'alg' not 'key_alg'. I'll ask for 
clarification by Jim Schaad.

I think this example needs to be updated as well, it seems broken.


> ------------------------------
>
> "E: The AS provides the introspection response containing
>   (...). (...) allows the RS to verify the client's proof of
> possession in step F.
> After receiving message E, the RS responds to the client's POST in
> step C with Code 2.01 Created."
>
> See "Figure 24: Token Introspection for C offline"
>
> "step C with Code 2.01 Created", Is this not the "Step F"?
>

Yes this figure is not aligned with the steps in figure 1. I'll fix that.

>
> -------------
> Both comments coming from "Figure 25: Request and Response Payload for
> Introspection:"
>
> "Request-Payload:
> ...
>    "client_id" : "FrontDoor",
>    "client_secret" : "ytrewq"
> "
>
> This is introspection request from RS to AS.
> How did the RS got the client_id and the client_secret? (previous,
> message from C to RS is not protected)
>

Good catch, all these examples in the appendices need to be looked over 
I think.

>
> "Response-Payload:
> ...
> "cnf" : {
>         "kid" : b64'...'}
> "
> Should not "cnf" need to have the whole "COSE_Key" (including "k")?
> On the text it was not assumed that RS and C already shared a Key (if
> they did, at some point after original C-AS request, AS must have
> provisioned it to RS -this can be assumed-).
> In the general case AS will have to transport the key to RS on the
> introspection response I think
>
You are right there as well.




-- 
Ludwig Seitz, PhD
SICS Swedish ICT AB
Ideon Science Park
Building Beta 2
Scheelevägen 17
SE-223 70 Lund

Phone +46(0)70-349 92 51
http://www.sics.se