Re: [Wimse] Request Binding Proofs for Workload Identities

Pieter Kasselman <pieter.kasselman@microsoft.com> Fri, 01 December 2023 15:54 UTC

Return-Path: <pieter.kasselman@microsoft.com>
X-Original-To: wimse@ietfa.amsl.com
Delivered-To: wimse@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D4498C151083 for <wimse@ietfa.amsl.com>; Fri, 1 Dec 2023 07:54:09 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.099
X-Spam-Level:
X-Spam-Status: No, score=-7.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, T_SCC_BODY_TEXT_LINE=-0.01, 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 (1024-bit key) header.d=microsoft.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 4kauF28TiWhf for <wimse@ietfa.amsl.com>; Fri, 1 Dec 2023 07:54:08 -0800 (PST)
Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2126.outbound.protection.outlook.com [40.107.241.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BAD7AC14F73F for <wimse@ietf.org>; Fri, 1 Dec 2023 07:54:07 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XuF5LnNseNgLkZx774Nisb8eJ8eeovRa6LCTCqDPiNQ3ml4UEBwr7j9Ok6wyX8IwzxJnQMXbCkOBtiHLVnEyAZep7E+Aa2e97rGUnUDkCsIp+YX1KMh+m/C7jWeWIOUGle/5UYO545RV6yQ16UC3seJQdnufQPuxwLzJ1C1pzBlRUQP81igWOtQfsgBdC6+Sv5Fda+M5bb8hiUoJPaJTbCt8Fd4q5pwbQYlW6DYsyFIle1yNzb73fQ1DIkQupkXPiaAS/IkCIbtAxsLXLs4Kx8nhX2jVGBCSp7yJdQEvE3niyBVynEpH7jOPkegBpHU8cVngyewiawQIKE1sooXqdw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jsMG9AcSic6Ne46IPHU2aGK1yTzJroeFGm0+2jcV/xI=; b=EPE5wV8zGFED40Pg28EWPkD74s7UUJIIuy/EifVYvJqN3f0e26NYYtNjTh0yaSYvlF57o4VOwtKeqFT7kCj5b3R1zvBfEfsACoDoe6XlcCzKn4zTaEabZwYSVpp4Fd4weleaMaE5kFITQEEJkAgd9/IPmcI7AF9aehWZ14Wb0BanyhgeVrWic2LK6y8Q3UyBGfnUVfuk/C4Gw8NfcwNCVKxin/UMK1MR/E5KIrMPSOXntZRrEv2khMR7l7FDmaupgqmFfEfL5Wonl960FY6Y7ikU7umY/abu3UsH8Nzme4jcfFeccOCzyva2LQUG8EG9AsAEiBuku1MEkvuGs4ZuXw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jsMG9AcSic6Ne46IPHU2aGK1yTzJroeFGm0+2jcV/xI=; b=F/r4MR+vH0m7KacNkFFVbAErpcCGBM42hrtC6Y2nmGsNrqZVkMeX+tV5D5Uh0F/Zl5PUlvg+DmakAuJ+PYCxqsV1zxa0Bc0l68QXzF67A9tdYoUTNiOtURYMxhGM/8XGC8uXTKXjPsmI5xR8e2ZYgW4yNYJ2q90mnwm/Uya6Kto=
Received: from DBAPR83MB0422.EURPRD83.prod.outlook.com (2603:10a6:10:195::11) by GV1PR83MB0617.EURPRD83.prod.outlook.com (2603:10a6:150:162::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7068.13; Fri, 1 Dec 2023 15:54:01 +0000
Received: from DBAPR83MB0422.EURPRD83.prod.outlook.com ([fe80::c70a:7598:17f:db3d]) by DBAPR83MB0422.EURPRD83.prod.outlook.com ([fe80::c70a:7598:17f:db3d%3]) with mapi id 15.20.7068.014; Fri, 1 Dec 2023 15:54:01 +0000
From: Pieter Kasselman <pieter.kasselman@microsoft.com>
To: Hannes Tschofenig <hannes.tschofenig@gmx.net>, "wimse@ietf.org" <wimse@ietf.org>
Thread-Topic: [Wimse] Request Binding Proofs for Workload Identities
Thread-Index: AdoiPglKPvb+0KT+TgWzxUZxhwGungAm9X6AAGSighA=
Date: Fri, 01 Dec 2023 15:54:00 +0000
Message-ID: <DBAPR83MB0422109C0A23D63D83A490989181A@DBAPR83MB0422.EURPRD83.prod.outlook.com>
References: <DBAPR83MB0422F6D97F9CF28A8FE303EC91BCA@DBAPR83MB0422.EURPRD83.prod.outlook.com> <1577f4bb-a1d5-4035-b274-2a89aafcebf4@gmx.net>
In-Reply-To: <1577f4bb-a1d5-4035-b274-2a89aafcebf4@gmx.net>
Accept-Language: en-IE, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=7296860b-b9c1-4de8-b272-86bd6831deac; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-12-01T15:38:20Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DBAPR83MB0422:EE_|GV1PR83MB0617:EE_
x-ms-office365-filtering-correlation-id: a7a199cb-0d1c-4e20-3558-08dbf285bc81
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: bFuDduOpoi6NvNjSJm4WdEZ742Ck9tX/QfHad3OSmb1XcuQ/B8MTfm4QvfN5h7XmWPKU8NPijLPZz1lUKhg2yrOC0to+sB/AXfaTbK3y1AkVJtB0W80oNhYmLnaX8x0UluJGOtULw0hyDn7KQYdkG3IBvgZkeV9gm97wtHlZo87pHepksjZ1GD1zF6x/DPntSZxGtQH7eh7ZwTyLrHf1iYkzSvFPBbhnUlMvp8ShPJCQEyGnvznCnwsfem8ofL1AmGQWTZaGOFEfKxMBg+caaFcBbeE4MIypxuxdcjTYzCdj8I9A53NvHn5ATc6Y2+Q4+hFzwC5O2OgmpcPQfPxnnqsZ0sNxTBksQsHtcvkdlrWWVdXicWk1eNpH8xZJjdSqSAREP2YJzfmHNmGwukysVIgl206EUoOyX1PY26YBjYwy6MyhuNH+/aaai+tnGV0tabWXoQn31icy/aHUIVhAcMEKOrJeGTOY6P3w0kAGgd7N/OCPe6KoTyo8AmHrEemwWoIY8Np/BliI2m90AufOd+h4z8IajDg4cJ93RQJkBNReCVGWh5EUtyC2zNhz8fyPLYBImg0ZZbkKqn0pHpvxz/mo1AUzzLgCCFSC+REPftMbNMyjngZ6I1T84TMhpG2qCDOkjUOiCSaUEOJNfuAaMQ==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR83MB0422.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376002)(39860400002)(346002)(396003)(136003)(366004)(230922051799003)(1800799012)(64100799003)(451199024)(186009)(38100700002)(38070700009)(55016003)(33656002)(122000001)(8990500004)(41300700001)(2906002)(5660300002)(83380400001)(82960400001)(82950400001)(71200400001)(9686003)(53546011)(26005)(7696005)(6506007)(166002)(110136005)(10290500003)(66946007)(966005)(478600001)(76116006)(66556008)(316002)(66476007)(66446008)(64756008)(86362001)(44832011)(8676002)(52536014)(8936002); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: uEkhlivT64Wf5ORryrIk9COELmGndiLhda2TvPkn3U3QNIcyRV0JPjl9BwUMnH3Mnz6YZTuMt6v1Uys7B96S6KtoK9tFpkiSz+Yz5r+J7xp1gVmF+KRsabyv0RTtgCAbP97IM8+5E7S4pBpKu6dnIQtercFSLDPyS9q87gNPOrU1JV4KL5KeG/0iMhsb9a2uVr11QPbPdX6iRBh/tMSzZBOddp+0gYHzE3YjEQguSVPPVh3jpeV2wmdxod/oGGjGXw8gLRYrUa+JrvUtkRXrD+8C/t1F0prNVqKFkD9kNsfN8bhFS5q6fWn0rUaK40aeEY1m+KVgMm/XLgR7HWsbLPdSdw5MrkVb6hGenq8YG6VhjMufjagAjs0pYQHM7a0M740KAh7PXUkRPU5ra7tgRBDvKtTP0CALNlv5MyOsiuL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cNA4t1XZmPaL01QcDs3p3EeuAw
Content-Type: multipart/alternative; boundary="_000_DBAPR83MB0422109C0A23D63D83A490989181ADBAPR83MB0422EURP_"
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DBAPR83MB0422.EURPRD83.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a7a199cb-0d1c-4e20-3558-08dbf285bc81
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Dec 2023 15:54:00.9730 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: N2cAXEuuHhji1FtcmAxzO4ZzU0RXey7ZhOXU8mDJm6lqGMNVvKl1cMPNuvcIIlVm2yUXMjbfoY2wLbvekWmtbR63Sv0z5/pIRJ9nWW8fHBI=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR83MB0617
Archived-At: <https://mailarchive.ietf.org/arch/msg/wimse/226YDj4B6Kf24OV-MANCtE_KxOc>
Subject: Re: [Wimse] Request Binding Proofs for Workload Identities
X-BeenThere: wimse@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: WIMSE Workload Identity in Multi-Service Environment <wimse.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/wimse>, <mailto:wimse-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/wimse/>
List-Post: <mailto:wimse@ietf.org>
List-Help: <mailto:wimse-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/wimse>, <mailto:wimse-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Dec 2023 15:54:09 -0000

Hi Hannes

I think we may want to distinguish between the different kinds of tokens that are being used and the different purposes they are being used for.

This proposal is not about making replay of OAuth Access Tokens, which carries authorization information, detectable. We have solutions for that (e.g. DPoP).

The use cases I had in mind was more about those cases where tokens (in JWT format) is used for identification\authentication scenarios. The JWT-SVID is an example of this. Imagine a chain of workloads A->B->C. The idea is that if Workload A authenticates to B with their token, and B then uses A's token to impersonate A to C, C can detect it (and preferably reject it, or at least take it into account when making the authorization decision, which may include other information from a transaction token, time of day, the risk management engine and so forth). The proposal is to create a proof (a JWS signature) that contains claims about the request. If workload B presents workload A's JWT to workload C, it will be unable to produce a proof that binds it to the latest request.

Perhaps we should just be as specific as calling it "Request Binding Proofs for JWT SVIDs", although I was hoping we could be a little more generic as there are bound to be other places where JWTs are being used for authentication in this way.

Does that help?

Cheers

Pieter

From: Hannes Tschofenig <hannes.tschofenig@gmx.net>
Sent: Wednesday, November 29, 2023 3:37 PM
To: Pieter Kasselman <pieter.kasselman@microsoft.com>; wimse@ietf.org
Subject: Re: [Wimse] Request Binding Proofs for Workload Identities


Hi Pieter,


Am 28.11.2023 um 22:13 schrieb Pieter Kasselman:
Hi folks

The Constrained Credential Security use case that we identified in draft-gilman-wimse-use-cases-00 - Workload Identity Use Cases (ietf.org)<https://datatracker.ietf.org/doc/draft-gilman-wimse-use-cases/> has been coming up in a number of discussions. The absence of any good mitigations is considered a risk, and given the prevalence of token theft along with the attractiveness of a compromised workload identity, not an entirely unjustified one.



I would like to suggest a different term for this use case, something like "capability restricted token" or "Tokens with reduced permissions". I think this describes it much better since you are talking about limiting the impact of token theft. The text in Section 4.10 of the OAuth Security BCP then come to  mind as possible solutions, such as sender-constrained access tokens or audience-restricted access tokens.



Before going into the details of your solution, I am wondering whether you are expecting



a) the "control plane" to provide a PoP-based service account token to the workload, or

