Re: [OAUTH-WG] For review/discussion: Cedar profile of OAuth Rich Authorization Requests

Brian Campbell <bcampbell@pingidentity.com> Fri, 23 February 2024 19:26 UTC

Return-Path: <bcampbell@pingidentity.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 59ABBC14F696 for <oauth@ietfa.amsl.com>; Fri, 23 Feb 2024 11:26:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.102
X-Spam-Level:
X-Spam-Status: No, score=-7.102 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, HTML_FONT_FACE_BAD=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=pingidentity.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 b7-xCyW5i1Cp for <oauth@ietfa.amsl.com>; Fri, 23 Feb 2024 11:26:27 -0800 (PST)
Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) (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 4D59EC14F68C for <oauth@ietf.org>; Fri, 23 Feb 2024 11:26:27 -0800 (PST)
Received: by mail-il1-x129.google.com with SMTP id e9e14a558f8ab-364f794f237so5367005ab.1 for <oauth@ietf.org>; Fri, 23 Feb 2024 11:26:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pingidentity.com; s=google; t=1708716386; x=1709321186; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=V0VUwVwmjb13/B39bVqNrUsbd6XadR723hesy9/PJdY=; b=ffzK+0AFrdy4kPy0aoGxx+Sv+hpa0pbQ5HZaX7H2EctBnuAG0xj89BEEFtWYeWCXxs W0oBnwdHZwBIJYvbCZf0NZfWCVUbs58DyVe1fcEFibhwn5rpIlZohLhUaIncNMz/euJz pDee8/fsfRAQZX8e3unE283uvmttB5P46MebYCV8OP+CfEPZZfIl+PMlBKLQv2uygkVE 4fFVfIbk7JII4ThBygw1DYM1dTFjQ7YuX8L6Zg3Z83QrZs0xhagTN5WnySpvZraSzFtC D9WdSiNA/RyUBoijK137fQtBpDYByCzfPvmCwhv8SgOMqr1TbJfXnba3DM2YbOALcgZJ xTlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708716386; x=1709321186; 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=V0VUwVwmjb13/B39bVqNrUsbd6XadR723hesy9/PJdY=; b=gjUFs8W7xtvYvWF+upb0lisfBjIANKdLk4hJp9PZc+V7RPcD8rTfuI6VPY+FYknWp9 x9zjx7PG4EXi0GllYmd+t+GshdEobkDZMnEOI9zvh2q3LJnRUf59C0f1lReha+NaOXvU 2M8d7ab45muzVQDAorSOjJtCngxWhernai98eRXUPQqghfLmei7Ri/is/Pein9guFYh0 0eMF4PG6gKqGPo+YPhQCX4jQ8sEE8EaudV4JjKMsI/Xh5fN+Vc7Ll3WpZaMCVMPGd+ew Uc5QKWsSC1xZfEou7+/UAGijNrAsy5oky7wADHnq1NeilMXRg0UYag5gA8csVrzKFoW1 wVYQ==
X-Forwarded-Encrypted: i=1; AJvYcCVhWpsUS6hsMRZVNDIzddRd11UpTe2AH5Q6YO63HsxqzBpaBX7xfYL13KRIPBzE3Ny50VilXJwtqQxK0ZL1gg==
X-Gm-Message-State: AOJu0YzzOw9bdzSuRdmi0QijBLwPSgbLOlxuqQBiHUlkq2vFehvcHc3d u11fl9/w3Ck6kp83PHFiMZnwpGdRs/Rp6oMZWlSXgawv42BxY6SdIUNjFeYBTVfzhJ1zoVZYckQ lmMRkzpmlm1R9bbeBQU0PZZ1x/aTS28qNIladafxUg4XRki2gvpuxqILc5EUjaBsiwqXUdPVJf8 +sqLk98y2d0g==
X-Google-Smtp-Source: AGHT+IGauLlcqY1KveQ88+U70qCHtHPyvOY7ApNJH7g/laHy4/w6P2GuclN8WYgf+qTUKSla23F/3kWIkaeseEI8LlA=
X-Received: by 2002:a92:cb47:0:b0:364:fffe:44c4 with SMTP id f7-20020a92cb47000000b00364fffe44c4mr922731ilq.7.1708716386242; Fri, 23 Feb 2024 11:26:26 -0800 (PST)
MIME-Version: 1.0
References: <05d124f46a7f400195076ec95686b794@amazon.com> <775BA7EF-7254-46D9-B936-A7862FCE95BD@mit.edu>
In-Reply-To: <775BA7EF-7254-46D9-B936-A7862FCE95BD@mit.edu>
From: Brian Campbell <bcampbell@pingidentity.com>
Date: Fri, 23 Feb 2024 12:25:56 -0700
Message-ID: <CA+k3eCQxG8ZYXU1kCWJba3esv2B9cLvwrfQQ0E5PpFhRAYRgWg@mail.gmail.com>
To: Justin Richer <jricher@mit.edu>
Cc: "Cecchetti, Sarah" <sarahcec=40amazon.com@dmarc.ietf.org>, oauth <oauth@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000396b42061211891f"
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/b31-uO48TLq7xZbdgOTiLKLecm8>
Subject: Re: [OAUTH-WG] For review/discussion: Cedar profile of OAuth Rich Authorization Requests
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.39
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: Fri, 23 Feb 2024 19:26:31 -0000

I'm inferring some intent (apologies if I've got it wrong!) but I think
it'd make the most sense for this work to start with defining a RAR type
value (something like "https://cedarpolicy.com") and define that type as
having the "policySet"  parameter. An updated example figure 1 from the
draft would look like the below.  As Justin said, RAR intends the “type”
field as the extensibility point that defines the semantics of all other
parts in the typed object. So it would be saying this is a Cedar
type authorization_details element and it contains this "policySet"
parameter that has the actual Cedar policy in it.


