idnits 2.17.1 draft-ietf-ace-oscore-profile-17.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: ---------------------------------------------------------------------------- No issues found here. 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 (March 8, 2021) is 1145 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-36 == Outdated reference: A later version (-16) exists of draft-ietf-ace-oauth-params-13 ** Obsolete normative reference: RFC 8152 (Obsoleted by RFC 9052, RFC 9053) -- Obsolete informational reference (is this intentional?): RFC 7231 (Obsoleted by RFC 9110) Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 3 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: September 9, 2021 Combitech 6 G. Selander 7 Ericsson AB 8 M. Gunnarsson 9 RISE 10 March 8, 2021 12 OSCORE Profile of the Authentication and Authorization for Constrained 13 Environments Framework 14 draft-ietf-ace-oscore-profile-17 16 Abstract 18 This memo 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 September 9, 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 48 (https://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 59 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 60 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 4 61 3. Client-AS Communication . . . . . . . . . . . . . . . . . . . 6 62 3.1. C-to-AS: POST to token endpoint . . . . . . . . . . . . . 7 63 3.2. AS-to-C: Access Token . . . . . . . . . . . . . . . . . . 8 64 3.2.1. The OSCORE_Input_Material . . . . . . . . . . . . . . 12 65 4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 15 66 4.1. C-to-RS: POST to authz-info endpoint . . . . . . . . . . 16 67 4.1.1. The Nonce 1 Parameter . . . . . . . . . . . . . . . . 17 68 4.1.2. The ace_client_recipientid Parameter . . . . . . . . 18 69 4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 18 70 4.2.1. The Nonce 2 Parameter . . . . . . . . . . . . . . . . 19 71 4.2.2. The ace_server_recipientid Parameter . . . . . . . . 20 72 4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 20 73 4.4. Access rights verification . . . . . . . . . . . . . . . 22 74 5. Secure Communication with AS . . . . . . . . . . . . . . . . 23 75 6. Discarding the Security Context . . . . . . . . . . . . . . . 23 76 7. Security Considerations . . . . . . . . . . . . . . . . . . . 24 77 8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 25 78 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 79 9.1. ACE Profile Registry . . . . . . . . . . . . . . . . . . 26 80 9.2. OAuth Parameters Registry . . . . . . . . . . . . . . . . 26 81 9.3. OAuth Parameters CBOR Mappings Registry . . . . . . . . . 27 82 9.4. OSCORE Security Context Parameters Registry . . . . . . . 27 83 9.5. CWT Confirmation Methods Registry . . . . . . . . . . . . 28 84 9.6. JWT Confirmation Methods Registry . . . . . . . . . . . . 29 85 9.7. Expert Review Instructions . . . . . . . . . . . . . . . 29 86 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 30 87 10.1. Normative References . . . . . . . . . . . . . . . . . . 30 88 10.2. Informative References . . . . . . . . . . . . . . . . . 31 89 Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 31 90 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 32 91 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 32 93 1. Introduction 95 This memo specifies a profile of the ACE framework 96 [I-D.ietf-ace-oauth-authz]. In this profile, a client and a resource 97 server use the Constrained Application Protocol (CoAP) [RFC7252] to 98 communicate. The client uses an access token, bound to a symmetric 99 key (the proof-of-possession key) to authorize its access to the 100 resource server. Note that this profile uses a symmetric-crypto- 101 based scheme, where the symmetric secret is used as input material 102 for keying material derivation. In order to provide communication 103 security and proof of possession, the client and resource server use 104 Object Security for Constrained RESTful Environments (OSCORE) 105 [RFC8613]. Note that the proof of possession is not achieved through 106 a dedicated protocol element, but rather occurs after the first 107 message exchange using OSCORE. 109 OSCORE specifies how to use CBOR Object Signing and Encryption (COSE) 110 [RFC8152] to secure CoAP messages. Note that OSCORE can be used to 111 secure CoAP messages, as well as HTTP and combinations of HTTP and 112 CoAP; a profile of ACE similar to the one described in this document, 113 with 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", and "verify" are taken from [RFC4949]. 128 RESTful terminology follows HTTP [RFC7231]. 130 Readers are expected to be familiar with the terms and concepts 131 defined in OSCORE [RFC8613], such as "Security Context" and 132 "Recipient ID". 134 Terminology for entities in the architecture is defined in OAuth 2.0 135 [RFC6749], such as client (C), resource server (RS), and 136 authorization server (AS). It is assumed in this document that a 137 given resource on a specific RS is associated to a unique AS. 139 Concise Binary Object Representation (CBOR) [RFC8949] and Concise 140 Data Definition Language (CDDL) [RFC8610] are used in this 141 specification. CDDL predefined type names, especially bstr for CBOR 142 byte strings and tstr for CBOR text strings, are used extensively in 143 the 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 memo. 151 2. Protocol Overview 153 This section gives an overview of how to use the ACE Framework 154 [I-D.ietf-ace-oauth-authz] to secure the communication between a 155 client and a resource server using OSCORE [RFC8613]. The parameters 156 needed by the client to negotiate the use of this profile with the 157 authorization server, as well as the OSCORE setup process, are 158 described in detail in the following sections. 160 The RS maintains a collection of OSCORE Security Contexts with 161 associated authorization information for all the clients that it is 162 communicating with. The authorization information is maintained as 163 policy that is used as input to processing requests from those 164 clients. 166 This profile requires a client to retrieve an access token from the 167 AS for the resource it wants to access on an RS, by sending an access 168 token request to the token endpoint, as specified in section 5.8 of 169 [I-D.ietf-ace-oauth-authz]. The access token request and response 170 MUST be confidentiality-protected and ensure authenticity. This 171 profile RECOMMENDS the use of OSCORE between client and AS, to reduce 172 the number of libraries the client has to support, but other 173 protocols fulfilling the security requirements defined in section 5 174 of [I-D.ietf-ace-oauth-authz] (such as TLS or DTLS) MAY be used as 175 well. 177 Once the client has retrieved the access token, it generates a nonce 178 N1, defined in this specification (see Section 4.1.1). The client 179 also generates its own OSCORE Recipient ID ID1 (see Section 3.1 of 180 [RFC8613]), for use with the keying material associated to the RS. 181 The client posts the token, N1 and its Recipient ID to the RS using 182 the authz-info endpoint and mechanisms specified in section 5.8 of 183 [I-D.ietf-ace-oauth-authz] and Content-Format = application/ace+cbor. 184 When using this profile, the communication with the authz-info 185 endpoint is not protected, except for update of access rights. 187 If the access token is valid, the RS replies to this request with a 188 2.01 (Created) response with Content-Format = application/ace+cbor, 189 which contains a nonce N2 and its newly generated OSCORE Recipient 190 ID, ID2, for use with the keying material associated to the client. 191 Moreover, the server concatenates the input salt received in the 192 token, N1, and N2 to obtain the Master Salt of the OSCORE Security 193 Context (see section 3 of [RFC8613]). The RS then derives the 194 complete Security Context associated with the received token from the 195 Master Salt, the OSCORE Recipient ID generated by the client (set as 196 its OSCORE Sender ID), its own OSCORE Recipient ID, plus the 197 parameters received in the access token from the AS, following 198 section 3.2 of [RFC8613]. 200 In a similar way, after receiving the nonce N2, the client 201 concatenates the input salt, N1 and N2 to obtain the Master Salt of 202 the OSCORE Security Context. The client then derives the complete 203 Security Context from the Master Salt, the OSCORE Recipient ID 204 generated by the RS (set as its OSCORE Sender ID), its own OSCORE 205 Recipient ID, plus the parameters received from the AS. 207 Finally, the client starts the communication with the RS by sending a 208 request protected with OSCORE to the RS. If the request is 209 successfully verified, the server stores the complete Security 210 Context state that is ready for use in protecting messages, and uses 211 it in the response, and in further communications with the client, 212 until token deletion, due to e.g. expiration. This Security Context 213 is discarded when a token (whether the same or a different one) is 214 used to successfully derive a new Security Context for that client. 216 The use of nonces N1 and N2 during the exchange prevents the reuse of 217 an Authenticated Encryption with Associated Data (AEAD) nonce/key 218 pair for two different messages. Reuse might otherwise occur when 219 client and RS derive a new Security Context from an existing (non- 220 expired) access token, as might occur when either party has just 221 rebooted, and might lead to loss of both confidentiality and 222 integrity. Instead, by using the exchanged nonces N1 and N2 as part 223 of the Master Salt, the request to the authz-info endpoint posting 224 the same token results in a different Security Context, by OSCORE 225 construction, since even though the Master Secret, Sender ID and 226 Recipient ID are the same, the Master Salt is different (see 227 Section 3.2.1 of [RFC8613]). If the exchanged nonces were reused, a 228 node reusing a non-expired old token would be susceptible to on-path 229 attackers provoking the creation of an OSCORE message using an old 230 AEAD key and nonce. 232 After the whole message exchange has taken place, the client can 233 contact the AS to request an update of its access rights, sending a 234 similar request to the token endpoint that also includes an 235 identifier so that the AS can find the correct OSCORE security input 236 material it has previously shared with the client. This specific 237 identifier, encoded as a byte string, is assigned by the AS to be 238 unique in the sets of its OSCORE security input materials, and is not 239 used as input material to derive the full OSCORE Security Context. 241 An overview of the profile flow for the OSCORE profile is given in 242 Figure 1. The names of messages coincide with those of 243 [I-D.ietf-ace-oauth-authz] when applicable. 245 C RS AS 246 | | | 247 | ----- POST /token ----------------------------> | 248 | | | 249 | <---------------------------- Access Token ----- | 250 | + Access Information | 251 | ---- POST /authz-info ---> | | 252 | (access_token, N1, ID1) | | 253 | | | 254 | <- 2.01 Created (N2, ID2)- | | 255 | | | 256 /Sec Context /Sec Context | 257 derivation/ derivation/ | 258 | | | 259 | ---- OSCORE Request -----> | | 260 | | | 261 | /proof-of-possession | 262 | Sec Context storage/ | 263 | | | 264 | <--- OSCORE Response ----- | | 265 | | | 266 /proof-of-possession | | 267 Sec Context storage/ | | 268 | | | 269 | ---- OSCORE Request -----> | | 270 | | | 271 | <--- OSCORE Response ----- | | 272 | | | 273 | ... | | 275 Figure 1: Protocol Overview 277 3. Client-AS Communication 279 The following subsections describe the details of the POST request 280 and response to the token endpoint between client and AS. 281 Section 3.2 of [RFC8613] defines how to derive a Security Context 282 based on a shared master secret and a set of other parameters, 283 established between client and server, which the client receives from 284 the AS in this exchange. The proof-of-possession key (pop-key) 285 included in the response from the AS MUST be used as master secret in 286 OSCORE. 288 3.1. C-to-AS: POST to token endpoint 290 The client-to-AS request is specified in Section 5.8.1 of 291 [I-D.ietf-ace-oauth-authz]. 293 The client must send this POST request to the token endpoint over a 294 secure channel that guarantees authentication, message integrity and 295 confidentiality (see Section 5). 297 An example of such a request, with payload in CBOR diagnostic 298 notation without the tag and value abbreviations is reported in 299 Figure 2 301 Header: POST (Code=0.02) 302 Uri-Host: "as.example.com" 303 Uri-Path: "token" 304 Content-Format: "application/ace+cbor" 305 Payload: 306 { 307 "req_aud" : "tempSensor4711", 308 "scope" : "read" 309 } 311 Figure 2: Example C-to-AS POST /token request for an access token 312 bound to a symmetric key. 314 If the client wants to update its access rights without changing an 315 existing OSCORE Security Context, it MUST include in its POST request 316 to the token endpoint a req_cnf object, with the kid field carrying a 317 CBOR byte string containing the OSCORE Input Material Identifier 318 (assigned as discussed in Section 3.2). This identifier, together 319 with other information such as audience (see Section 5.8.1 of 320 [I-D.ietf-ace-oauth-authz]), can be used by the AS to determine the 321 shared secret bound to the proof-of-possession token and therefore 322 MUST identify a symmetric key that was previously generated by the AS 323 as a shared secret for the communication between the client and the 324 RS. The AS MUST verify that the received value identifies a proof- 325 of-possession key that has previously been issued to the requesting 326 client. If that is not the case, the Client-to-AS request MUST be 327 declined with the error code 'invalid_request' as defined in 328 Section 5.8.3 of [I-D.ietf-ace-oauth-authz]. 330 An example of such a request, with payload in CBOR diagnostic 331 notation without the tag and value abbreviations is reported in 332 Figure 3 334 Header: POST (Code=0.02) 335 Uri-Host: "as.example.com" 336 Uri-Path: "token" 337 Content-Format: "application/ace+cbor" 338 Payload: 339 { 340 "req_aud" : "tempSensor4711", 341 "scope" : "write", 342 "req_cnf" : { 343 "kid" : h'01' 344 } 346 Figure 3: Example C-to-AS POST /token request for updating rights to 347 an access token bound to a symmetric key. 349 3.2. AS-to-C: Access Token 351 After verifying the POST request to the token endpoint and that the 352 client is authorized to obtain an access token corresponding to its 353 access token request, the AS responds as defined in section 5.8.2 of 354 [I-D.ietf-ace-oauth-authz]. If the client request was invalid, or 355 not authorized, the AS returns an error response as described in 356 section 5.8.3 of [I-D.ietf-ace-oauth-authz]. 358 The AS can signal that the use of OSCORE is REQUIRED for a specific 359 access token by including the "profile" parameter with the value 360 "coap_oscore" in the access token response. This means that the 361 client MUST use OSCORE towards all resource servers for which this 362 access token is valid, and follow Section 4.3 to derive the security 363 context to run OSCORE. Usually it is assumed that constrained 364 devices will be pre-configured with the necessary profile, so that 365 this kind of profile signaling can be omitted. 367 Moreover, the AS MUST send the following data: 369 o a master secret 371 o an identifier of the OSCORE Input Material 373 Additionally, the AS MAY send the following data, in the same 374 response. 376 o a context identifier 377 o an AEAD algorithm 379 o an HMAC-based key derivation function (HKDF) algorithm 381 o a salt 383 o 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 applications 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' parameeter 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. This profile RECOMMENDS the use of CBOR web token 411 (CWT) as specified in [RFC8392]. If the token is a CWT, the same 412 OSCORE_Input_Material structure defined above MUST be placed in the 413 'osc' field of the 'cnf' claim of this token. 415 The AS MUST send different OSCORE_Input_Material (and therefore 416 different access tokens) to different authorized clients, in order 417 for the RS to differentiate between clients. 419 Figure 4 shows an example of an AS response, with payload in CBOR 420 diagnostic notation without the tag and value abbreviations. The 421 access token has been truncated for readability. 423 Header: Created (Code=2.01) 424 Content-Type: "application/ace+cbor" 425 Payload: 426 { 427 "access_token" : h'8343a1010aa2044c53 ... 428 (remainder of access token (CWT) omitted for brevity)', 429 "profile" : "coap_oscore", 430 "expires_in" : "3600", 431 "cnf" : { 432 "osc" : { 433 "id" : h'01', 434 "ms" : h'f9af838368e353e78888e1426bd94e6f' 435 } 436 } 437 } 439 Figure 4: Example AS-to-C Access Token response with OSCORE profile. 441 Figure 5 shows an example CWT Claims Set, including the relevant 442 OSCORE parameters in the 'cnf' claim, in CBOR diagnostic notation 443 without tag and value abbreviations. 445 { 446 "aud" : "tempSensorInLivingRoom", 447 "iat" : "1360189224", 448 "exp" : "1360289224", 449 "scope" : "temperature_g firmware_p", 450 "cnf" : { 451 "osc" : { 452 "ms" : h'f9af838368e353e78888e1426bd94e6f', 453 "id" : h'01' 454 } 455 } 456 } 458 Figure 5: Example CWT Claims Set with OSCORE parameters. 460 The same CWT Claims Set as in Figure 5, using the value abbreviations 461 defined in [I-D.ietf-ace-oauth-authz] and [RFC8747] and encoded in 462 CBOR is shown in Figure 6. The bytes in hexadecimal are reported in 463 the first column, while their corresponding CBOR meaning is reported 464 after the '#' sign on the second column, for easiness of readability. 466 NOTE TO THE RFC EDITOR: before publishing, it should be checked (and 467 in case fixed) that the values used below (which are not yet 468 registered) are the final values registered in IANA. 470 A5 # map(5) 471 63 # text(3) 472 617564 # "aud" 473 76 # text(22) 474 74656D7053656E736F72496E4C6976696E67526F6F6D 475 # "tempSensorInLivingRoom" 476 63 # text(3) 477 696174 # "iat" 478 6A # text(10) 479 31333630313839323234 # "1360189224" 480 63 # text(3) 481 657870 # "exp" 482 6A # text(10) 483 31333630323839323234 # "1360289224" 484 65 # text(5) 485 73636F7065 # "scope" 486 78 18 # text(24) 487 74656D70657261747572655F67206669726D776172655F70 488 # "temperature_g firmware_p" 489 63 # text(3) 490 636E66 # "cnf" 491 A1 # map(1) 492 63 # text(3) 493 6F7363 # "osc" 494 A2 # map(2) 495 62 # text(2) 496 6D73 # "ms" 497 50 # bytes(16) 498 F9AF838368E353E78888E1426BD94E6F 499 # "\xF9\xAF\x83\x83h\xE3S\xE7 500 \x88\x88\xE1Bk\xD9No" 501 62 # text(2) 502 6964 # "id" 503 41 # bytes(1) 504 01 # "\x01" 506 Figure 6: Example CWT Claims Set with OSCORE parameters, CBOR 507 encoded. 509 If the client has requested an update to its access rights using the 510 same OSCORE Security Context, which is valid and authorized, the AS 511 MUST omit the 'cnf' parameter in the response, and MUST carry the 512 OSCORE Input Material identifier in the 'kid' field in the 'cnf' 513 claim of the token. This identifier needs to be included in the 514 token in order for the RS to identify the correct OSCORE Input 515 Material. 517 Figure 7 shows an example of such an AS response, with payload in 518 CBOR diagnostic notation without the tag and value abbreviations. 519 The access token has 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 "profile" : "coap_oscore", 528 "expires_in" : "3600" 529 } 531 Figure 7: Example AS-to-C Access Token response with OSCORE profile, 532 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, in 536 CBOR diagnostic notation without tag and value abbreviations. 538 { 539 "aud" : "tempSensorInLivingRoom", 540 "iat" : "1360189224", 541 "exp" : "1360289224", 542 "scope" : "temperature_h", 543 "cnf" : { 544 "kid" : h'01' 545 } 546 } 548 Figure 8: Example CWT Claims Set with OSCORE parameters for update of 549 access rights. 551 3.2.1. The OSCORE_Input_Material 553 An OSCORE_Input_Material is an object that represents the input 554 material to derive an OSCORE Security Context, i.e., the local set of 555 information elements necessary to carry out the cryptographic 556 operations in OSCORE (Section 3.1 of [RFC8613]). In particular, the 557 OSCORE_Input_Material is defined to be serialized and transported 558 between nodes, as specified by this document, but can also be used by 559 other specifications if needed. The OSCORE_Input_Material can either 560 be encoded as a JSON object or as a CBOR map. The set of common 561 parameters that can appear in an OSCORE_Input_Material can be found 562 in the IANA "OSCORE Security Context Parameters" registry 563 (Section 9.4), defined for extensibility, and is specified below. 564 All parameters are optional. Table 1 provides a summary of the 565 OSCORE_Input_Material parameters defined in this section. 567 +-----------+-------+-------------+-------------------+-------------+ 568 | name | CBOR | CBOR type | registry | description | 569 | | label | | | | 570 +-----------+-------+-------------+-------------------+-------------+ 571 | id | 0 | byte string | | OSCORE | 572 | | | | | Input | 573 | | | | | Material | 574 | | | | | Identifier | 575 | | | | | | 576 | version | 1 | unsigned | | OSCORE | 577 | | | integer | | Version | 578 | | | | | | 579 | ms | 2 | byte string | | OSCORE | 580 | | | | | Master | 581 | | | | | Secret | 582 | | | | | value | 583 | | | | | | 584 | hkdf | 3 | text string | [COSE.Algorithms] | OSCORE HKDF | 585 | | | / integer | Values (HMAC- | value | 586 | | | | based) | | 587 | | | | | | 588 | alg | 4 | text string | [COSE.Algorithms] | OSCORE AEAD | 589 | | | / integer | Values (AEAD) | Algorithm | 590 | | | | | value | 591 | | | | | | 592 | salt | 5 | byte string | | an input to | 593 | | | | | OSCORE | 594 | | | | | Master Salt | 595 | | | | | value | 596 | | | | | | 597 | contextId | 6 | byte string | | OSCORE ID | 598 | | | | | Context | 599 | | | | | value | 600 +-----------+-------+-------------+-------------------+-------------+ 602 Table 1: OSCORE_Input_Material Parameters 604 id: This parameter identifies the OSCORE_Input_Material and is 605 encoded as a byte string. In JSON, the "id" value is a Base64 606 encoded byte string. In CBOR, the "id" type is byte string, and 607 has label 0. 609 version: This parameter identifies the OSCORE Version number, which 610 is an unsigned integer. For more information about this field, 611 see section 5.4 of [RFC8613]. In JSON, the "version" value is an 612 integer. In CBOR, the "version" type is integer, and has label 1. 614 ms: This parameter identifies the OSCORE Master Secret value, which 615 is a byte string. For more information about this field, see 616 section 3.1 of [RFC8613]. In JSON, the "ms" value is a Base64 617 encoded byte string. In CBOR, the "ms" type is byte string, and 618 has label 2. 620 hkdf: This parameter identifies the OSCORE HKDF Algorithm. For more 621 information about this field, see section 3.1 of [RFC8613]. The 622 values used MUST be registered in the IANA "COSE Algorithms" 623 registry (see [COSE.Algorithms]) and MUST be HMAC-based HKDF 624 algorithms. The value can either be the integer or the text 625 string value of the HMAC-based HKDF algorithm in the "COSE 626 Algorithms" registry. In JSON, the "hkdf" value is a case- 627 sensitive ASCII string or an integer. In CBOR, the "hkdf" type is 628 text string or integer, and has label 3. 630 alg: This parameter identifies the OSCORE AEAD Algorithm. For more 631 information about this field, see section 3.1 of [RFC8613] The 632 values used MUST be registered in the IANA "COSE Algorithms" 633 registry (see [COSE.Algorithms]) and MUST be AEAD algorithms. The 634 value can either be the integer or the text string value of the 635 HMAC-based HKDF algorithm in the "COSE Algorithms" registry. In 636 JSON, the "alg" value is a case-sensitive ASCII string or an 637 integer. In CBOR, the "alg" type is text string or integer, and 638 has label 4. 640 salt: This parameter identifies an input to the OSCORE Master Salt 641 value, which is a byte string. For more information about this 642 field, see section 3.1 of [RFC8613]. In JSON, the "salt" value is 643 a Base64 encoded byte string. In CBOR, the "salt" type is byte 644 string, and has label 5. 646 contextId: This parameter identifies the security context as a byte 647 string. This identifier is used as OSCORE ID Context. For more 648 information about this field, see section 3.1 of [RFC8613]. In 649 JSON, the "contextID" value is a Base64 encoded byte string. In 650 CBOR, the "contextID" type is byte string, and has label 6. 652 An example of JSON OSCORE_Input_Material is given in Figure 9. 654 "osc" : { 655 "alg" : "AES-CCM-16-64-128", 656 "id" : b64'AQ==' 657 "ms" : b64'+a+Dg2jjU+eIiOFCa9lObw' 658 } 660 Figure 9: Example JSON OSCORE_Input_Material 662 The CDDL grammar describing the CBOR OSCORE_Input_Material is: 664 OSCORE_Input_Material = { 665 ? 0 => bstr, ; id 666 ? 1 => int, ; version 667 ? 2 => bstr, ; ms 668 ? 3 => tstr / int, ; hkdf 669 ? 4 => tstr / int, ; alg 670 ? 5 => bstr, ; salt 671 ? 6 => bstr, ; contextId 672 * int / tstr => any 673 } 675 4. Client-RS Communication 677 The following subsections describe the details of the POST request 678 and response to the authz-info endpoint between client and RS. The 679 client generates a nonce N1 and an identifier ID1 unique in the sets 680 of its own Recipient IDs, and posts them together with the token that 681 includes the materials (e.g., OSCORE parameters) received from the AS 682 to the RS. The RS then generates a nonce N2 and an identifier ID2 683 unique in the sets of its own Recipient IDs, and uses Section 3.2 of 684 [RFC8613] to derive a security context based on a shared master 685 secret, the two exchanged nonces and the two identifiers, established 686 between client and server. The exchanged nonces and identifiers are 687 encoded as CBOR byte string if CBOR is used, and as Base64 string if 688 JSON is used. This security context is used to protect all future 689 communication between client and RS using OSCORE, as long as the 690 access token is valid. 692 Note that the RS and client authenticates each other by generating 693 the shared OSCORE Security Context using the pop-key as master 694 secret. An attacker posting a valid token to the RS will not be able 695 to generate a valid OSCORE Security Context and thus not be able to 696 prove possession of the pop-key. Additionally, the mutual 697 authentication is only achieved after the client has successfully 698 verified a response from the RS protected with the generated OSCORE 699 Security Context. 701 4.1. C-to-RS: POST to authz-info endpoint 703 The client MUST generate a nonce value N1 very unlikely to have been 704 previously used with the same input keying material. This profile 705 RECOMMENDS to use a 64-bit long random number as nonce's value. The 706 client MUST store the nonce N1 as long as the response from the RS is 707 not received and the access token related to it is still valid (to 708 the best of the client's knowledge). 710 The client generates its own Recipient ID, ID1, for the OSCORE 711 Security Context that it is establishing with the RS. By generating 712 its own Recipient ID, the client makes sure that it does not collide 713 with any of its Recipient IDs, nor with any other identifier ID1 if 714 the client is executing this exchange with a different RS at the same 715 time. 717 The client MUST use CoAP and the Authorization Information resource 718 as described in section 5.8.1 of [I-D.ietf-ace-oauth-authz] to 719 transport the token, N1 and ID1 to the RS. 721 Note that the use of the payload and the Content-Format is different 722 from what is described in section 5.8.1 of 723 [I-D.ietf-ace-oauth-authz], which only transports the token without 724 any CBOR wrapping. In this profile, the client MUST wrap the token, 725 N1 and ID1 in a CBOR map. The client MUST use the Content-Format 726 "application/ace+cbor" defined in section 8.14 of 727 [I-D.ietf-ace-oauth-authz]. The client MUST include the access token 728 using the 'access_token' parameter, N1 using the 'nonce1' parameter 729 defined in Section 4.1.1, and ID1 using the 'ace_client_recipientid' 730 parameter defined in Section 4.1.2. 732 The communication with the authz-info endpoint does not have to be 733 protected, except for the update of access rights case described 734 below. 736 Note that a client may be required to re-POST the access token in 737 order to complete a request, since an RS may delete a stored access 738 token (and associated Security Context) at any time, for example due 739 to all storage space being consumed. This situation is detected by 740 the client when it receives an AS Request Creation Hints response. 741 Reposting the same access token will result in deriving a new OSCORE 742 Security Context to be used with the RS, as different exchanged 743 nonces will be used. 745 The client may also chose to re-POST the access token in order to 746 renew its OSCORE Security Context. In that case, the client and the 747 RS will exchange newly generated nonces, re-negotiate identifiers, 748 and derive new keying material. The client and RS might decide to 749 keep the same identifiers or renew them during the re-negotiation. 751 Figure 10 shows an example of the request sent from the client to the 752 RS, with payload in CBOR diagnostic notation without the tag and 753 value abbreviations. The access token has been truncated for 754 readability. 756 Header: POST (Code=0.02) 757 Uri-Host: "rs.example.com" 758 Uri-Path: "authz-info" 759 Content-Format: "application/ace+cbor" 760 Payload: 761 { 762 "access_token": h'8343a1010aa2044c53 ... 763 (remainder of access token (CWT) omitted for brevity)', 764 "nonce1": h'018a278f7faab55a', 765 "ace_client_recipientid" : h'1645' 766 } 768 Figure 10: Example C-to-RS POST /authz-info request using CWT 770 If the client has already posted a valid token, has already 771 established a security association with the RS, and wants to update 772 its access rights, the client can do so by posting the new token 773 (retrieved from the AS and containing the update of access rights) to 774 the /authz-info endpoint. The client MUST protect the request using 775 the OSCORE Security Context established during the first token 776 exchange. The client MUST only send the 'access_token' field in the 777 CBOR map in the payload, no nonce or identifier are sent. After 778 proper verification (see Section 4.2), the RS will replace the old 779 token with the new one, maintaining the same Security Context. 781 4.1.1. The Nonce 1 Parameter 783 This parameter MUST be sent from the client to the RS, together with 784 the access token, if the ace profile used is coap_oscore, and the 785 message is not an update of access rights, protected with an existing 786 OSCORE Security Context. The parameter is encoded as a byte string 787 for CBOR-based interactions, and as a string (Base64 encoded binary) 788 for JSON-based interactions. This parameter is registered in 789 Section 9.2. 791 4.1.2. The ace_client_recipientid Parameter 793 This parameter MUST be sent from the client to the RS, together with 794 the access token, if the ace profile used is coap_oscore, and the 795 message is not an update of access rights, protected with an existing 796 OSCORE Security Context. The parameter is encoded as a byte string 797 for CBOR-based interactions, and as a string (Base64 encoded binary) 798 for JSON-based interactions. This parameter is registered in 799 Section 9.2. 801 4.2. RS-to-C: 2.01 (Created) 803 The RS MUST follow the procedures defined in section 5.8.1 of 804 [I-D.ietf-ace-oauth-authz]: the RS must verify the validity of the 805 token. If the token is valid, the RS must respond to the POST 806 request with 2.01 (Created). If the token is valid but is associated 807 to claims that the RS cannot process (e.g., an unknown scope), or if 808 any of the expected parameters is missing (e.g., any of the mandatory 809 parameters from the AS or the identifier 'id1'), or if any parameters 810 received in the 'osc' field is unrecognized, the RS must respond with 811 an error response code equivalent to the CoAP code 4.00 (Bad 812 Request). In the latter two cases, the RS may provide additional 813 information in the error response, in order to clarify what went 814 wrong. The RS may make an introspection request (see Section 5.9.1 815 of [I-D.ietf-ace-oauth-authz]) to validate the token before 816 responding to the POST request to the authz-info endpoint. 818 Additionally, the RS MUST generate a nonce N2 very unlikely to have 819 been previously used with the same input keying material, and its own 820 Recipient ID, ID2. The RS makes sure that ID2 does not collide with 821 any of its Recipient IDs. The RS MUST ensure that ID2 is different 822 from the value received in the ace_client_recipientid parameter. The 823 RS sends N2 and ID2 within the 2.01 (Created) response. The payload 824 of the 2.01 (Created) response MUST be a CBOR map containing the 825 'nonce2' parameter defined in Section 4.2.1, set to N2, and the 826 'ace_server_recipientid' parameter defined in Section 4.2.2, set to 827 ID2. This profile RECOMMENDS to use a 64-bit long random number as 828 nonce's value. The RS MUST use the Content-Format "application/ 829 ace+cbor" defined in section 8.14 of [I-D.ietf-ace-oauth-authz]. 831 Figure 11 shows an example of the response sent from the RS to the 832 client, with payload in CBOR diagnostic notation without the tag and 833 value abbreviations. 835 Header: Created (Code=2.01) 836 Content-Format: "application/ace+cbor" 837 Payload: 838 { 839 "nonce2": h'25a8991cd700ac01', 840 "ace_server_recipientid" : h'0000' 841 } 843 Figure 11: Example RS-to-C 2.01 (Created) response 845 As specified in section 5.8.3 of [I-D.ietf-ace-oauth-authz], the RS 846 must notify the client with an error response with code 4.01 847 (Unauthorized) for any long running request before terminating the 848 session, when the access token expires. 850 If the RS receives the token in a OSCORE protected message, it means 851 that the client is requesting an update of access rights. The RS 852 MUST ignore any nonce and identifiers in the request, if any was 853 sent. The RS MUST check that the "kid" of the 'cnf' claim of the new 854 access token matches the identifier of the OSCORE Input Material of 855 the context used to protect the message. If that is the case, the RS 856 MUST overwrite the old token and associate the new token to the 857 Security Context identified by the "kid" value in the 'cnf' claim. 858 The RS MUST respond with a 2.01 (Created) response protected with the 859 same Security Context, with no payload. If any verification fails, 860 the RS MUST respond with a 4.01 (Unauthorized) error response. 862 As specified in section 5.8.1 of [I-D.ietf-ace-oauth-authz], when 863 receiving an updated access token with updated authorization 864 information from the client (see Section 3.1), it is recommended that 865 the RS overwrites the previous token, that is only the latest 866 authorization information in the token received by the RS is valid. 867 This simplifies the process needed by the RS to keep track of 868 authorization information for a given client. 870 4.2.1. The Nonce 2 Parameter 872 This parameter MUST be sent from the RS to the client if the ace 873 profile used is coap_oscore, and the message is not a response to an 874 update of access rights, protected with an existing OSCORE Security 875 Context. The parameter is encoded as a byte string for CBOR-based 876 interactions, and as a string (Base64 encoded binary) for JSON-based 877 interactions. This parameter is registered in Section 9.2 879 4.2.2. The ace_server_recipientid Parameter 881 This parameter MUST be sent from the RS to the client if the ace 882 profile used is coap_oscore, and the message is not a response to an 883 update of access rights, protected with an existing OSCORE Security 884 Context. The parameter is encoded as a byte string for CBOR-based 885 interactions, and as a string (Base64 encoded binary) for JSON-based 886 interactions. This parameter is registered in Section 9.2 888 4.3. OSCORE Setup 890 Once receiving the 2.01 (Created) response from the RS, following the 891 POST request to authz-info endpoint, the client MUST extract the bstr 892 nonce N2 from the 'nonce2' parameter in the CBOR map in the payload 893 of the response. Then, the client MUST set the Master Salt of the 894 Security Context created to communicate with the RS to the 895 concatenation of salt, N1, and N2, in this order: Master Salt = 896 salt | N1 | N2, where | denotes byte string concatenation, where salt 897 is the CBOR byte string received from the AS in Section 3.2, and 898 where N1 and N2 are the two nonces encoded as CBOR byte strings. An 899 example of Master Salt construction using CBOR encoding is given in 900 Figure 12. 902 N1, N2 and input salt expressed in CBOR diagnostic notation: 903 nonce1 = h'018a278f7faab55a' 904 nonce2 = h'25a8991cd700ac01' 905 input salt = h'f9af838368e353e78888e1426bd94e6f' 907 N1, N2 and input salt as CBOR encoded byte strings: 908 nonce1 = 0x48018a278f7faab55a 909 nonce2 = 0x4825a8991cd700ac01 910 input salt = 0x50f9af838368e353e78888e1426bd94e6f 912 Master Salt = 0x50 f9af838368e353e78888e1426bd94e6f 913 48 018a278f7faab55a 48 25a8991cd700ac01 915 Figure 12: Example of Master Salt construction using CBOR encoding 917 If JSON is used instead of CBOR, the Master Salt of the Security 918 Context is the Base64 encoding of the concatenation of the same 919 parameters, each of them prefixed by their size, encoded in 1 byte. 920 When using JSON, the nonces and input salt have a maximum size of 255 921 bytes. An example of Master Salt construction using Base64 encoding 922 is given in Figure 13. 924 N1, N2 and input salt values: 925 nonce1 = 0x018a278f7faab55a (8 bytes) 926 nonce2 = 0x25a8991cd700ac01 (8 bytes) 927 input salt = 0xf9af838368e353e78888e1426bd94e6f (16 bytes) 929 Input to Base64 encoding: 0x10 f9af838368e353e78888e1426bd94e6f 930 08 018a278f7faab55a 08 25a8991cd700ac01 932 Master Salt = b64'EPmvg4No41PniIjhQmvZTm8IAYonj3+qtVoIJaiZHNcArAE=' 934 Figure 13: Example of Master Salt construction using Base64 encoding 936 The client MUST set the Sender ID to the ace_server_recipientid 937 received in Section 4.2, and the Recipient ID to the 938 ace_client_recipientid sent in Section 4.1. The client MUST set the 939 Master Secret from the parameter received from the AS in Section 3.2. 940 The client MUST set the AEAD Algorithm, ID Context, HKDF, and OSCORE 941 Version from the parameters received from the AS in Section 3.2, if 942 present. In case an optional parameter is omitted, the default value 943 SHALL be used as described in sections 3.2 and 5.4 of [RFC8613]. 944 After that, the client MUST derive the complete Security Context 945 following section 3.2.1 of [RFC8613]. From this point on, the client 946 MUST use this Security Context to communicate with the RS when 947 accessing the resources as specified by the authorization 948 information. 950 If any of the expected parameters is missing (e.g., any of the 951 mandatory parameters from the AS or the RS), or if 952 ace_client_recipientid equals ace_server_recipientid (and as a 953 consequence the Sender and Recipient Keys derived would be equal, see 954 section 3.3 of [RFC8613]), then the client MUST stop the exchange, 955 and MUST NOT derive the Security Context. The client MAY restart the 956 exchange, to get the correct security material. 958 The client then uses this Security Context to send requests to the RS 959 using OSCORE. 961 After sending the 2.01 (Created) response, the RS MUST set the Master 962 Salt of the Security Context created to communicate with the client 963 to the concatenation of salt, N1, and N2, in the same way described 964 above. An example of Master Salt construction using CBOR encoding is 965 given in Figure 12 and using Base64 encoding is given in Figure 13. 966 The RS MUST set the Sender ID from the ace_client_recipientid 967 received in Section 4.1, and the Recipient ID from the 968 ace_server_recipientid sent in Section 4.2. The RS MUST set the 969 Master Secret from the parameter received from the AS and forwarded 970 by the client in the access token in Section 4.1 after validation of 971 the token as specified in Section 4.2. The RS MUST set the AEAD 972 Algorithm, ID Context, HKDF, and OSCORE Version from the parameters 973 received from the AS and forwarded by the client in the access token 974 in Section 4.1 after validation of the token as specified in 975 Section 4.2, if present. In case an optional parameter is omitted, 976 the default value SHALL be used as described in sections 3.2 and 5.4 977 of [RFC8613]. After that, the RS MUST derive the complete Security 978 Context following section 3.2.1 of [RFC8613], and MUST associate this 979 Security Context with the authorization information from the access 980 token. 982 The RS then uses this Security Context to verify requests and send 983 responses to the client using OSCORE. If OSCORE verification fails, 984 error responses are used, as specified in section 8 of [RFC8613]. 985 Additionally, if OSCORE verification succeeds, the verification of 986 access rights is performed as described in section Section 4.4. The 987 RS MUST NOT use the Security Context after the related token has 988 expired, and MUST respond with a unprotected 4.01 (Unauthorized) 989 error message to requests received that correspond to a Security 990 Context with an expired token. 992 Note that the ID Context can be assigned by the AS, communicated and 993 set in both the RS and client after the exchange specified in this 994 profile is executed. Subsequently, client and RS can update their ID 995 Context by running a mechanism such as the one defined in 996 Appendix B.2 of [RFC8613] if they both support it and are configured 997 to do so. In that case, the ID Context in the OSCORE Security 998 Context will not match the "contextId" parameter of the corresponding 999 OSCORE_Input_Material. Running Appendix B.2 results in the keying 1000 material in the Security Contexts of client and RS being updated; 1001 this same result can also be achieved by the client reposting the 1002 access token to the unprotected /authz-info endpoint at the RS, as 1003 described in Section 4.1, but without updating the ID Context. 1005 4.4. Access rights verification 1007 The RS MUST follow the procedures defined in section 5.8.2 of 1008 [I-D.ietf-ace-oauth-authz]: if an RS receives an OSCORE-protected 1009 request from a client, then the RS processes it according to 1010 [RFC8613]. If OSCORE verification succeeds, and the target resource 1011 requires authorization, the RS retrieves the authorization 1012 information using the access token associated to the Security 1013 Context. The RS then must verify that the authorization information 1014 covers the resource and the action requested. 1016 5. Secure Communication with AS 1018 As specified in the ACE framework (section 5.9 of 1019 [I-D.ietf-ace-oauth-authz]), the requesting entity (RS and/or client) 1020 and the AS communicates via the introspection or token endpoint. The 1021 use of CoAP and OSCORE ([RFC8613]) for this communication is 1022 RECOMMENDED in this profile; other protocols fulfilling the security 1023 requirements defined in section 5 of [I-D.ietf-ace-oauth-authz] (such 1024 as HTTP and DTLS or TLS) MAY be used instead. 1026 If OSCORE is used, the requesting entity and the AS are expected to 1027 have pre-established security contexts in place. How these security 1028 contexts are established is out of scope for this profile. 1029 Furthermore the requesting entity and the AS communicate through the 1030 introspection endpoint as specified in section 5.9 of 1031 [I-D.ietf-ace-oauth-authz] and through the token endpoint as 1032 specified in section 5.8 of [I-D.ietf-ace-oauth-authz]. 1034 6. Discarding the Security Context 1036 There are a number of scenarios where a client or RS needs to discard 1037 the OSCORE security context, and acquire a new one. 1039 The client MUST discard the current Security Context associated with 1040 an RS when: 1042 o the Sequence Number space ends. 1044 o the access token associated with the context becomes invalid, due 1045 to e.g. expiration. 1047 o the client receives a number of 4.01 Unauthorized responses to 1048 OSCORE requests using the same Security Context. The exact number 1049 needs to be specified by the application. 1051 o the client receives a new nonce in the 2.01 (Created) response 1052 (see Section 4.2) to a POST request to the authz-info endpoint, 1053 when re-posting a (non-expired) token associated to the existing 1054 context. 1056 The RS MUST discard the current Security Context associated with a 1057 client when: 1059 o the Sequence Number space ends. 1061 o the access token associated with the context expires. 1063 o the client has successfully replaced the current security context 1064 with a newer one by posting an access token to the unprotected 1065 /authz-info endpoint at the RS, e.g., by re-posting the same 1066 token, as specified in Section 4.1. 1068 Whenever one more access token is successfully posted to the RS, and 1069 a new Security Context is derived between the client and RS, messages 1070 in transit that were protected with the previous Security Context 1071 might not pass verification, as the old context is discarded. That 1072 means that messages sent shortly before the client posts one more 1073 access token to the RS might not successfully reach the destination. 1074 Analogously, implementations may want to cancel CoAP observations at 1075 the RS registered before the Security Context is replaced, or 1076 conversely they will need to implement a mechanism to ensure that 1077 those observation are to be protected with the newly derived Security 1078 Context. 1080 7. Security Considerations 1082 This document specifies a profile for the Authentication and 1083 Authorization for Constrained Environments (ACE) framework 1084 [I-D.ietf-ace-oauth-authz]. Thus the general security considerations 1085 from the framework also apply to this profile. 1087 Furthermore the general security considerations of OSCORE [RFC8613] 1088 also apply to this specific use of the OSCORE protocol. 1090 As previously stated, the proof-of-possession in this profile is 1091 performed by both parties verifying that they have established the 1092 same Security Context, as specified in Section 4.3, which means that 1093 both the OSCORE request and OSCORE response pass verification. RS 1094 authentication requires both that the client trusts the AS and that 1095 the OSCORE response from the RS pass verification. 1097 OSCORE is designed to secure point-to-point communication, providing 1098 a secure binding between the request and the response(s). Thus the 1099 basic OSCORE protocol is not intended for use in point-to-multipoint 1100 communication (e.g., multicast, publish-subscribe). Implementers of 1101 this profile should make sure that their use case corresponds to the 1102 expected use of OSCORE, to prevent weakening the security assurances 1103 provided by OSCORE. 1105 Since the use of nonces N1 and N2 during the exchange guarantees 1106 uniqueness of AEAD keys and nonces, it is REQUIRED that the exchanged 1107 nonces are not reused with the same input keying material even in 1108 case of re-boots. This document RECOMMENDS the exchange of 64 bit 1109 random nonces. Considering the birthday paradox, the average 1110 collision for each nonce will happen after 2^32 messages, which is 1111 considerably more token provisionings than expected for intended 1112 applications. If applications use something else, such as a counter, 1113 they need to guarantee that reboot and loss of state on either node 1114 does not provoke reuse. If that is not guaranteed, nodes are 1115 susceptible to reuse of AEAD (nonce, key) pairs, especially since an 1116 on-path attacker can cause the use of a previously exchanged client 1117 nonce N1 for Security Context establishment by replaying the 1118 corresponding client-to-server message. 1120 This profile recommends that the RS maintains a single access token 1121 for each client. The use of multiple access tokens for a single 1122 client increases the strain on the resource server as it must 1123 consider every access token and calculate the actual permissions of 1124 the client. Also, tokens indicating different or disjoint 1125 permissions from each other may lead the server to enforce wrong 1126 permissions. If one of the access tokens expires earlier than 1127 others, the resulting permissions may offer insufficient protection. 1128 Developers should avoid using multiple access tokens for a same 1129 client. 1131 If a single OSCORE Input Material is used with multiple RSs, the RSs 1132 can impersonate the client to one of the other RS, and impersonate 1133 another RS to the client. If a master secret is used with several 1134 clients, the clients can impersonate RS to one of the other clients. 1135 Similarly if symmetric keys are used to integrity protect the token 1136 between AS and RS and the token can be used with multiple RSs, the 1137 RSs can impersonate AS to one of the other RS. If the token key is 1138 used for any other communication between the RSs and AS, the RSs can 1139 impersonate each other to the AS. 1141 8. Privacy Considerations 1143 This document specifies a profile for the Authentication and 1144 Authorization for Constrained Environments (ACE) framework 1145 [I-D.ietf-ace-oauth-authz]. Thus the general privacy considerations 1146 from the framework also apply to this profile. 1148 As this document uses OSCORE, thus the privacy considerations from 1149 [RFC8613] apply here as well. 1151 An unprotected response to an unauthorized request may disclose 1152 information about the resource server and/or its existing 1153 relationship with the client. It is advisable to include as little 1154 information as possible in an unencrypted response. When an OSCORE 1155 Security Context already exists between the client and the resource 1156 server, more detailed information may be included. 1158 The token is sent in the clear to the authz-info endpoint, so if a 1159 client uses the same single token from multiple locations with 1160 multiple Resource Servers, it can risk being tracked by the token's 1161 value even when the access token is encrypted. 1163 The nonces exchanged in the request and response to the authz-info 1164 endpoint are also sent in the clear, so using random nonces is best 1165 for privacy (as opposed to, e.g., a counter, that might leak some 1166 information about the client). 1168 The identifiers used in OSCORE, negotiated between client and RS are 1169 privacy sensitive (see Section 12.8 of [RFC8613]), and could reveal 1170 information about the client, or may be used for correlating requests 1171 from one client. 1173 Note that some information might still leak after OSCORE is 1174 established, due to observable message sizes, the source, and the 1175 destination addresses. 1177 9. IANA Considerations 1179 Note to RFC Editor: Please replace all occurrences of "[[this 1180 specification]]" with the RFC number of this specification and delete 1181 this paragraph. 1183 9.1. ACE Profile Registry 1185 The following registration is done for the ACE Profile Registry 1186 following the procedure specified in section 8.8 of 1187 [I-D.ietf-ace-oauth-authz]: 1189 o Name: coap_oscore 1190 o Description: Profile for using OSCORE to secure communication 1191 between constrained nodes using the Authentication and 1192 Authorization for Constrained Environments framework. 1193 o CBOR Value: TBD (value between 1 and 255) 1194 o Reference: [[this specification]] 1196 9.2. OAuth Parameters Registry 1198 The following registrations are done for the OAuth Parameters 1199 Registry following the procedure specified in section 11.2 of 1200 [RFC6749]: 1202 o Parameter name: nonce1 1203 o Parameter usage location: client-rs request 1204 o Change Controller: IESG 1205 o Specification Document(s): [[this specification]] 1206 o Parameter name: nonce2 1207 o Parameter usage location: rs-client response 1208 o Change Controller: IESG 1209 o Specification Document(s): [[this specification]] 1211 o Parameter name: ace_client_recipientid 1212 o Parameter usage location: client-rs request 1213 o Change Controller: IESG 1214 o Specification Document(s): [[this specification]] 1216 o Parameter name: ace_server_recipientid 1217 o Parameter usage location: rs-client response 1218 o Change Controller: IESG 1219 o Specification Document(s): [[this specification]] 1221 9.3. OAuth Parameters CBOR Mappings Registry 1223 The following registrations are done for the OAuth Parameters CBOR 1224 Mappings Registry following the procedure specified in section 8.10 1225 of [I-D.ietf-ace-oauth-authz]: 1227 o Name: nonce1 1228 o CBOR Key: TBD1 1229 o Value Type: bstr 1230 o Reference: [[this specification]] 1232 o Name: nonce2 1233 o CBOR Key: TBD2 1234 o Value Type: bstr 1235 o Reference: [[this specification]] 1237 o Name: ace_client_recipientid 1238 o CBOR Key: TBD3 1239 o Value Type: bstr 1240 o Reference: [[this specification]] 1242 o Name: ace_server_recipientid 1243 o CBOR Key: TBD4 1244 o Value Type: bstr 1245 o Reference: [[this specification]] 1247 9.4. OSCORE Security Context Parameters Registry 1249 It is requested that IANA create a new registry entitled "OSCORE 1250 Security Context Parameters" registry. The registry is to be created 1251 as Expert Review Required. Guidelines for the experts is provided 1252 Section 9.7. It should be noted that in addition to the expert 1253 review, some portions of the registry require a specification, 1254 potentially on standards track, be supplied as well. 1256 The columns of the registry are: 1258 name The JSON name requested (e.g., "ms"). Because a core goal of 1259 this specification is for the resulting representations to be 1260 compact, it is RECOMMENDED that the name be short. This name is 1261 case sensitive. Names may not match other registered names in a 1262 case-insensitive manner unless the Designated Experts determine 1263 that there is a compelling reason to allow an exception. The name 1264 is not used in the CBOR encoding. 1265 CBOR label The value to be used to identify this algorithm. Map key 1266 labels MUST be unique. The label can be a positive integer, a 1267 negative integer or a string. Integer values between -256 and 255 1268 and strings of length 1 are designated as Standards Track Document 1269 required. Integer values from -65536 to -257 and from 256 to 1270 65535 and strings of length 2 are designated as Specification 1271 Required. Integer values greater than 65535 and strings of length 1272 greater than 2 are designated as expert review. Integer values 1273 less than -65536 are marked as private use. 1274 CBOR Type This field contains the CBOR type for the field. 1275 registry This field denotes the registry that values may come from, 1276 if one exists. 1277 description This field contains a brief description for the field. 1278 specification This contains a pointer to the public specification 1279 for the field if one exists 1281 This registry will be initially populated by the values in Table 1. 1282 The specification column for all of these entries will be this 1283 document and [RFC8613]. 1285 9.5. CWT Confirmation Methods Registry 1287 The following registration is done for the CWT Confirmation Methods 1288 Registry following the procedure specified in section 7.2.1 of 1289 [RFC8747]: 1291 o Confirmation Method Name: "osc" 1292 o Confirmation Method Description: OSCORE_Input_Material carrying 1293 the parameters for using OSCORE per-message security with implicit 1294 key confirmation 1295 o Confirmation Key: TBD (value between 4 and 255) 1296 o Confirmation Value Type(s): map 1297 o Change Controller: IESG 1298 o Specification Document(s): Section 3.2.1 of [[this specification]] 1300 9.6. JWT Confirmation Methods Registry 1302 The following registration is done for the JWT Confirmation Methods 1303 Registry following the procedure specified in section 6.2.1 of 1304 [RFC7800]: 1306 o Confirmation Method Value: "osc" 1307 o Confirmation Method Description: OSCORE_Input_Material carrying 1308 the parameters for using OSCORE per-message security with implicit 1309 key confirmation 1310 o Change Controller: IESG 1311 o Specification Document(s): Section 3.2.1 of [[this specification]] 1313 9.7. Expert Review Instructions 1315 The IANA registry established in this document is defined to use the 1316 Expert Review registration policy. This section gives some general 1317 guidelines for what the experts should be looking for, but they are 1318 being designated as experts for a reason so they should be given 1319 substantial latitude. 1321 Expert reviewers should take into consideration the following points: 1323 o Point squatting should be discouraged. Reviewers are encouraged 1324 to get sufficient information for registration requests to ensure 1325 that the usage is not going to duplicate one that is already 1326 registered and that the point is likely to be used in deployments. 1327 The zones tagged as private use are intended for testing purposes 1328 and closed environments. Code points in other ranges should not 1329 be assigned for testing. 1330 o Specifications are required for the standards track range of point 1331 assignment. Specifications should exist for specification 1332 required ranges, but early assignment before a specification is 1333 available is considered to be permissible. Specifications are 1334 needed for the first-come, first-serve range if they are expected 1335 to be used outside of closed environments in an interoperable way. 1336 When specifications are not provided, the description provided 1337 needs to have sufficient information to identify what the point is 1338 being used for. 1339 o Experts should take into account the expected usage of fields when 1340 approving point assignment. The fact that there is a range for 1341 standards track documents does not mean that a standards track 1342 document cannot have points assigned outside of that range. The 1343 length of the encoded value should be weighed against how many 1344 code points of that length are left, the size of device it will be 1345 used on, and the number of code points left that encode to that 1346 size. 1348 10. References 1350 10.1. Normative References 1352 [COSE.Algorithms] 1353 IANA, "COSE Algorithms", 1354 . 1357 [I-D.ietf-ace-oauth-authz] 1358 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 1359 H. Tschofenig, "Authentication and Authorization for 1360 Constrained Environments (ACE) using the OAuth 2.0 1361 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-36 1362 (work in progress), November 2020. 1364 [I-D.ietf-ace-oauth-params] 1365 Seitz, L., "Additional OAuth Parameters for Authorization 1366 in Constrained Environments (ACE)", draft-ietf-ace-oauth- 1367 params-13 (work in progress), April 2020. 1369 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1370 Requirement Levels", BCP 14, RFC 2119, 1371 DOI 10.17487/RFC2119, March 1997, 1372 . 1374 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 1375 Application Protocol (CoAP)", RFC 7252, 1376 DOI 10.17487/RFC7252, June 2014, 1377 . 1379 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 1380 RFC 8152, DOI 10.17487/RFC8152, July 2017, 1381 . 1383 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1384 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1385 May 2017, . 1387 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 1388 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 1389 May 2018, . 1391 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 1392 Definition Language (CDDL): A Notational Convention to 1393 Express Concise Binary Object Representation (CBOR) and 1394 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 1395 June 2019, . 1397 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 1398 "Object Security for Constrained RESTful Environments 1399 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 1400 . 1402 [RFC8949] Bormann, C. and P. Hoffman, "Concise Binary Object 1403 Representation (CBOR)", STD 94, RFC 8949, 1404 DOI 10.17487/RFC8949, December 2020, 1405 . 1407 10.2. Informative References 1409 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 1410 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 1411 . 1413 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 1414 RFC 6749, DOI 10.17487/RFC6749, October 2012, 1415 . 1417 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1418 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1419 DOI 10.17487/RFC7231, June 2014, 1420 . 1422 [RFC7800] Jones, M., Bradley, J., and H. Tschofenig, "Proof-of- 1423 Possession Key Semantics for JSON Web Tokens (JWTs)", 1424 RFC 7800, DOI 10.17487/RFC7800, April 2016, 1425 . 1427 [RFC8747] Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 1428 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 1429 Web Tokens (CWTs)", RFC 8747, DOI 10.17487/RFC8747, March 1430 2020, . 1432 Appendix A. Profile Requirements 1434 This section lists the specifications on this profile based on the 1435 requirements on the framework, as requested in Appendix C of 1436 [I-D.ietf-ace-oauth-authz]. 1438 o Optionally define new methods for the client to discover the 1439 necessary permissions and AS for accessing a resource, different 1440 from the one proposed in: Not specified 1441 o Optionally specify new grant types: Not specified 1442 o Optionally define the use of client certificates as client 1443 credential type: Not specified 1445 o Specify the communication protocol the client and RS the must use: 1446 CoAP 1447 o Specify the security protocol the client and RS must use to 1448 protect their communication: OSCORE 1449 o Specify how the client and the RS mutually authenticate: 1450 Implicitly by possession of a common OSCORE security context. 1451 Note that the mutual authentication is not completed before the 1452 client has verified an OSCORE response using this security 1453 context. 1454 o Specify the proof-of-possession protocol(s) and how to select one, 1455 if several are available. Also specify which key types (e.g., 1456 symmetric/asymmetric) are supported by a specific proof-of- 1457 possession protocol: OSCORE algorithms; pre-established symmetric 1458 keys 1459 o Specify a unique ace_profile identifier: coap_oscore 1460 o If introspection is supported: Specify the communication and 1461 security protocol for introspection: HTTP/CoAP (+ TLS/DTLS/OSCORE) 1462 o Specify the communication and security protocol for interactions 1463 between client and AS: HTTP/CoAP (+ TLS/DTLS/OSCORE) 1464 o Specify how/if the authz-info endpoint is protected, including how 1465 error responses are protected: Not protected. 1466 o Optionally define other methods of token transport than the authz- 1467 info endpoint: Not defined 1469 Acknowledgments 1471 The authors wish to thank Jim Schaad and Marco Tiloca for the input 1472 on this memo. Special thanks to the responsible area director 1473 Benjamin Kaduk for his extensive review and contributed text. Ludwig 1474 Seitz worked on this document as part of the CelticNext projects 1475 CyberWI, and CRITISEC with funding from Vinnova. The work on this 1476 document has been partly supported also by the H2020 project SIFIS- 1477 Home (Grant agreement 952652). 1479 Authors' Addresses 1481 Francesca Palombini 1482 Ericsson AB 1484 Email: francesca.palombini@ericsson.com 1485 Ludwig Seitz 1486 Combitech 1487 Djaeknegatan 31 1488 Malmoe 211 35 1489 Sweden 1491 Email: ludwig.seitz@combitech.se 1493 Goeran Selander 1494 Ericsson AB 1496 Email: goran.selander@ericsson.com 1498 Martin Gunnarsson 1499 RISE 1500 Scheelevagen 17 1501 Lund 22370 1502 Sweden 1504 Email: martin.gunnarsson@ri.se