idnits 2.17.1 draft-ietf-ace-oscore-profile-19.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == There is 1 instance of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (6 May 2021) is 1086 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-46) exists of draft-ietf-ace-oauth-authz-40 == Outdated reference: A later version (-16) exists of draft-ietf-ace-oauth-params-14 ** Downref: Normative reference to an Informational draft: draft-ietf-cose-rfc8152bis-algs (ref. 'I-D.ietf-cose-rfc8152bis-algs') -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-cose-rfc8152bis-struct' ** Downref: Normative reference to an Informational RFC: RFC 5869 -- Obsolete informational reference (is this intentional?): RFC 7231 (Obsoleted by RFC 9110) Summary: 2 errors (**), 0 flaws (~~), 4 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 ACE Working Group F. Palombini 3 Internet-Draft Ericsson AB 4 Intended status: Standards Track L. Seitz 5 Expires: 7 November 2021 Combitech 6 G. Selander 7 Ericsson AB 8 M. Gunnarsson 9 RISE 10 6 May 2021 12 OSCORE Profile of the Authentication and Authorization for Constrained 13 Environments Framework 14 draft-ietf-ace-oscore-profile-19 16 Abstract 18 This document specifies a profile for the Authentication and 19 Authorization for Constrained Environments (ACE) framework. It 20 utilizes Object Security for Constrained RESTful Environments 21 (OSCORE) to provide communication security and proof-of-possession 22 for a key owned by the client and bound to an OAuth 2.0 access token. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on 7 November 2021. 41 Copyright Notice 43 Copyright (c) 2021 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 48 license-info) in effect on the date of publication of this document. 49 Please review these documents carefully, as they describe your rights 50 and restrictions with respect to this document. Code Components 51 extracted from this document must include Simplified BSD License text 52 as described in Section 4.e of the Trust Legal Provisions and are 53 provided without warranty as described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 58 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 59 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 4 60 3. Client-AS Communication . . . . . . . . . . . . . . . . . . . 7 61 3.1. C-to-AS: POST to token endpoint . . . . . . . . . . . . . 7 62 3.2. AS-to-C: Access Token . . . . . . . . . . . . . . . . . . 9 63 3.2.1. The OSCORE_Input_Material . . . . . . . . . . . . . . 13 64 4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 16 65 4.1. C-to-RS: POST to authz-info endpoint . . . . . . . . . . 16 66 4.1.1. The Nonce 1 Parameter . . . . . . . . . . . . . . . . 18 67 4.1.2. The ace_client_recipientid Parameter . . . . . . . . 18 68 4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 19 69 4.2.1. The Nonce 2 Parameter . . . . . . . . . . . . . . . . 20 70 4.2.2. The ace_server_recipientid Parameter . . . . . . . . 20 71 4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 20 72 4.4. Access rights verification . . . . . . . . . . . . . . . 23 73 5. Secure Communication with AS . . . . . . . . . . . . . . . . 23 74 6. Discarding the Security Context . . . . . . . . . . . . . . . 23 75 7. Security Considerations . . . . . . . . . . . . . . . . . . . 24 76 8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 26 77 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 78 9.1. ACE Profile Registry . . . . . . . . . . . . . . . . . . 27 79 9.2. OAuth Parameters Registry . . . . . . . . . . . . . . . . 27 80 9.3. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 27 81 9.4. OSCORE Security Context Parameters Registry . . . . . . . 28 82 9.5. CWT Confirmation Methods Registry . . . . . . . . . . . . 29 83 9.6. JWT Confirmation Methods Registry . . . . . . . . . . . . 29 84 9.7. Expert Review Instructions . . . . . . . . . . . . . . . 29 85 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 30 86 10.1. Normative References . . . . . . . . . . . . . . . . . . 30 87 10.2. Informative References . . . . . . . . . . . . . . . . . 32 88 Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 33 89 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 34 90 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 34 92 1. Introduction 94 This document specifies the "coap_oscore" profile of the ACE 95 framework [I-D.ietf-ace-oauth-authz]. In this profile, a client and 96 a resource server use the Constrained Application Protocol (CoAP) 97 [RFC7252] to communicate. The client uses an access token, bound to 98 a symmetric key (the proof-of-possession key) to authorize its access 99 to the resource server. Note that this profile uses a symmetric- 100 crypto-based scheme, where the symmetric secret is used as input 101 material for keying material derivation. In order to provide 102 communication security and proof of possession, the client and 103 resource server use Object Security for Constrained RESTful 104 Environments (OSCORE) [RFC8613]. Note that the proof of possession 105 is not achieved through a dedicated protocol element, but rather 106 occurs after the first message exchange using OSCORE. 108 OSCORE specifies how to use CBOR Object Signing and Encryption (COSE) 109 [I-D.ietf-cose-rfc8152bis-struct][I-D.ietf-cose-rfc8152bis-algs] to 110 secure CoAP messages. Note that OSCORE can be used to secure CoAP 111 messages, as well as HTTP and combinations of HTTP and CoAP; a 112 profile of ACE similar to the one described in this document, with 113 the difference of using HTTP instead of CoAP as communication 114 protocol, could be specified analogously to this one. 116 1.1. Terminology 118 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 119 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 120 "OPTIONAL" in this document are to be interpreted as described in BCP 121 14 [RFC2119] [RFC8174] when, and only when, they appear in all 122 capitals, as shown here. 124 Certain security-related terms such as "authentication", 125 "authorization", "confidentiality", "(data) integrity", "Message 126 Authentication Code (MAC)", "Hash-based Message Authentication Code 127 (HMAC)", and "verify" are taken from [RFC4949]. 129 RESTful terminology follows HTTP [RFC7231]. 131 Readers are expected to be familiar with the terms and concepts 132 defined in OSCORE [RFC8613], such as "Security Context" and 133 "Recipient ID". 135 Terminology for entities in the architecture is defined in OAuth 2.0 136 [RFC6749], such as client (C), resource server (RS), and 137 authorization server (AS). It is assumed in this document that a 138 given resource on a specific RS is associated to a unique AS. 140 Concise Binary Object Representation (CBOR) [RFC8949] and Concise 141 Data Definition Language (CDDL) [RFC8610] are used in this document. 142 CDDL predefined type names, especially bstr for CBOR byte strings and 143 tstr for CBOR text strings, are used extensively in this document. 145 Note that the term "endpoint" is used here, as in 146 [I-D.ietf-ace-oauth-authz], following its OAuth definition, which is 147 to denote resources such as token and introspect at the AS and authz- 148 info at the RS. The CoAP [RFC7252] definition, which is "An entity 149 participating in the CoAP protocol" is not used in this document. 151 Examples throughout this document are expressed in CBOR diagnostic 152 notation without the tag and value abbreviations. 154 2. Protocol Overview 156 This section gives an overview of how to use the ACE Framework 157 [I-D.ietf-ace-oauth-authz] to secure the communication between a 158 client and a resource server using OSCORE [RFC8613]. The parameters 159 needed by the client to negotiate the use of this profile with the 160 authorization server, as well as the OSCORE setup process, are 161 described in detail in the following sections. 163 The RS maintains a collection of OSCORE Security Contexts with 164 associated authorization information for all the clients that it is 165 communicating with. The authorization information is maintained as 166 policy that is used as input to processing requests from those 167 clients. 169 This profile requires a client to retrieve an access token from the 170 AS for the resource it wants to access on an RS, by sending an access 171 token request to the token endpoint, as specified in section 5.8 of 172 [I-D.ietf-ace-oauth-authz]. The access token request and response 173 MUST be confidentiality-protected and ensure authenticity. This 174 profile RECOMMENDS the use of OSCORE between client and AS, to reduce 175 the number of libraries the client has to support, but other 176 protocols fulfilling the security requirements defined in section 5 177 of [I-D.ietf-ace-oauth-authz] MAY alternatively be used, such as TLS 178 [RFC8446] or DTLS [I-D.ietf-tls-dtls13]. 180 Once the client has retrieved the access token, it generates a nonce 181 N1, defined in this document (see Section 4.1.1). The client also 182 generates its own OSCORE Recipient ID ID1 (see Section 3.1 of 183 [RFC8613]), for use with the keying material associated to the RS. 184 The client posts the token, N1 and its Recipient ID to the RS using 185 the authz-info endpoint and mechanisms specified in section 5.8 of 186 [I-D.ietf-ace-oauth-authz] and Content-Format = application/ace+cbor. 187 When using this profile, the communication with the authz-info 188 endpoint is not protected, except for update of access rights. 190 If the access token is valid, the RS replies to this request with a 191 2.01 (Created) response with Content-Format = application/ace+cbor, 192 which contains a nonce N2 and its newly generated OSCORE Recipient 193 ID, ID2, for use with the keying material associated to the client. 194 Moreover, the server concatenates the input salt received in the 195 token, N1, and N2 to obtain the Master Salt of the OSCORE Security 196 Context (see section 3 of [RFC8613]). The RS then derives the 197 complete Security Context associated with the received token from the 198 Master Salt, the OSCORE Recipient ID generated by the client (set as 199 its OSCORE Sender ID), its own OSCORE Recipient ID, plus the 200 parameters received in the access token from the AS, following 201 section 3.2 of [RFC8613]. 203 In a similar way, after receiving the nonce N2, the client 204 concatenates the input salt, N1 and N2 to obtain the Master Salt of 205 the OSCORE Security Context. The client then derives the complete 206 Security Context from the Master Salt, the OSCORE Recipient ID 207 generated by the RS (set as its OSCORE Sender ID), its own OSCORE 208 Recipient ID, plus the parameters received from the AS. 210 Finally, the client starts the communication with the RS by sending a 211 request protected with OSCORE to the RS. If the request is 212 successfully verified, the server stores the complete Security 213 Context state that is ready for use in protecting messages, and uses 214 it in the response, and in further communications with the client, 215 until token deletion due to, for example, expiration. This Security 216 Context is discarded when a token (whether the same or a different 217 one) is used to successfully derive a new Security Context for that 218 client. 220 The use of nonces N1 and N2 during the exchange prevents the reuse of 221 an Authenticated Encryption with Associated Data (AEAD) nonce/key 222 pair for two different messages. Reuse might otherwise occur when 223 client and RS derive a new Security Context from an existing (non- 224 expired) access token, as might occur when either party has just 225 rebooted, and might lead to loss of both confidentiality and 226 integrity. Instead, by using the exchanged nonces N1 and N2 as part 227 of the Master Salt, the request to the authz-info endpoint posting 228 the same token results in a different Security Context, by OSCORE 229 construction, since even though the Master Secret, Sender ID and 230 Recipient ID are the same, the Master Salt is different (see 231 Section 3.2.1 of [RFC8613]). If the exchanged nonces were reused, a 232 node reusing a non-expired old token would be susceptible to on-path 233 attackers provoking the creation of an OSCORE message using an old 234 AEAD key and nonce. 236 After the whole message exchange has taken place, the client can 237 contact the AS to request an update of its access rights, sending a 238 similar request to the token endpoint that also includes an 239 identifier so that the AS can find the correct OSCORE security input 240 material it has previously shared with the client. This specific 241 identifier, encoded as a byte string, is assigned by the AS to be 242 unique in the sets of its OSCORE security input materials, and is not 243 used as input material to derive the full OSCORE Security Context. 245 An overview of the profile flow for the OSCORE profile is given in 246 Figure 1. The names of messages coincide with those of 247 [I-D.ietf-ace-oauth-authz] when applicable. 249 C RS AS 250 | | | 251 | ----- POST /token ----------------------------> | 252 | | | 253 | <---------------------------- Access Token ----- | 254 | + Access Information | 255 | ---- POST /authz-info ---> | | 256 | (access_token, N1, ID1) | | 257 | | | 258 | <- 2.01 Created (N2, ID2)- | | 259 | | | 260 /Sec Context /Sec Context | 261 derivation/ derivation/ | 262 | | | 263 | ---- OSCORE Request -----> | | 264 | | | 265 | /proof-of-possession | 266 | Sec Context storage/ | 267 | | | 268 | <--- OSCORE Response ----- | | 269 | | | 270 /proof-of-possession | | 271 Sec Context storage/ | | 272 | | | 273 | ---- OSCORE Request -----> | | 274 | | | 275 | <--- OSCORE Response ----- | | 276 | | | 277 | ... | | 279 Figure 1: Protocol Overview 281 3. Client-AS Communication 283 The following subsections describe the details of the POST request 284 and response to the token endpoint between client and AS. 285 Section 3.2 of [RFC8613] defines how to derive a Security Context 286 based on a shared master secret and a set of other parameters, 287 established between client and server, which the client receives from 288 the AS in this exchange. The proof-of-possession key (pop-key) 289 included in the response from the AS MUST be used as master secret in 290 OSCORE. 292 3.1. C-to-AS: POST to token endpoint 294 The client-to-AS request is specified in Section 5.8.1 of 295 [I-D.ietf-ace-oauth-authz]. 297 The client must send this POST request to the token endpoint over a 298 secure channel that guarantees authentication, message integrity and 299 confidentiality (see Section 5). 301 An example of such a request is shown in Figure 2 303 Header: POST (Code=0.02) 304 Uri-Host: "as.example.com" 305 Uri-Path: "token" 306 Content-Format: "application/ace+cbor" 307 Payload: 308 { 309 "audience" : "tempSensor4711", 310 "scope" : "read" 311 } 313 Figure 2: Example C-to-AS POST /token request for an access token 314 bound to a symmetric key. 316 If the client wants to update its access rights without changing an 317 existing OSCORE Security Context, it MUST include in its POST request 318 to the token endpoint a req_cnf object, with the kid field carrying a 319 CBOR byte string containing the OSCORE Input Material Identifier 320 (assigned as discussed in Section 3.2). This identifier, together 321 with other information such as audience (see Section 5.8.1 of 322 [I-D.ietf-ace-oauth-authz]), can be used by the AS to determine the 323 shared secret bound to the proof-of-possession token and therefore 324 MUST identify a symmetric key that was previously generated by the AS 325 as a shared secret for the communication between the client and the 326 RS. The AS MUST verify that the received value identifies a proof- 327 of-possession key that has previously been issued to the requesting 328 client. If that is not the case, the Client-to-AS request MUST be 329 declined with the error code "invalid_request" as defined in 330 Section 5.8.3 of [I-D.ietf-ace-oauth-authz]. 332 An example of such a request is shown in Figure 3 333 Header: POST (Code=0.02) 334 Uri-Host: "as.example.com" 335 Uri-Path: "token" 336 Content-Format: "application/ace+cbor" 337 Payload: 338 { 339 "audience" : "tempSensor4711", 340 "scope" : "write", 341 "req_cnf" : { 342 "kid" : h'01' 343 } 345 Figure 3: Example C-to-AS POST /token request for updating rights 346 to an access token bound to a symmetric key. 348 3.2. AS-to-C: Access Token 350 After verifying the POST request to the token endpoint and that the 351 client is authorized to obtain an access token corresponding to its 352 access token request, the AS responds as defined in section 5.8.2 of 353 [I-D.ietf-ace-oauth-authz]. If the client request was invalid, or 354 not authorized, the AS returns an error response as described in 355 section 5.8.3 of [I-D.ietf-ace-oauth-authz]. 357 The AS can signal that the use of OSCORE is REQUIRED for a specific 358 access token by including the "ace_profile" parameter with the value 359 "coap_oscore" in the access token response. This means that the 360 client MUST use OSCORE towards all resource servers for which this 361 access token is valid, and follow Section 4.3 to derive the security 362 context to run OSCORE. Usually it is assumed that constrained 363 devices will be pre-configured with the necessary profile, so that 364 this kind of profile signaling can be omitted. 366 Moreover, the AS MUST send the following data: 368 * a master secret 370 * an identifier of the OSCORE Input Material 372 Additionally, the AS MAY send the following data, in the same 373 response. 375 * a context identifier 377 * an AEAD algorithm 378 * an HMAC-based key derivation function (HKDF, [RFC5869]) algorithm, 379 see section 3.1 of [I-D.ietf-cose-rfc8152bis-algs] 381 * a salt 383 * the OSCORE version number 385 This data is transported in the OSCORE_Input_Material. The 386 OSCORE_Input_Material is a CBOR map object, defined in Section 3.2.1. 387 This object is transported in the "cnf" parameter of the access token 388 response as defined in Section 3.2 of [I-D.ietf-ace-oauth-params], as 389 the value of a field named "osc", registered in Section 9.5 and 390 Section 9.6. 392 The AS MAY assign an identifier to the context (context identifier). 393 This identifier is used as ID Context in the OSCORE context as 394 described in section 3.1 of [RFC8613]. If assigned, this parameters 395 MUST be communicated as the "contextId" field in the 396 OSCORE_Input_Material. The application needs to consider that this 397 identifier is sent in the clear and may reveal information about the 398 endpoints, as mentioned in section 12.8 of [RFC8613]. 400 The master secret and the identifier of the OSCORE_Input_Material 401 MUST be communicated as the "ms" and "id" field in the "osc" field in 402 the "cnf" parameter of the access token response. If included, the 403 AEAD algorithm is sent in the "alg" parameter in the 404 OSCORE_Input_Material; the HKDF algorithm in the "hkdf" parameter of 405 the OSCORE_Input_Material; a salt in the "salt" parameter of the 406 OSCORE_Input_Material; and the OSCORE version in the "version" 407 parameter of the OSCORE_Input_Material. 409 The same parameters MUST be included in the claims associated with 410 the access token. The OSCORE master secret MUST be encrypted by the 411 authorization server so that only the resource server can decrypt it 412 (see Section 6.1. of [I-D.ietf-ace-oauth-authz]). This profile 413 RECOMMENDS the use of a CBOR web token (CWT) protected with 414 COSE_Encrypt/COSE_Encrypt0 as specified in [RFC8392]. If the token 415 is a CWT, the same OSCORE_Input_Material structure defined above MUST 416 be placed in the "osc" field of the "cnf" claim of this token. 418 The AS MUST send different OSCORE_Input_Material (and therefore 419 different access tokens) to different authorized clients, in order 420 for the RS to differentiate between clients. 422 Figure 4 shows an example of an AS response. The access token has 423 been truncated for readability. 425 Header: Created (Code=2.01) 426 Content-Type: "application/ace+cbor" 427 Payload: 428 { 429 "access_token" : h'8343a1010aa2044c53 ... 430 (remainder of access token (CWT) omitted for brevity)', 431 "ace_profile" : "coap_oscore", 432 "expires_in" : "3600", 433 "cnf" : { 434 "osc" : { 435 "id" : h'01', 436 "ms" : h'f9af838368e353e78888e1426bd94e6f' 437 } 438 } 439 } 441 Figure 4: Example AS-to-C Access Token response with OSCORE profile. 443 Figure 5 shows an example CWT Claims Set, including the relevant 444 OSCORE parameters in the "cnf" claim. 446 { 447 "aud" : "tempSensorInLivingRoom", 448 "iat" : "1360189224", 449 "exp" : "1360289224", 450 "scope" : "temperature_g firmware_p", 451 "cnf" : { 452 "osc" : { 453 "ms" : h'f9af838368e353e78888e1426bd94e6f', 454 "id" : h'01' 455 } 456 } 457 } 459 Figure 5: Example CWT Claims Set with OSCORE parameters. 461 The same CWT Claims Set as in Figure 5, using the value abbreviations 462 defined in [I-D.ietf-ace-oauth-authz] and [RFC8747] and encoded in 463 CBOR is shown in Figure 6. The bytes in hexadecimal are reported in 464 the first column, while their corresponding CBOR meaning is reported 465 after the "#" sign on the second column, for easiness of readability. 467 NOTE TO THE RFC EDITOR: before publishing, it should be checked (and 468 in case fixed) that the values used below (which are not yet 469 registered) are the final values registered in IANA. 471 A5 # map(5) 472 63 # text(3) 473 617564 # "aud" 474 76 # text(22) 475 74656D7053656E736F72496E4C6976696E67526F6F6D 476 # "tempSensorInLivingRoom" 477 63 # text(3) 478 696174 # "iat" 479 6A # text(10) 480 31333630313839323234 # "1360189224" 481 63 # text(3) 482 657870 # "exp" 483 6A # text(10) 484 31333630323839323234 # "1360289224" 485 65 # text(5) 486 73636F7065 # "scope" 487 78 18 # text(24) 488 74656D70657261747572655F67206669726D776172655F70 489 # "temperature_g firmware_p" 490 63 # text(3) 491 636E66 # "cnf" 492 A1 # map(1) 493 63 # text(3) 494 6F7363 # "osc" 495 A2 # map(2) 496 62 # text(2) 497 6D73 # "ms" 498 50 # bytes(16) 499 F9AF838368E353E78888E1426BD94E6F 500 # "\xF9\xAF\x83\x83h\xE3S\xE7 501 \x88\x88\xE1Bk\xD9No" 502 62 # text(2) 503 6964 # "id" 504 41 # bytes(1) 505 01 # "\x01" 507 Figure 6: Example CWT Claims Set with OSCORE parameters, CBOR 508 encoded. 510 If the client has requested an update to its access rights using the 511 same OSCORE Security Context, which is valid and authorized, the AS 512 MUST omit the "cnf" parameter in the response, and MUST carry the 513 OSCORE Input Material identifier in the "kid" field in the "cnf" 514 claim of the token. This identifier needs to be included in the 515 token in order for the RS to identify the correct OSCORE Input 516 Material. 518 Figure 7 shows an example of such an AS response The access token has 519 been truncated for readability. 521 Header: Created (Code=2.01) 522 Content-Type: "application/ace+cbor" 523 Payload: 524 { 525 "access_token" : h'8343a1010aa2044c53 ... 526 (remainder of access token (CWT) omitted for brevity)', 527 "ace_profile" : "coap_oscore", 528 "expires_in" : "3600" 529 } 531 Figure 7: Example AS-to-C Access Token response with OSCORE 532 profile, for update of access rights. 534 Figure 8 shows an example CWT Claims Set, containing the necessary 535 OSCORE parameters in the "cnf" claim for update of access rights. 537 { 538 "aud" : "tempSensorInLivingRoom", 539 "iat" : "1360189224", 540 "exp" : "1360289224", 541 "scope" : "temperature_h", 542 "cnf" : { 543 "kid" : h'01' 544 } 545 } 547 Figure 8: Example CWT Claims Set with OSCORE parameters for 548 update of access rights. 550 3.2.1. The OSCORE_Input_Material 552 An OSCORE_Input_Material is an object that represents the input 553 material to derive an OSCORE Security Context, i.e., the local set of 554 information elements necessary to carry out the cryptographic 555 operations in OSCORE (Section 3.1 of [RFC8613]). In particular, the 556 OSCORE_Input_Material is defined to be serialized and transported 557 between nodes, as specified by this document, but can also be used by 558 other specifications if needed. The OSCORE_Input_Material can either 559 be encoded as a JSON object or as a CBOR map. The set of common 560 parameters that can appear in an OSCORE_Input_Material can be found 561 in the IANA "OSCORE Security Context Parameters" registry 562 (Section 9.4), defined for extensibility, and the initial set of 563 parameters defined in this document is specified below. All 564 parameters are optional. Table 1 provides a summary of the 565 OSCORE_Input_Material parameters defined in this section. 567 +===========+=======+==========+===================+===============+ 568 | name | CBOR | CBOR | registry | description | 569 | | label | type | | | 570 +===========+=======+==========+===================+===============+ 571 | id | 0 | byte | | OSCORE Input | 572 | | | string | | Material | 573 | | | | | Identifier | 574 +-----------+-------+----------+-------------------+---------------+ 575 | version | 1 | unsigned | | OSCORE | 576 | | | integer | | Version | 577 +-----------+-------+----------+-------------------+---------------+ 578 | ms | 2 | byte | | OSCORE Master | 579 | | | string | | Secret value | 580 +-----------+-------+----------+-------------------+---------------+ 581 | hkdf | 3 | text | [COSE.Algorithms] | OSCORE HKDF | 582 | | | string / | Values (HMAC- | value | 583 | | | integer | based) | | 584 +-----------+-------+----------+-------------------+---------------+ 585 | alg | 4 | text | [COSE.Algorithms] | OSCORE AEAD | 586 | | | string / | Values (AEAD) | Algorithm | 587 | | | integer | | value | 588 +-----------+-------+----------+-------------------+---------------+ 589 | salt | 5 | byte | | an input to | 590 | | | string | | OSCORE Master | 591 | | | | | Salt value | 592 +-----------+-------+----------+-------------------+---------------+ 593 | contextId | 6 | byte | | OSCORE ID | 594 | | | string | | Context value | 595 +-----------+-------+----------+-------------------+---------------+ 597 Table 1: OSCORE_Input_Material Parameters 599 id: This parameter identifies the OSCORE_Input_Material and is 600 encoded as a byte string. In JSON, the "id" value is a Base64 601 encoded byte string. In CBOR, the "id" type is byte string, and 602 has label 0. 604 version: This parameter identifies the OSCORE Version number, which 605 is an unsigned integer. For more information about this field, 606 see section 5.4 of [RFC8613]. In JSON, the "version" value is an 607 integer. In CBOR, the "version" type is integer, and has label 1. 609 ms: This parameter identifies the OSCORE Master Secret value, which 610 is a byte string. For more information about this field, see 611 section 3.1 of [RFC8613]. In JSON, the "ms" value is a Base64 612 encoded byte string. In CBOR, the "ms" type is byte string, and 613 has label 2. 615 hkdf: This parameter identifies the OSCORE HKDF Algorithm. For more 616 information about this field, see section 3.1 of [RFC8613]. The 617 values used MUST be registered in the IANA "COSE Algorithms" 618 registry (see [COSE.Algorithms]) and MUST be HMAC-based HKDF 619 algorithms (see section 3.1 of [I-D.ietf-cose-rfc8152bis-algs]). 620 The value can either be the integer or the text string value of 621 the HMAC-based HKDF algorithm in the "COSE Algorithms" registry. 622 In JSON, the "hkdf" value is a case-sensitive ASCII string or an 623 integer. In CBOR, the "hkdf" type is text string or integer, and 624 has label 3. 626 alg: This parameter identifies the OSCORE AEAD Algorithm. For more 627 information about this field, see section 3.1 of [RFC8613] The 628 values used MUST be registered in the IANA "COSE Algorithms" 629 registry (see [COSE.Algorithms]) and MUST be AEAD algorithms. The 630 value can either be the integer or the text string value of the 631 HMAC-based HKDF algorithm in the "COSE Algorithms" registry. In 632 JSON, the "alg" value is a case-sensitive ASCII string or an 633 integer. In CBOR, the "alg" type is text string or integer, and 634 has label 4. 636 salt: This parameter identifies an input to the OSCORE Master Salt 637 value, which is a byte string. For more information about this 638 field, see section 3.1 of [RFC8613]. In JSON, the "salt" value is 639 a Base64 encoded byte string. In CBOR, the "salt" type is byte 640 string, and has label 5. 642 contextId: This parameter identifies the security context as a byte 643 string. This identifier is used as OSCORE ID Context. For more 644 information about this field, see section 3.1 of [RFC8613]. In 645 JSON, the "contextID" value is a Base64 encoded byte string. In 646 CBOR, the "contextID" type is byte string, and has label 6. 648 An example of JSON OSCORE_Input_Material is given in Figure 9. 650 "osc" : { 651 "alg" : "AES-CCM-16-64-128", 652 "id" : b64'AQ==' 653 "ms" : b64'+a+Dg2jjU+eIiOFCa9lObw' 654 } 656 Figure 9: Example JSON OSCORE_Input_Material 658 The CDDL grammar describing the CBOR OSCORE_Input_Material is: 660 OSCORE_Input_Material = { 661 ? 0 => bstr, ; id 662 ? 1 => int, ; version 663 ? 2 => bstr, ; ms 664 ? 3 => tstr / int, ; hkdf 665 ? 4 => tstr / int, ; alg 666 ? 5 => bstr, ; salt 667 ? 6 => bstr, ; contextId 668 * int / tstr => any 669 } 671 4. Client-RS Communication 673 The following subsections describe the details of the POST request 674 and response to the authz-info endpoint between client and RS. The 675 client generates a nonce N1 and an identifier ID1 unique in the sets 676 of its own Recipient IDs, and posts them together with the token that 677 includes the materials (e.g., OSCORE parameters) received from the AS 678 to the RS. The RS then generates a nonce N2 and an identifier ID2 679 unique in the sets of its own Recipient IDs, and uses Section 3.2 of 680 [RFC8613] to derive a security context based on a shared master 681 secret, the two exchanged nonces and the two identifiers, established 682 between client and server. The exchanged nonces and identifiers are 683 encoded as CBOR byte string if CBOR is used, and as Base64 string if 684 JSON is used. This security context is used to protect all future 685 communication between client and RS using OSCORE, as long as the 686 access token is valid. 688 Note that the RS and client authenticate each other by generating the 689 shared OSCORE Security Context using the pop-key as master secret. 690 An attacker posting a valid token to the RS will not be able to 691 generate a valid OSCORE Security Context and thus not be able to 692 prove possession of the pop-key. Additionally, the mutual 693 authentication is only achieved after the client has successfully 694 verified a response from the RS protected with the generated OSCORE 695 Security Context. 697 4.1. C-to-RS: POST to authz-info endpoint 699 The client MUST generate a nonce value N1 very unlikely to have been 700 previously used with the same input keying material. This profile 701 RECOMMENDS using a 64-bit long random number as the nonce's value. 702 The client MUST store the nonce N1 as long as the response from the 703 RS is not received and the access token related to it is still valid 704 (to the best of the client's knowledge). 706 The client generates its own Recipient ID, ID1, for the OSCORE 707 Security Context that it is establishing with the RS. By generating 708 its own Recipient ID, the client makes sure that it does not collide 709 with any of its Recipient IDs, nor with any other identifier ID1 if 710 the client is executing this exchange with a different RS at the same 711 time. 713 The client MUST use CoAP and the Authorization Information resource 714 as described in section 5.8.1 of [I-D.ietf-ace-oauth-authz] to 715 transport the token, N1 and ID1 to the RS. 717 Note that the use of the payload and the Content-Format is different 718 from what is described in section 5.8.1 of 719 [I-D.ietf-ace-oauth-authz], which only transports the token without 720 any CBOR wrapping. In this profile, the client MUST wrap the token, 721 N1 and ID1 in a CBOR map. The client MUST use the Content-Format 722 "application/ace+cbor" defined in section 8.14 of 723 [I-D.ietf-ace-oauth-authz]. The client MUST include the access token 724 using the "access_token" parameter, N1 using the "nonce1" parameter 725 defined in Section 4.1.1, and ID1 using the "ace_client_recipientid" 726 parameter defined in Section 4.1.2. 728 The communication with the authz-info endpoint does not have to be 729 protected, except for the update of access rights case described 730 below. 732 Note that a client may be required to re-POST the access token in 733 order to complete a request, since an RS may delete a stored access 734 token (and associated Security Context) at any time, for example due 735 to all storage space being consumed. This situation is detected by 736 the client when it receives an AS Request Creation Hints response. 737 Reposting the same access token will result in deriving a new OSCORE 738 Security Context to be used with the RS, as different exchanged 739 nonces will be used. 741 The client may also choose to re-POST the access token in order to 742 update its OSCORE Security Context. In that case, the client and the 743 RS will exchange newly generated nonces, re-negotiate identifiers, 744 and derive new keying material. The client and RS might decide to 745 keep the same identifiers or renew them during the re-negotiation. 747 Figure 10 shows an example of the request sent from the client to the 748 RS. The access token has been truncated for readability. 750 Header: POST (Code=0.02) 751 Uri-Host: "rs.example.com" 752 Uri-Path: "authz-info" 753 Content-Format: "application/ace+cbor" 754 Payload: 755 { 756 "access_token": h'8343a1010aa2044c53 ... 757 (remainder of access token (CWT) omitted for brevity)', 758 "nonce1": h'018a278f7faab55a', 759 "ace_client_recipientid" : h'1645' 760 } 762 Figure 10: Example C-to-RS POST /authz-info request using CWT 764 If the client has already posted a valid token, has already 765 established a security association with the RS, and wants to update 766 its access rights, the client can do so by posting the new token 767 (retrieved from the AS and containing the update of access rights) to 768 the /authz-info endpoint. The client MUST protect the request using 769 the OSCORE Security Context established during the first token 770 exchange. The client MUST only send the "access_token" field in the 771 CBOR map in the payload, no nonce or identifier are sent. After 772 proper verification (see Section 4.2), the RS will replace the old 773 token with the new one, maintaining the same Security Context. 775 4.1.1. The Nonce 1 Parameter 777 This parameter MUST be sent from the client to the RS, together with 778 the access token, if the ace profile used is coap_oscore, and the 779 message is not an update of access rights, protected with an existing 780 OSCORE Security Context. The parameter is encoded as a byte string 781 for CBOR-based interactions, and as a string (Base64 encoded binary) 782 for JSON-based interactions. This parameter is registered in 783 Section 9.2. 785 4.1.2. The ace_client_recipientid Parameter 787 This parameter MUST be sent from the client to the RS, together with 788 the access token, if the ace profile used is coap_oscore, and the 789 message is not an update of access rights, protected with an existing 790 OSCORE Security Context. The parameter is encoded as a byte string 791 for CBOR-based interactions, and as a string (Base64 encoded binary) 792 for JSON-based interactions. This parameter is registered in 793 Section 9.2. 795 4.2. RS-to-C: 2.01 (Created) 797 The RS MUST follow the procedures defined in section 5.8.1 of 798 [I-D.ietf-ace-oauth-authz]: the RS must verify the validity of the 799 token. If the token is valid, the RS must respond to the POST 800 request with 2.01 (Created). If the token is valid but is associated 801 to claims that the RS cannot process (e.g., an unknown scope), or if 802 any of the expected parameters is missing (e.g., any of the mandatory 803 parameters from the AS or the identifier "id1"), or if any parameters 804 received in the "osc" field is unrecognized, the RS must respond with 805 an error response code equivalent to the CoAP code 4.00 (Bad 806 Request). In the latter two cases, the RS may provide additional 807 information in the error response, in order to clarify what went 808 wrong. The RS may make an introspection request (see Section 5.9.1 809 of [I-D.ietf-ace-oauth-authz]) to validate the token before 810 responding to the POST request to the authz-info endpoint. 812 Additionally, the RS MUST generate a nonce N2 very unlikely to have 813 been previously used with the same input keying material, and its own 814 Recipient ID, ID2. The RS makes sure that ID2 does not collide with 815 any of its Recipient IDs. The RS MUST ensure that ID2 is different 816 from the value received in the ace_client_recipientid parameter. The 817 RS sends N2 and ID2 within the 2.01 (Created) response. The payload 818 of the 2.01 (Created) response MUST be a CBOR map containing the 819 "nonce2" parameter defined in Section 4.2.1, set to N2, and the 820 "ace_server_recipientid" parameter defined in Section 4.2.2, set to 821 ID2. This profile RECOMMENDS using a 64-bit long random number as 822 the nonce's value. The RS MUST use the Content-Format "application/ 823 ace+cbor" defined in section 8.14 of [I-D.ietf-ace-oauth-authz]. 825 Figure 11 shows an example of the response sent from the RS to the 826 client. 828 Header: Created (Code=2.01) 829 Content-Format: "application/ace+cbor" 830 Payload: 831 { 832 "nonce2": h'25a8991cd700ac01', 833 "ace_server_recipientid" : h'0000' 834 } 836 Figure 11: Example RS-to-C 2.01 (Created) response 838 As specified in section 5.8.3 of [I-D.ietf-ace-oauth-authz], the RS 839 must notify the client with an error response with code 4.01 840 (Unauthorized) for any long running request before terminating the 841 session, when the access token expires. 843 If the RS receives the token in a OSCORE protected message, it means 844 that the client is requesting an update of access rights. The RS 845 MUST ignore any nonce and identifiers in the request, if any was 846 sent. The RS MUST check that the "kid" of the "cnf" claim of the new 847 access token matches the identifier of the OSCORE Input Material of 848 the context used to protect the message. If that is the case, the RS 849 MUST overwrite the old token and associate the new token to the 850 Security Context identified by the "kid" value in the "cnf" claim. 851 The RS MUST respond with a 2.01 (Created) response protected with the 852 same Security Context, with no payload. If any verification fails, 853 the RS MUST respond with a 4.01 (Unauthorized) error response. 855 As specified in section 5.8.1 of [I-D.ietf-ace-oauth-authz], when 856 receiving an updated access token with updated authorization 857 information from the client (see Section 3.1), it is recommended that 858 the RS overwrites the previous token, that is only the latest 859 authorization information in the token received by the RS is valid. 860 This simplifies the process needed by the RS to keep track of 861 authorization information for a given client. 863 4.2.1. The Nonce 2 Parameter 865 This parameter MUST be sent from the RS to the client if the ace 866 profile used is coap_oscore, and the message is not a response to an 867 update of access rights, protected with an existing OSCORE Security 868 Context. The parameter is encoded as a byte string for CBOR-based 869 interactions, and as a string (Base64 encoded binary) for JSON-based 870 interactions. This parameter is registered in Section 9.2 872 4.2.2. The ace_server_recipientid Parameter 874 This parameter MUST be sent from the RS to the client if the ace 875 profile used is coap_oscore, and the message is not a response to an 876 update of access rights, protected with an existing OSCORE Security 877 Context. The parameter is encoded as a byte string for CBOR-based 878 interactions, and as a string (Base64 encoded binary) for JSON-based 879 interactions. This parameter is registered in Section 9.2 881 4.3. OSCORE Setup 883 Once the 2.01 (Created) response is received from the RS, following 884 the POST request to authz-info endpoint, the client MUST extract the 885 bstr nonce N2 from the "nonce2" parameter in the CBOR map in the 886 payload of the response. Then, the client MUST set the Master Salt 887 of the Security Context created to communicate with the RS to the 888 concatenation of salt, N1, and N2, in this order: Master Salt = 889 salt | N1 | N2, where | denotes byte string concatenation, where salt 890 is the CBOR byte string received from the AS in Section 3.2, and 891 where N1 and N2 are the two nonces encoded as CBOR byte strings. An 892 example of Master Salt construction using CBOR encoding is given in 893 Figure 12. 895 N1, N2 and input salt expressed in CBOR diagnostic notation: 896 nonce1 = h'018a278f7faab55a' 897 nonce2 = h'25a8991cd700ac01' 898 input salt = h'f9af838368e353e78888e1426bd94e6f' 900 N1, N2 and input salt as CBOR encoded byte strings: 901 nonce1 = 0x48018a278f7faab55a 902 nonce2 = 0x4825a8991cd700ac01 903 input salt = 0x50f9af838368e353e78888e1426bd94e6f 905 Master Salt = 0x50 f9af838368e353e78888e1426bd94e6f 906 48 018a278f7faab55a 48 25a8991cd700ac01 908 Figure 12: Example of Master Salt construction using CBOR encoding 910 If JSON is used instead of CBOR, the Master Salt of the Security 911 Context is the Base64 encoding of the concatenation of the same 912 parameters, each of them prefixed by their size, encoded in 1 byte. 913 When using JSON, the nonces and input salt have a maximum size of 255 914 bytes. An example of Master Salt construction using Base64 encoding 915 is given in Figure 13. 917 N1, N2 and input salt values: 918 nonce1 = 0x018a278f7faab55a (8 bytes) 919 nonce2 = 0x25a8991cd700ac01 (8 bytes) 920 input salt = 0xf9af838368e353e78888e1426bd94e6f (16 bytes) 922 Input to Base64 encoding: 0x10 f9af838368e353e78888e1426bd94e6f 923 08 018a278f7faab55a 08 25a8991cd700ac01 925 Master Salt = b64'EPmvg4No41PniIjhQmvZTm8IAYonj3+qtVoIJaiZHNcArAE=' 927 Figure 13: Example of Master Salt construction using Base64 encoding 929 The client MUST set the Sender ID to the ace_server_recipientid 930 received in Section 4.2, and the Recipient ID to the 931 ace_client_recipientid sent in Section 4.1. The client MUST set the 932 Master Secret from the parameter received from the AS in Section 3.2. 933 The client MUST set the AEAD Algorithm, ID Context, HKDF, and OSCORE 934 Version from the parameters received from the AS in Section 3.2, if 935 present. In case an optional parameter is omitted, the default value 936 SHALL be used as described in sections 3.2 and 5.4 of [RFC8613]. 938 After that, the client MUST derive the complete Security Context 939 following section 3.2.1 of [RFC8613]. From this point on, the client 940 MUST use this Security Context to communicate with the RS when 941 accessing the resources as specified by the authorization 942 information. 944 If any of the expected parameters is missing (e.g., any of the 945 mandatory parameters from the AS or the RS), or if 946 ace_client_recipientid equals ace_server_recipientid (and as a 947 consequence the Sender and Recipient Keys derived would be equal, see 948 section 3.3 of [RFC8613]), then the client MUST stop the exchange, 949 and MUST NOT derive the Security Context. The client MAY restart the 950 exchange, to get the correct security material. 952 The client then uses this Security Context to send requests to the RS 953 using OSCORE. 955 After sending the 2.01 (Created) response, the RS MUST set the Master 956 Salt of the Security Context created to communicate with the client 957 to the concatenation of salt, N1, and N2, in the same way described 958 above. An example of Master Salt construction using CBOR encoding is 959 given in Figure 12 and using Base64 encoding is given in Figure 13. 960 The RS MUST set the Sender ID from the ace_client_recipientid 961 received in Section 4.1, and the Recipient ID from the 962 ace_server_recipientid sent in Section 4.2. The RS MUST set the 963 Master Secret from the parameter received from the AS and forwarded 964 by the client in the access token in Section 4.1 after validation of 965 the token as specified in Section 4.2. The RS MUST set the AEAD 966 Algorithm, ID Context, HKDF, and OSCORE Version from the parameters 967 received from the AS and forwarded by the client in the access token 968 in Section 4.1 after validation of the token as specified in 969 Section 4.2, if present. In case an optional parameter is omitted, 970 the default value SHALL be used as described in sections 3.2 and 5.4 971 of [RFC8613]. After that, the RS MUST derive the complete Security 972 Context following section 3.2.1 of [RFC8613], and MUST associate this 973 Security Context with the authorization information from the access 974 token. 976 The RS then uses this Security Context to verify requests and send 977 responses to the client using OSCORE. If OSCORE verification fails, 978 error responses are used, as specified in section 8 of [RFC8613]. 979 Additionally, if OSCORE verification succeeds, the verification of 980 access rights is performed as described in section Section 4.4. The 981 RS MUST NOT use the Security Context after the related token has 982 expired, and MUST respond with a unprotected 4.01 (Unauthorized) 983 error message to requests received that correspond to a Security 984 Context with an expired token. 986 Note that the ID Context can be assigned by the AS, communicated and 987 set in both the RS and client after the exchange specified in this 988 profile is executed. Subsequently, client and RS can update their ID 989 Context by running a mechanism such as the one defined in 990 Appendix B.2 of [RFC8613] if they both support it and are configured 991 to do so. In that case, the ID Context in the OSCORE Security 992 Context will not match the "contextId" parameter of the corresponding 993 OSCORE_Input_Material. Running Appendix B.2 results in the keying 994 material in the Security Contexts of client and RS being updated; 995 this same result can also be achieved by the client reposting the 996 access token to the unprotected /authz-info endpoint at the RS, as 997 described in Section 4.1, but without updating the ID Context. 999 4.4. Access rights verification 1001 The RS MUST follow the procedures defined in section 5.8.2 of 1002 [I-D.ietf-ace-oauth-authz]: if an RS receives an OSCORE-protected 1003 request from a client, then the RS processes it according to 1004 [RFC8613]. If OSCORE verification succeeds, and the target resource 1005 requires authorization, the RS retrieves the authorization 1006 information using the access token associated to the Security 1007 Context. The RS then must verify that the authorization information 1008 covers the resource and the action requested. 1010 5. Secure Communication with AS 1012 As specified in the ACE framework (section 5.9 of 1013 [I-D.ietf-ace-oauth-authz]), the requesting entity (RS and/or client) 1014 and the AS communicates via the introspection or token endpoint. The 1015 use of CoAP and OSCORE ([RFC8613]) for this communication is 1016 RECOMMENDED in this profile; other protocols fulfilling the security 1017 requirements defined in section 5 of [I-D.ietf-ace-oauth-authz] (such 1018 as HTTP and DTLS or TLS) MAY be used instead. 1020 If OSCORE is used, the requesting entity and the AS are expected to 1021 have pre-established security contexts in place. How these security 1022 contexts are established is out of scope for this profile. 1023 Furthermore the requesting entity and the AS communicate through the 1024 introspection endpoint as specified in section 5.9 of 1025 [I-D.ietf-ace-oauth-authz] and through the token endpoint as 1026 specified in section 5.8 of [I-D.ietf-ace-oauth-authz]. 1028 6. Discarding the Security Context 1030 There are a number of scenarios where a client or RS needs to discard 1031 the OSCORE security context, and acquire a new one. 1033 The client MUST discard the current Security Context associated with 1034 an RS when any of the following occurs: 1036 * the Sequence Number space ends. 1038 * the access token associated with the context becomes invalid due 1039 to, for example, expiration. 1041 * the client receives a number of 4.01 Unauthorized responses to 1042 OSCORE requests using the same Security Context. The exact number 1043 needs to be specified by the application. 1045 * the client receives a new nonce in the 2.01 (Created) response 1046 (see Section 4.2) to a POST request to the authz-info endpoint, 1047 when re-posting a (non-expired) token associated to the existing 1048 context. 1050 The RS MUST discard the current Security Context associated with a 1051 client when any of the following occurs: 1053 * the Sequence Number space ends. 1055 * the access token associated with the context expires. 1057 * the client has successfully replaced the current security context 1058 with a newer one by posting an access token to the unprotected 1059 /authz-info endpoint at the RS, e.g., by re-posting the same 1060 token, as specified in Section 4.1. 1062 Whenever one more access token is successfully posted to the RS, and 1063 a new Security Context is derived between the client and RS, messages 1064 in transit that were protected with the previous Security Context 1065 might not pass verification, as the old context is discarded. That 1066 means that messages sent shortly before the client posts one more 1067 access token to the RS might not successfully reach the destination. 1068 Analogously, implementations may want to cancel CoAP observations at 1069 the RS registered before the Security Context is replaced, or 1070 conversely they will need to implement a mechanism to ensure that 1071 those observations are to be protected with the newly derived 1072 Security Context. 1074 7. Security Considerations 1076 This document specifies a profile for the Authentication and 1077 Authorization for Constrained Environments (ACE) framework 1078 [I-D.ietf-ace-oauth-authz]. Thus the general security considerations 1079 from the framework also apply to this profile. 1081 Furthermore the general security considerations of OSCORE [RFC8613] 1082 also apply to this specific use of the OSCORE protocol. 1084 As previously stated, the proof-of-possession in this profile is 1085 performed by both parties verifying that they have established the 1086 same Security Context, as specified in Section 4.3, which means that 1087 both the OSCORE request and the OSCORE response passes verification. 1088 RS authentication requires both that the client trusts the AS and 1089 that the OSCORE response from the RS passes verification. 1091 OSCORE is designed to secure point-to-point communication, providing 1092 a secure binding between the request and the response(s). Thus the 1093 basic OSCORE protocol is not intended for use in point-to-multipoint 1094 communication (e.g., multicast, publish-subscribe). Implementers of 1095 this profile should make sure that their use case corresponds to the 1096 expected use of OSCORE, to prevent weakening the security assurances 1097 provided by OSCORE. 1099 Since the use of nonces N1 and N2 during the exchange guarantees 1100 uniqueness of AEAD keys and nonces, it is REQUIRED that the exchanged 1101 nonces are not reused with the same input keying material even in 1102 case of re-boots. This document RECOMMENDS the exchange of 64 bit 1103 random nonces. Considering the birthday paradox, the average 1104 collision for each nonce will happen after 2^32 messages, which is 1105 considerably more token provisioned than would be expected for 1106 intended applications. If applications use something else, such as a 1107 counter, they need to guarantee that reboot and loss of state on 1108 either node does not provoke reuse. If that is not guaranteed, nodes 1109 are susceptible to reuse of AEAD (nonce, key) pairs, especially since 1110 an on-path attacker can cause the use of a previously exchanged 1111 client nonce N1 for Security Context establishment by replaying the 1112 corresponding client-to-server message. 1114 This profile RECOMMENDS that the RS maintains a single access token 1115 for each client. The use of multiple access tokens for a single 1116 client increases the strain on the resource server as it must 1117 consider every access token and calculate the actual permissions of 1118 the client. Also, tokens indicating different or disjoint 1119 permissions from each other may lead the server to enforce wrong 1120 permissions. If one of the access tokens expires earlier than 1121 others, the resulting permissions may offer insufficient protection. 1122 Developers SHOULD avoid using multiple access tokens for a same 1123 client. 1125 If a single OSCORE Input Material is used with multiple RSs, the RSs 1126 can impersonate the client to one of the other RS, and impersonate 1127 another RS to the client. If a master secret is used with several 1128 clients, the clients can impersonate RS to one of the other clients. 1130 Similarly if symmetric keys are used to integrity protect the token 1131 between AS and RS and the token can be used with multiple RSs, the 1132 RSs can impersonate AS to one of the other RS. If the token key is 1133 used for any other communication between the RSs and AS, the RSs can 1134 impersonate each other to the AS. 1136 8. Privacy Considerations 1138 This document specifies a profile for the Authentication and 1139 Authorization for Constrained Environments (ACE) framework 1140 [I-D.ietf-ace-oauth-authz]. Thus the general privacy considerations 1141 from the framework also apply to this profile. 1143 As this document uses OSCORE, thus the privacy considerations from 1144 [RFC8613] apply here as well. 1146 An unprotected response to an unauthorized request may disclose 1147 information about the resource server and/or its existing 1148 relationship with the client. It is advisable to include as little 1149 information as possible in an unencrypted response. When an OSCORE 1150 Security Context already exists between the client and the resource 1151 server, more detailed information may be included. 1153 The token is sent in the clear to the authz-info endpoint, so if a 1154 client uses the same single token from multiple locations with 1155 multiple Resource Servers, it can risk being tracked by the token's 1156 value even when the access token is encrypted. 1158 The nonces exchanged in the request and response to the authz-info 1159 endpoint are also sent in the clear, so using random nonces is best 1160 for privacy (as opposed to, e.g., a counter, that might leak some 1161 information about the client). 1163 The identifiers used in OSCORE, negotiated between client and RS are 1164 privacy sensitive (see Section 12.8 of [RFC8613]), and could reveal 1165 information about the client, or may be used for correlating requests 1166 from one client. 1168 Note that some information might still leak after OSCORE is 1169 established, due to observable message sizes, the source, and the 1170 destination addresses. 1172 9. IANA Considerations 1174 Note to RFC Editor: Please replace all occurrences of "[[this 1175 document]]" with the RFC number of this document. Please add a 1176 reference to the IANA ACE Profile registry in the nextt subsection 1177 once it has been created by IANA, and then delete this paragraph. 1179 9.1. ACE Profile Registry 1181 The following registration is done for the ACE Profile Registry 1182 following the procedure specified in section 8.8 of 1183 [I-D.ietf-ace-oauth-authz]: 1185 * Name: coap_oscore 1186 * Description: Profile for using OSCORE to secure communication 1187 between constrained nodes using the Authentication and 1188 Authorization for Constrained Environments framework. 1189 * CBOR Value: TBD (value between 1 and 255) 1190 * Reference: [[this document]] 1192 9.2. OAuth Parameters Registry 1194 The following registrations are done for the OAuth Parameters 1195 Registry [IANA.OAuthParameters] following the procedure specified in 1196 section 11.2 of [RFC6749]: 1198 * Parameter name: nonce1 1199 * Parameter usage location: client-rs request 1200 * Change Controller: IESG 1201 * Specification Document(s): [[this document]] 1203 * Parameter name: nonce2 1204 * Parameter usage location: rs-client response 1205 * Change Controller: IESG 1206 * Specification Document(s): [[this document]] 1208 * Parameter name: ace_client_recipientid 1209 * Parameter usage location: client-rs request 1210 * Change Controller: IESG 1211 * Specification Document(s): [[this document]] 1213 * Parameter name: ace_server_recipientid 1214 * Parameter usage location: rs-client response 1215 * Change Controller: IESG 1216 * Specification Document(s): [[this document]] 1218 9.3. OAuth Parameters CBOR Mappings Registry 1220 The following registrations are done for the OAuth Parameters CBOR 1221 Mappings Registry following the procedure specified in section 8.10 1222 of [I-D.ietf-ace-oauth-authz]: 1224 * Name: nonce1 1225 * CBOR Key: TBD1 1226 * Value Type: bstr 1227 * Reference: [[this document]] 1229 * Name: nonce2 1230 * CBOR Key: TBD2 1231 * Value Type: bstr 1232 * Reference: [[this document]] 1234 * Name: ace_client_recipientid 1235 * CBOR Key: TBD3 1236 * Value Type: bstr 1237 * Reference: [[this document]] 1239 * Name: ace_server_recipientid 1240 * CBOR Key: TBD4 1241 * Value Type: bstr 1242 * Reference: [[this document]] 1244 9.4. OSCORE Security Context Parameters Registry 1246 It is requested that IANA create a new registry entitled "OSCORE 1247 Security Context Parameters" registry. The registry is to be created 1248 as Expert Review Required. Guidelines for the experts is provided 1249 Section 9.7. It should be noted that in addition to the expert 1250 review, some portions of the registry require a specification, 1251 potentially on standards track, be supplied as well. 1253 The columns of the registry are: 1255 name The JSON name requested (e.g., "ms"). Because a core goal of 1256 this document is for the resulting representations to be compact, 1257 it is RECOMMENDED that the name be short. This name is case 1258 sensitive. Names may not match other registered names in a case- 1259 insensitive manner unless the Designated Experts determine that 1260 there is a compelling reason to allow an exception. The name is 1261 not used in the CBOR encoding. 1262 CBOR label The value to be used to identify this algorithm. Map key 1263 labels MUST be unique. The label can be a positive integer, a 1264 negative integer or a string. Integer values between -256 and 255 1265 and strings of length 1 are designated as Standards Track Document 1266 required. Integer values from -65536 to -257 and from 256 to 1267 65535 and strings of length 2 are designated as Specification 1268 Required. Integer values greater than 65535 and strings of length 1269 greater than 2 are designated as expert review. Integer values 1270 less than -65536 are marked as private use. 1271 CBOR Type This field contains the CBOR type for the field. 1272 registry This field denotes the registry that values may come from, 1273 if one exists. 1274 description This field contains a brief description for the field. 1276 specification This contains a pointer to the public specification 1277 for the field if one exists 1279 This registry will be initially populated by the values in Table 1. 1280 The specification column for all of these entries will be this 1281 document and [RFC8613]. 1283 9.5. CWT Confirmation Methods Registry 1285 The following registration is done for the CWT Confirmation Methods 1286 Registry [IANA.CWTConfirmationMethods] following the procedure 1287 specified in section 7.2.1 of [RFC8747]: 1289 * Confirmation Method Name: "osc" 1290 * Confirmation Method Description: OSCORE_Input_Material carrying 1291 the parameters for using OSCORE per-message security with implicit 1292 key confirmation 1293 * Confirmation Key: TBD (value between 4 and 255) 1294 * Confirmation Value Type(s): map 1295 * Change Controller: IESG 1296 * Specification Document(s): Section 3.2.1 of [[this document]] 1298 9.6. JWT Confirmation Methods Registry 1300 The following registration is done for the JWT Confirmation Methods 1301 Registry [IANA.JWTConfirmationMethods] following the procedure 1302 specified in section 6.2.1 of [RFC7800]: 1304 * Confirmation Method Value: "osc" 1305 * Confirmation Method Description: OSCORE_Input_Material carrying 1306 the parameters for using OSCORE per-message security with implicit 1307 key confirmation 1308 * Change Controller: IESG 1309 * Specification Document(s): Section 3.2.1 of [[this document]] 1311 9.7. Expert Review Instructions 1313 The IANA registry established in this document is defined to use the 1314 Expert Review registration policy. This section gives some general 1315 guidelines for what the experts should be looking for, but they are 1316 being designated as experts for a reason so they should be given 1317 substantial latitude. 1319 Expert reviewers should take into consideration the following points: 1321 * Point squatting should be discouraged. Reviewers are encouraged 1322 to get sufficient information for registration requests to ensure 1323 that the usage is not going to duplicate one that is already 1324 registered and that the point is likely to be used in deployments. 1325 The zones tagged as private use are intended for testing purposes 1326 and closed environments. Code points in other ranges should not 1327 be assigned for testing. 1328 * Specifications are required for the standards track range of point 1329 assignment. Specifications should exist for specification 1330 required ranges, but early assignment before a specification is 1331 available is considered to be permissible. Specifications are 1332 needed for the first-come, first-serve range if they are expected 1333 to be used outside of closed environments in an interoperable way. 1334 When specifications are not provided, the description provided 1335 needs to have sufficient information to identify what the point is 1336 being used for. 1337 * Experts should take into account the expected usage of fields when 1338 approving point assignment. The fact that there is a range for 1339 standards track documents does not mean that a standards track 1340 document cannot have points assigned outside of that range. The 1341 length of the encoded value should be weighed against how many 1342 code points of that length are left, the size of device it will be 1343 used on, and the number of code points left that encode to that 1344 size. 1346 10. References 1348 10.1. Normative References 1350 [COSE.Algorithms] 1351 IANA, "COSE Algorithms", 1352 . 1355 [I-D.ietf-ace-oauth-authz] 1356 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 1357 H. Tschofenig, "Authentication and Authorization for 1358 Constrained Environments (ACE) using the OAuth 2.0 1359 Framework (ACE-OAuth)", Work in Progress, Internet-Draft, 1360 draft-ietf-ace-oauth-authz-40, 26 April 2021, 1361 . 1364 [I-D.ietf-ace-oauth-params] 1365 Seitz, L., "Additional OAuth Parameters for Authorization 1366 in Constrained Environments (ACE)", Work in Progress, 1367 Internet-Draft, draft-ietf-ace-oauth-params-14, 25 March 1368 2021, . 1371 [I-D.ietf-cose-rfc8152bis-algs] 1372 Schaad, J., "CBOR Object Signing and Encryption (COSE): 1373 Initial Algorithms", Work in Progress, Internet-Draft, 1374 draft-ietf-cose-rfc8152bis-algs-12, 24 September 2020, 1375 . 1378 [I-D.ietf-cose-rfc8152bis-struct] 1379 Schaad, J., "CBOR Object Signing and Encryption (COSE): 1380 Structures and Process", Work in Progress, Internet-Draft, 1381 draft-ietf-cose-rfc8152bis-struct-15, 1 February 2021, 1382 . 1385 [IANA.CWTConfirmationMethods] 1386 IANA, "CWT Confirmation Methods", 1387 . 1390 [IANA.JWTConfirmationMethods] 1391 IANA, "JWT Confirmation Methods", 1392 . 1395 [IANA.OAuthParameters] 1396 IANA, "OAuth Parameters", 1397 . 1400 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1401 Requirement Levels", BCP 14, RFC 2119, 1402 DOI 10.17487/RFC2119, March 1997, 1403 . 1405 [RFC5869] Krawczyk, H. and P. Eronen, "HMAC-based Extract-and-Expand 1406 Key Derivation Function (HKDF)", RFC 5869, 1407 DOI 10.17487/RFC5869, May 2010, 1408 . 1410 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 1411 Application Protocol (CoAP)", RFC 7252, 1412 DOI 10.17487/RFC7252, June 2014, 1413 . 1415 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1416 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1417 May 2017, . 1419 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 1420 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 1421 May 2018, . 1423 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 1424 Definition Language (CDDL): A Notational Convention to 1425 Express Concise Binary Object Representation (CBOR) and 1426 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 1427 June 2019, . 1429 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 1430 "Object Security for Constrained RESTful Environments 1431 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 1432 . 1434 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 1435 Representation (CBOR)", STD 94, RFC 8949, 1436 DOI 10.17487/RFC8949, December 2020, 1437 . 1439 10.2. Informative References 1441 [I-D.ietf-tls-dtls13] 1442 Rescorla, E., Tschofenig, H., and N. Modadugu, "The 1443 Datagram Transport Layer Security (DTLS) Protocol Version 1444 1.3", Work in Progress, Internet-Draft, draft-ietf-tls- 1445 dtls13-43, 30 April 2021, . 1448 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 1449 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 1450 . 1452 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 1453 RFC 6749, DOI 10.17487/RFC6749, October 2012, 1454 . 1456 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1457 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1458 DOI 10.17487/RFC7231, June 2014, 1459 . 1461 [RFC7800] Jones, M., Bradley, J., and H. Tschofenig, "Proof-of- 1462 Possession Key Semantics for JSON Web Tokens (JWTs)", 1463 RFC 7800, DOI 10.17487/RFC7800, April 2016, 1464 . 1466 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 1467 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 1468 . 1470 [RFC8747] Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 1471 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 1472 Web Tokens (CWTs)", RFC 8747, DOI 10.17487/RFC8747, March 1473 2020, . 1475 Appendix A. Profile Requirements 1477 This section lists the specifications on this profile based on the 1478 requirements on the framework, as requested in Appendix C of 1479 [I-D.ietf-ace-oauth-authz]. 1481 * Optionally define new methods for the client to discover the 1482 necessary permissions and AS for accessing a resource, different 1483 from the one proposed in: Not specified 1484 * Optionally specify new grant types: Not specified 1485 * Optionally define the use of client certificates as client 1486 credential type: Not specified 1487 * Specify the communication protocol the client and RS the must use: 1488 CoAP 1489 * Specify the security protocol the client and RS must use to 1490 protect their communication: OSCORE 1491 * Specify how the client and the RS mutually authenticate: 1492 Implicitly by possession of a common OSCORE security context. 1493 Note that the mutual authentication is not completed before the 1494 client has verified an OSCORE response using this security 1495 context. 1496 * Specify the proof-of-possession protocol(s) and how to select one, 1497 if several are available. Also specify which key types (e.g., 1498 symmetric/asymmetric) are supported by a specific proof-of- 1499 possession protocol: OSCORE algorithms; pre-established symmetric 1500 keys 1501 * Specify a unique ace_profile identifier: coap_oscore 1502 * If introspection is supported: Specify the communication and 1503 security protocol for introspection: HTTP/CoAP (+ TLS/DTLS/OSCORE) 1504 * Specify the communication and security protocol for interactions 1505 between client and AS: HTTP/CoAP (+ TLS/DTLS/OSCORE) 1506 * Specify how/if the authz-info endpoint is protected, including how 1507 error responses are protected: Not protected. 1508 * Optionally define other methods of token transport than the authz- 1509 info endpoint: Not defined 1511 Acknowledgments 1513 The authors wish to thank Jim Schaad and Marco Tiloca for the 1514 substantial input to this document, as well as Elwyn Davies, Linda 1515 Dunbar, Roman Danyliw, Martin Duke, Lars Eggert, Murray Kucherawy, 1516 and Zaheduzzaman Sarker for their reviews and feedback. Special 1517 thanks to the responsible area director Benjamin Kaduk for his 1518 extensive review and contributed text. Ludwig Seitz worked on this 1519 document as part of the CelticNext projects CyberWI, and CRITISEC 1520 with funding from Vinnova. The work on this document has been partly 1521 supported also by the H2020 project SIFIS-Home (Grant agreement 1522 952652). 1524 Authors' Addresses 1526 Francesca Palombini 1527 Ericsson AB 1529 Email: francesca.palombini@ericsson.com 1531 Ludwig Seitz 1532 Combitech 1533 Djaeknegatan 31 1534 SE-211 35 Malmoe 1535 Sweden 1537 Email: ludwig.seitz@combitech.com 1539 Göran Selander 1540 Ericsson AB 1542 Email: goran.selander@ericsson.com 1544 Martin Gunnarsson 1545 RISE 1546 Scheelevagen 17 1547 SE-22370 Lund 1548 Sweden 1550 Email: martin.gunnarsson@ri.se