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