b) that the authorization server provides the PoP token to the workload when the workload presents the service account token.



(Note that I am using the terms from <draft-hofmann-wimse-workload-identity-bcp> to refer to the two different entities issuing tokens.)



Ciao

Hannes


In SPIFFE, for example, it would be highly desirable to have a way to bind a JWT SVID to a transaction to enable workloads and cloud resources to detect if the JWT SVID is being replayed, and if it is, to take it into account when making an authorization decision (e.g. transaction with JWT SVIDs that are being replayed are rejected). Existing mechanism like DPoP that provide similar functionality to sender constrain Access Tokens does not quite work (for reasons that Evan Gilman outlined in the BoF session).

Proposed WIMSE Deliverable
---------------------------------------
One proposal to address this is to introduce the concept of a Request Binding Proof. A Request Binding Proof cryptographically binds a JWT (e.g. JWT SVID) to a request in such a way that the JWT cannot be used with another request without being detected by the recipient of the JWT. When a workload makes a request to another workload or resource, it presents its JWT credential (e.g. a JWT SVID), along with a Request Binding Proof. The receiving workload will use the JWT as a way to authenticate the calling workload and then verify that the Request Binding Proof to ensure the JWT is used in the context of the current request. A specific application of this binding mechanism is to bind a SPIFFE Verifiable Identity Document JWT (SVID JWT) to a request. I would like to propose that the creation of a standard for a Request Binding Proof should be a WIMSE deliverable.

