Re: [OAUTH-WG] AD Review of draft-ietf-oauth-access-token-jwt-10

Vittorio Bertocci <vittorio.bertocci@auth0.com> Thu, 19 November 2020 08:44 UTC

Return-Path: <vittorio.bertocci@auth0.com>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 191563A11DE for <oauth@ietfa.amsl.com>; Thu, 19 Nov 2020 00:44:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=auth0.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 HcABAjOWu7tE for <oauth@ietfa.amsl.com>; Thu, 19 Nov 2020 00:44:57 -0800 (PST)
Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (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 97A823A11F4 for <oauth@ietf.org>; Thu, 19 Nov 2020 00:44:57 -0800 (PST)
Received: by mail-pg1-x531.google.com with SMTP id 62so3584675pgg.12 for <oauth@ietf.org>; Thu, 19 Nov 2020 00:44:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=auth0.com; s=google; h=from:to:subject:thread-topic:thread-index:date:message-id :references:in-reply-to:accept-language:content-language :content-transfer-encoding:mime-version; bh=W3qbSZMG5R33Ce5NOlwfYMx6lWupHX60ddIj1Xdwjc4=; b=HjrDF6JMbo3x9nO4Wda1cFTsFpfV2cpBJs+J7UnX48zqoDjeWc944NkYcV7Vzgic6O Kg0/aoMpVeR4Cp/NzvQ+iazi/0ShbHLJ1FtepNm0duHJ2Yfx3seom1ThwTMIZQynHbKW Uw5Nth0Q408bfjqfZIleLHmV69RWeGjpk69Uh/Xhdj9cObbRuKaTEKFZ3E1kd1Ax1YIi fZ85R8QkirDlh6e6j7Qkw8zsmdPlEZH81tuUkzWNwNr/AzY9hS+G56QpUAYe9qXTFVAh ZqH10ZnjLc2x49e+c/nIoastx61kIyz8cX68B3SMOL2vBQ9oOqDo5q6SRAfpYm+6gb64 MQFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:thread-topic:thread-index:date :message-id:references:in-reply-to:accept-language:content-language :content-transfer-encoding:mime-version; bh=W3qbSZMG5R33Ce5NOlwfYMx6lWupHX60ddIj1Xdwjc4=; b=spNZt49p1Yl0BRX8hhmjkJxSPKCkl8iwoxu6bdlZNyP7fS0H8+L8Y3ozhYz1rSDJBv ePyov9/auH1clr/N26jIhPzslwPh9HHqhjbBWa7zIl6GtO23zbDWmgvt21iMgCMfq6Us /Cxwn++k1fjVmJd/57w6Bq3WgQijpTN5iFTxUjanbi9S9rzBUk0TG8xT74MdrLop1257 c+Nw69EeAX8XIeFVILYHFqvh18r5+qiTY3u7a3lOinZ/q0y6tLVNv3hUxQociRYmBXzi yYyxeC7ayIzJDVtpv+yA8qcZZ1V4fbfgf2IJoRdMXx8cePCJHOFyc6Q8h8srBJRkS43D 76EA==
X-Gm-Message-State: AOAM532Sgyjte3SQro9gTTnWK2e/P+NTSKGuxuOEbEyRcdIVgy6f8YOd LGRzRIH+98zbHF3juPQi5L53kPyj8b26SQ==
X-Google-Smtp-Source: ABdhPJyVHovzgGRQscNqpgZrur7Wdsij2m5F/lQzf5sw6BTTQthVTS2jdEoJNoPNoCIoIsZte4VLYQ==
X-Received: by 2002:a17:90a:de0c:: with SMTP id m12mr2675529pjv.224.1605775496653; Thu, 19 Nov 2020 00:44:56 -0800 (PST)
Received: from MWHPR19MB1501.namprd19.prod.outlook.com ([2603:1036:120:1d::5]) by smtp.gmail.com with ESMTPSA id ga18sm5609978pjb.5.2020.11.19.00.44.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2020 00:44:55 -0800 (PST)
From: Vittorio Bertocci <vittorio.bertocci@auth0.com>
To: Roman Danyliw <rdd@cert.org>, "oauth@ietf.org" <oauth@ietf.org>
Thread-Topic: [OAUTH-WG] AD Review of draft-ietf-oauth-access-token-jwt-10
Thread-Index: Ada7bYibjuDIkiTCR8eXer4b6TfeyQC4rcyE
X-MS-Exchange-MessageSentRepresentingType: 1
Date: Thu, 19 Nov 2020 08:44:54 +0000
Message-ID: <MWHPR19MB1501B53CB115878B196F4DFDAEE00@MWHPR19MB1501.namprd19.prod.outlook.com>
References: <c55fe95c27fd4d00a2685db2f847330c@cert.org>
In-Reply-To: <c55fe95c27fd4d00a2685db2f847330c@cert.org>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-Exchange-Organization-SCL: -1
X-MS-TNEF-Correlator:
X-MS-Exchange-Organization-RecordReviewCfmType: 0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/42c1Pp9NoY7miAC1CLDnyetk45o>
Subject: Re: [OAUTH-WG] AD Review of draft-ietf-oauth-access-token-jwt-10
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Nov 2020 08:44:59 -0000

Thank you Roman for the thorough review!
I applied all the editorial and typo fixes. I have a few questions on some comments, once solved I'll update accordingly and push a new version.
Thanks!
Inline


>On 11/15/20, 08:39, "OAuth on behalf of Roman Danyliw" <oauth-bounces@ietf.org on behalf of rdd@cert.org> wrote:
>[..]    
>    ** Section 2.2.2.  Per "Any additional attributes whose semantics   Any additional attributes whose semantics are well described by the attribute's description found in Section 5.1 of [..]
>   Maybe my read it wrong, but it seems like this text saying that beyond the required claims listed in section 2.2, you can use any of the other claims as long as they are in the IANA JWT registry.  Isn't that simpler, since the Section 5.1. OpenID.Core attributes are registered?
 You are right, that's not very clear. 
In a nutshell, what I am trying to say is "if you want to express an attribute for which there's already a well-established claim available, use that rather than inventing  new one.".
That still allows for non-IANA claims to be introduced, as long as the implementer has done the due diligence and verified that the attribute they convey isn't covered in the IANA JWT registry.
I explicitly mention OpenID Connect as source of claims mostly to ensure that the reader will understand at first glance that when it comes to user information a JWT AT can convey the same information obtained via OpenID Connect, without the need to follow the link and consult the change controller/reference column of the claims to realize that. One of the goals I am hoping this spec will achieve is to stop people from abusing ID tokens and using them in lieu of access tokens (as Kubernetes routinely does, for example), hence the "denormalized" language of that section.
Here's an alternative formulation that tries to preserve that clarity while referring to the registry: 

"Any additional identity attribute whose semantic is well described by an entry in the JSON Web Token (JWT) IANA registry introduced in [RFC7519] SHOULD be encoded using the corresponding claim name.
Note that the JWT IANA registry includes the claims found in Section 5.1 of [OpenID.Core]."
   
What do you think? Waiting for your feedback before changing the language in the draft.
   
>    ** Section 3.  What would be the case where it would not be appropriate for the resource parameter value to be the same as the aud claim in the access token (the text currently says SHOULD, why not MUST?)?
This was actually a MUST until draft 3, then Brian pointed out that this would have made this profile more restrictive than resource indicators itself- which led me to soften the requirement accordingly. Brian's comment in its entirety:
|Resource Indicators is about how the client conveys the target to the AS and says " The authorization server may use the exact 'resource' value as the audience or it may map from that value to a more general URI or abstract identifier for the given resource". The following from |sec 3 is more restrictive / prescriptive, which seems to reach beyond the scope of the JWT access token profile. 
||  "If the request includes a resource parameter (as defined in
|| [ResourceIndicators]), the resulting JWT access token aud claim MUST
||   have the same value as the resource parameter in the request."    
 