{
"type": "https://cedarpolicy.com"
"policySet": "
  permit (
        principal == BankA::User::\"696d28c8-8912-41d2-b182-aa7087323318\",
        action == BankA::Action::\"initiate\",
    resource == Creditor::\"https://example.com/payments\"
        )
        when { context.instructedAmount.currency == \"EUR\" &&
    context.instructedAmount.amount == decimal(\"123.50\") &&
    resource.creditorName == \"Merchant A\" &&
    resource.creditorAccount.bic == \"ABCIDEFFXXX\" &&
    resource.creditorAccount.iban == \"DE02100100109307118603\" &&
    context.remittanceInformationUnstructured == \"Ref Number Merchant\"
        };
"
}


On Thu, Feb 22, 2024 at 11:15 AM Justin Richer <jricher@mit.edu> wrote:

> Hi Sarah,
>
> Thanks for putting that draft together. As one of the authors of RAR, I
> wanted to chime in.
>
> First, I do think that this is a great use of RAR. The whole idea behind
> RAR was to give people structures that they could use beyond what scopes
> allow, and tying this to a computable policy language like Cedar makes a
> lot of sense to a lot of use cases. In particular, as with any other RAR
> object, this could show up in the client’s request to the AS, the AS’s
> response to the client, or the token’s resulting metadata (basically AS
> message to the RS via the token), and having an explicit policy in each of
> those places deserves discussion.
>
> Next, I wanted to provide some specific feedback about the implementation
> proposed in the draft, because I think there are a few ways it could go and
> each might make sense.
>
> One of the benefits to RAR is that it’s the “type” field that defines the
> semantics of all other parts in the typed object — which also makes
> interoperable definitions a bit trickier. With that in mind, what is the
> intended target of the “rarFormat” and “policySet” fields?
>
> Is the goal of this draft to define another set of “Common Data Fields” to
> be used across different types, as is done in RAR section 2.2? (
> https://www.rfc-editor.org/rfc/rfc9396.html#name-common-data-fields) If
> so, that should be called out explicitly, as is done in RFC9396. Are there
> intended interactions with other common data fields, such as filtering the
> policy based on location or action, for example?
>
> Or is the goal that these be defined in a specific set of “type” values
> that would comply to this format? If so, what are the conditions for using
> and extending this format? The way the “rarFormat” text is currently
> written, it seems to put constraints on the rest of the object defined by
> the “type”, so is the intent that you’d have rar-cedar-compliant types that
> follow this pattern?
>
> Or is the goal to define a generic and extensible field set that can be
> re-used by other policy languages? That seems to be hinted at with the
> separate format and data fields, but as written only one is defined so it’s
> difficult to tell, at this stage, what the intended abstraction points are.
> If only one is defined, then would it make sense to just define a single
> “cedarPolicy” parameter instead of the two? And if there’s another format
> that comes along, it can follow Cedar’s example and do something similar.
> The “type” would define how to handle having different policy formats in a
> single object, to avoid overlaps.
>
> And if the answer to all of this is “I don’t know”, that’s also reasonable
> at this stage as these are great questions for the WG to answer. :)
>
> Finally, since RAR is based on JSON data types, and Cedar uses multi-line
> strings (at least for display in the examples), the intent of this value
> translation is going to have to be spelled out. As in, a real example on
> the wire would need to have all the newlines encoded as \n and the like, in
> order to be JSON. This is almost certainly me reading too much into the
> hand-crafted examples on a new drafts, but I wanted to raise this as
> something that’ll need to be solved for Cedar and, depending on the answers
> above, other languages. In other words, can we always assume that a policy
> is always encoded as a single string, or is there other structure that
> might work better? This is not my area of expertise and I have no opinions
> on the answer, so if strings are good enough that’s fine by me. :)
>
> Thank you, and I hope to see this work continue!
>
>  — Justin
>
> On Feb 21, 2024, at 5:06 PM, Cecchetti, Sarah <sarahcec=
> 40amazon.com@dmarc.ietf.org> wrote:
>
> I have submitted a new draft:
>
> https://datatracker.ietf.org/doc/html/draft-cecchetti-oauth-rar-cedar
>
> This is intended to be a profile of RFC 9396 OAuth 2.0 Rich
> Authorization Requests (OAuth RAR). OAuth RAR defines an
> authorization_details parameter, but leaves the format of the parameter
> open. This profile defines a rarFormat parameter to further constrain
> authorization_details to use a specific format called "cedar."
>
> The use case for this draft is the same as the OAuth RAR use case - i.e.
> open banking specifically, and fine-grained authorization generally. The
> intent is to make the standard more interoperable by specifying the policy
> language which will be used to communicate the authorization request and
> response. The language used in these examples is Cedar, an open-source
> policy language - https://www.cedarpolicy.com/en. Putting Cedar policy
> sets within an OAuth token enables the client and RS to conduct
> transactions which conform to specific fine-grained policies which have
> been blessed(signed) by the AS.
>
> Open Questions:
>
>    1. Should we create a separate informational draft defining the Cedar
>    language itself within the universe of the IETF? Or is it fine to leave
>    that undefined?
>    2. Is rarFormat the right name for this parameter?
>    3. Should policySet be required?
>    4. I tried to keep this draft fairly simple and duplicate examples in
>    the OAuth RAR RFC without redundantly stating what is already defined
>    there. Did I include too little? Too much?
>
>
> This is my first draft submission, so any and all feedback is welcome, and
> apologies if my xml is incorrectly formatted. I'm ignorant about many
> things in the standards process. :)
>
>
> Sarah Cecchetti
>
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>
>
> _______________________________________________
> OAuth mailing list
> OAuth@ietf.org
> https://www.ietf.org/mailman/listinfo/oauth
>

-- 
_CONFIDENTIALITY NOTICE: This email may contain confidential and privileged 
material for the sole use of the intended recipient(s). Any review, use, 
distribution or disclosure by others is strictly prohibited.  If you have 
received this communication in error, please notify the sender immediately 
by e-mail and delete the message and any file attachments from your 
computer. Thank you._