Strawman
--------------
Making a quick strawman sketch of what a transaction binding proof might look like, includes:


  1.  Include a reference to a public key or the public key itself  to JWT used by the workload (e.g. the JWT SVID does not include a public key today)
  2.  Define a request binding proof by profiling the JSON Web Signature (JWS) specification to contain specific claims that can be bound to the request.

Some additional ideas below:

Workload JWT claims (e.g. used as part of a JWT SVID extension)
--------------------------------------------------------------------------------------
To support request binding, JWTs MUST include a kid claim as defined in https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.4 (open question, can this be the X5u or X5t parameter representing the X.509 SVID)?

Request Binding Proof
-----------------------------
The Request Binding Proof is a JWT [RFC7519] that is signed (using JSON Web Signature (JWS) [RFC7515]) with a private key chosen by the workload. The JOSE Header of a Request Binding Proof MUST contain at least the following parameters:

  1.  typ: A field with the value dpop+jwt, which explicitly types the DPoP proof JWT as recommended in Section 3.11 of [RFC8725].
  2.  alg: An identifier for a JWS asymmetric digital signature algorithm from [IANA.JOSE.ALGS]. It MUST NOT be none or an identifier for a symmetric algorithm (Message Authentication Code (MAC)).
  3.  kid: Claim indicating which key was used to secure the JWS. It must match the kid claim in the JWT SVID (open question, can this be the X5u or X5t parameter representing the X.509 SVID).