>    ** Section 4. Per the validation guidelines on access token validation, is there parallel text needed to discuss the RS use of the token say: checking that the acr has a value that is appropriate (so it can have confidence in the security of > the authentication used between client/AS)? Or that the right entitlements/groups/etc were present for the requested operation?   
That's a good point. The last paragraph of section 4 was meant to be a catch-all for those cases, mentioning entitlements under the "authorization claims" umbrella and everything else as "any other contextual information". The thing that makes me hesitate before getting more specific than that is that it can be a slippery slope (acr, amr, entitlements etc are good candidates, but the same might be said about auth_time for max_age like scenarios, for example... where to draw the line?) and being those optional, not everyone might readily understand without adding more color/context. Combined with how difficult reaching consensus for the inclusion of session properties in access tokens, plus the fact thatRFC6750 does not give RS specific guidance for how to act on authorization info (scopes), I opted for generic language.
If you feel strongly about more specific guidance being required for those claims, I can propose more specific language- but before doing so, I wanted to offer the context above to see if it changes things.   
 
    
 >   ** Section 5.  This text seems to restate much of the text from [OAuth2.Security.BestPractices].  Do other section apply here?  Perhaps also add that the SecCons of individual claims apply here too if used in the profile (as this profile allows pretty much anything in the JWT registry to be used).
I combed draft-ietf-oauth-security-topics-16 and besides the parts about sub, client_id and aud (already referenced by the current spec, or further restricted- as it the case for the audience considerations), the BCP doesn’t appear to offer further guidance that would vary depending on the content of the token. The guidance seems mostly on how the token is obtained, and the mechanisms described operate at the message level hence apply to JWT access tokens and opaque tokens in the same way. Did you have any specific section of the BCP in mind? 
I also took a look at rfc7519 SecCon and it doesn’t appear to offer claims-specific considerations. Finally, I combed thru rfc8725 and it seems the current spec covers all the content specific recommendations that apply to this scenario, namely in section 4 for the audience, issue and subject validation, and section 2.1 and 4 for the strong typing.
Bottom line: I could add a generic recommendation to consider OAuth2.Security.BestPractices, rfc7519 and rfc8725 when considering the security of a JWT access token, but the only section that seem directly applicable seems the 4.14 we already reference. What do you think? Do we need that blanket reference?