The JWS payload contains the following claims:

  1.  iat (Issued At): The timestamp at which the Transaction Binding proof was created (REQUIRED)
  2.  jti (JWT ID): A unique identifier for the JWT to mitigate replay attacks (REQUIRED).
  3.  tth: Hash of the Transaction Token (see transaction token draft: https://datatracker.ietf.org/doc/draft-tulshibagwale-oauth-transaction-tokens/ ). The value MUST be the result of a base64url encoding (as defined in Section 2 of [RFC7515]) the SHA-256 [SHS] hash of the ASCII encoding of the associated access token's value. (OPTIONAL)
  4.  rqd: A claim, whose value is a JSON object the describes the request details bound to the workload identity. The contents of the rqd claim changes, depending on the typeof request.

The JSON value of the rqd claim MAY include the following values, depending on the request type (these are meant to illustrative and may not be the most appropriate, correct or sufficient - a topic for discussion):

  1.  htm: The value of the HTTP method (Section 9.1 of [RFC9110]) of the request to which the JWT is attached. This value MUST be used if the request is an HTTP request.
  2.  htu: The HTTP target URI (Section 7.1 of [RFC9110]) of the request to which the JWT is attached, without query and fragment parts. This value MUST be used if the request is an HTTP request.
  3.  krt: The Kafka Request Type. This value MUST be used if this is a Kafka request.
  4.  ktn: The Kafka Topic name to which the request is being directed. This value MUST be used if this is a Kafka request.
  5.  ktp: The Kafka Partition within a topic. This value MUST be used if this is a Kafka request.
  6.  gsm: The gRPC service method. This value MUST be used if this is a gRPC request.
  7.  Other?
The proof is generated by using the private key corresponding to the kid claim in the JWT (e.g. JWT SVID) to sign over the JWT Request Binding Proof (more details to be added).
The Request Binding Proof is verified by using the public key corresponding to the kid claim in the JWT (e.g. JWT SVID) to verify the Transaction Binding Proof. In addition to the cryptographic verification, the verifier MUST verify that:

  1.  The kid claim in the JWT SVID equals the kid claim in the Transaction Bindng Proof
  2.  The iat claim is in the accepted boundaries (less than 5 minutes old).
  3.  The tth claim matches the hash of the Transaction Token hash, if one is used.
  4.  The rqd claim contents matches the actual request details (e.g. htm and htu parameters match).
  5.  Additional verification steps to be added
I would be happy to expand on the above and turn it into a ID draft if there is interest in pursuing this further in WIMSE or elsewhere.
Cheers
Pieter