idnits 2.17.1 draft-ietf-ace-oscore-profile-16.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 28, 2021) is 1182 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: August 1, 2021 Combitech 6 G. Selander 7 Ericsson AB 8 M. Gunnarsson 9 RISE 10 January 28, 2021 12 OSCORE Profile of the Authentication and Authorization for Constrained 13 Environments Framework 14 draft-ietf-ace-oscore-profile-16 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 August 1, 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) [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 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 during the exchange prevents the reuse of an 217 Authenticated Encryption with Associated Data (AEAD) nonces/key pair 218 for two different messages. Reuse might otherwise occur when client 219 and RS derive a new Security Context from an existing (non- expired) 220 access token, as might occur when either party has just rebooted, and 221 might lead to loss of both confidentiality and integrity. Instead, 222 by using nonces as part of the Master Salt, the request to the authz- 223 info endpoint posting the same token results in a different Security 224 Context, by OSCORE construction, since even though the Master Secret, 225 Sender ID and Recipient ID are the same, the Master Salt is different 226 (see Section 3.2.1 of [RFC8613]). If nonces were reused, a node 227 reusing a non-expired old token would be susceptible to on-path 228 attackers provoking the creation of OSCORE messages using old AEAD 229 keys and nonces. 231 After the whole message exchange has taken place, the client can 232 contact the AS to request an update of its access rights, sending a 233 similar request to the token endpoint that also includes an 234 identifier so that the AS can find the correct OSCORE security input 235 material it has previously shared with the client. This specific 236 identifier, encoded as a byte string, is assigned by the AS to be 237 unique in the sets of its OSCORE security input materials, and is not 238 used as input material to derive the full OSCORE Security Context. 240 An overview of the profile flow for the OSCORE profile is given in 241 Figure 1. The names of messages coincide with those of 242 [I-D.ietf-ace-oauth-authz] when applicable. 244 C RS AS 245 | | | 246 | ----- POST /token ----------------------------> | 247 | | | 248 | <---------------------------- Access Token ----- | 249 | + Access Information | 250 | ---- POST /authz-info ---> | | 251 | (access_token, N1, ID1) | | 252 | | | 253 | <- 2.01 Created (N2, ID2)- | | 254 | | | 255 /Sec Context /Sec Context | 256 derivation/ derivation/ | 257 | | | 258 | ---- OSCORE Request -----> | | 259 | | | 260 | /proof-of-possession | 261 | Sec Context storage/ | 262 | | | 263 | <--- OSCORE Response ----- | | 264 | | | 265 /proof-of-possession | | 266 Sec Context storage/ | | 267 | | | 268 | ---- OSCORE Request -----> | | 269 | | | 270 | <--- OSCORE Response ----- | | 271 | | | 272 /mutual ... | | 273 authentication/ 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 nonces and the two identifiers, established between 686 client and server. The nonces and identifiers are encoded as CBOR 687 byte string if CBOR is used, and as Base64 string if JSON is used. 688 This security context is used to protect all future communication 689 between client and RS using OSCORE, as long as the access token is 690 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 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 nonces will be 743 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 48 018a278f7faab55a 48 25a8991cd700ac01 914 Figure 12: Example of Master Salt construction using CBOR encoding 916 If JSON is used instead of CBOR, the Master Salt of the Security 917 Context is the Base64 encoding of the concatenation of the same 918 parameters, each of them prefixed by their size, encoded in 1 byte. 919 When using JSON, the nonces and input salt have a maximum size of 255 920 bytes. An example of Master Salt construction using Base64 encoding 921 is given in Figure 13. 923 N1, N2 and input salt values: 924 nonce1 = 0x018a278f7faab55a (8 bytes) 925 nonce2 = 0x25a8991cd700ac01 (8 bytes) 926 input salt = 0xf9af838368e353e78888e1426bd94e6f (16 bytes) 928 Input to Base64 encoding: 0x10 f9af838368e353e78888e1426bd94e6f 08 018a278f7faab55a 08 25a8991cd700ac01 930 Master Salt = b64'EPmvg4No41PniIjhQmvZTm8IAYonj3+qtVoIJaiZHNcArAE=' 932 Figure 13: Example of Master Salt construction using Base64 encoding 934 The client MUST set the Sender ID to the ace_server_recipientid 935 received in Section 4.2, and the Recipient ID to the 936 ace_client_recipientid sent in Section 4.1. The client MUST set the 937 Master Secret from the parameter received from the AS in Section 3.2. 938 The client MUST set the AEAD Algorithm, ID Context, HKDF, and OSCORE 939 Version from the parameters received from the AS in Section 3.2, if 940 present. In case an optional parameter is omitted, the default value 941 SHALL be used as described in sections 3.2 and 5.4 of [RFC8613]. 942 After that, the client MUST derive the complete Security Context 943 following section 3.2.1 of [RFC8613]. From this point on, the client 944 MUST use this Security Context to communicate with the RS when 945 accessing the resources as specified by the authorization 946 information. 948 If any of the expected parameters is missing (e.g., any of the 949 mandatory parameters from the AS or the RS), or if 950 ace_client_recipientid equals ace_server_recipientid (and as a 951 consequence the Sender and Recipient Keys derived would be equal, see 952 section 3.3 of [RFC8613]), then the client MUST stop the exchange, 953 and MUST NOT derive the Security Context. The client MAY restart the 954 exchange, to get the correct security material. 956 The client then uses this Security Context to send requests to the RS 957 using OSCORE. 959 After sending the 2.01 (Created) response, the RS MUST set the Master 960 Salt of the Security Context created to communicate with the client 961 to the concatenation of salt, N1, and N2, in the same way described 962 above. An example of Master Salt construction using CBOR encoding is 963 given in Figure 12 and using Base64 encoding is given in Figure 13. 964 The RS MUST set the Sender ID from the ace_client_recipientid 965 received in Section 4.1, and the Recipient ID from the 966 ace_server_recipientid sent in Section 4.2. The RS MUST set the 967 Master Secret from the parameter received from the AS and forwarded 968 by the client in the access token in Section 4.1 after validation of 969 the token as specified in Section 4.2. The RS MUST set the AEAD 970 Algorithm, ID Context, HKDF, and OSCORE Version from the parameters 971 received from the AS and forwarded by the client in the access token 972 in Section 4.1 after validation of the token as specified in 973 Section 4.2, if present. In case an optional parameter is omitted, 974 the default value SHALL be used as described in sections 3.2 and 5.4 975 of [RFC8613]. After that, the RS MUST derive the complete Security 976 Context following section 3.2.1 of [RFC8613], and MUST associate this 977 Security Context with the authorization information from the access 978 token. 980 The RS then uses this Security Context to verify requests and send 981 responses to the client using OSCORE. If OSCORE verification fails, 982 error responses are used, as specified in section 8 of [RFC8613]. 983 Additionally, if OSCORE verification succeeds, the verification of 984 access rights is performed as described in section Section 4.4. The 985 RS MUST NOT use the Security Context after the related token has 986 expired, and MUST respond with a unprotected 4.01 (Unauthorized) 987 error message to requests received that correspond to a Security 988 Context with an expired token. 990 Note that the ID Context can be assigned by the AS, communicated and 991 set in both the RS and client after the exchange specified in this 992 profile is executed. Subsequently, client and RS can update their ID 993 Context by running a mechanism such as the one defined in 994 Appendix B.2 of [RFC8613] if they both support it and are configured 995 to do so. In that case, the ID Context in the OSCORE Security 996 Context will not match the "contextId" parameter of the corresponding 997 OSCORE_Input_Material. Running Appendix B.2 results in the keying 998 material in the Security Contexts of client and RS being updated; 999 this same result can also be achieved by the client reposting the 1000 access token to the unprotected /authz-info endpoint at the RS, as 1001 described in Section 4.1, but without updating the ID Context. 1003 4.4. Access rights verification 1005 The RS MUST follow the procedures defined in section 5.8.2 of 1006 [I-D.ietf-ace-oauth-authz]: if an RS receives an OSCORE-protected 1007 request from a client, then the RS processes it according to 1008 [RFC8613]. If OSCORE verification succeeds, and the target resource 1009 requires authorization, the RS retrieves the authorization 1010 information using the access token associated to the Security 1011 Context. The RS then must verify that the authorization information 1012 covers the resource and the action requested. 1014 5. Secure Communication with AS 1016 As specified in the ACE framework (section 5.9 of 1017 [I-D.ietf-ace-oauth-authz]), the requesting entity (RS and/or client) 1018 and the AS communicates via the introspection or token endpoint. The 1019 use of CoAP and OSCORE ([RFC8613]) for this communication is 1020 RECOMMENDED in this profile; other protocols fulfilling the security 1021 requirements defined in section 5 of [I-D.ietf-ace-oauth-authz] (such 1022 as HTTP and DTLS or TLS) MAY be used instead. 1024 If OSCORE is used, the requesting entity and the AS are expected to 1025 have pre-established security contexts in place. How these security 1026 contexts are established is out of scope for this profile. 1027 Furthermore the requesting entity and the AS communicate through the 1028 introspection endpoint as specified in section 5.9 of 1029 [I-D.ietf-ace-oauth-authz] and through the token endpoint as 1030 specified in section 5.8 of [I-D.ietf-ace-oauth-authz]. 1032 6. Discarding the Security Context 1034 There are a number of scenarios where a client or RS needs to discard 1035 the OSCORE security context, and acquire a new one. 1037 The client MUST discard the current Security Context associated with 1038 an RS when: 1040 o the Sequence Number space ends. 1042 o the access token associated with the context becomes invalid, due 1043 to e.g. expiration. 1045 o the client receives a number of 4.01 Unauthorized responses to 1046 OSCORE requests using the same Security Context. The exact number 1047 needs to be specified by the application. 1049 o the client receives a new nonce in the 2.01 (Created) response 1050 (see Section 4.2) to a POST request to the authz-info endpoint, 1051 when re-posting a (non-expired) token associated to the existing 1052 context. 1054 The RS MUST discard the current Security Context associated with a 1055 client when: 1057 o the Sequence Number space ends. 1059 o the access token associated with the context expires. 1061 o the client has successfully replaced the current security context 1062 with a newer one by posting an access token to the unprotected 1063 /authz-info endpoint at the RS, e.g., by re-posting the same 1064 token, as specified in Section 4.1. 1066 Whenever one more access token is successfully posted to the RS, and 1067 a new Security Context is derived between the client and RS, messages 1068 in transit that were protected with the previous Security Context 1069 might not pass verification, as the old context is discarded. That 1070 means that messages sent shortly before the client posts one more 1071 access token to the RS might not successfully reach the destination. 1072 Analogously, implementations may want to cancel CoAP observations at 1073 the RS registered before the Security Context is replaced, or 1074 conversely they will need to implement a mechanism to ensure that 1075 those observation are to be protected with the newly derived Security 1076 Context. 1078 7. Security Considerations 1080 This document specifies a profile for the Authentication and 1081 Authorization for Constrained Environments (ACE) framework 1082 [I-D.ietf-ace-oauth-authz]. Thus the general security considerations 1083 from the framework also apply to this profile. 1085 Furthermore the general security considerations of OSCORE [RFC8613] 1086 also apply to this specific use of the OSCORE protocol. 1088 As previously stated, the proof-of-possession in this profile is 1089 performed by both parties verifying that they have established the 1090 same Security Context, as specified in Section 4.3, which means that 1091 both the OSCORE request and OSCORE response pass verification. RS 1092 authentication requires both that the client trusts the AS and that 1093 the OSCORE response from the RS pass verification. 1095 OSCORE is designed to secure point-to-point communication, providing 1096 a secure binding between the request and the response(s). Thus the 1097 basic OSCORE protocol is not intended for use in point-to-multipoint 1098 communication (e.g., multicast, publish-subscribe). Implementers of 1099 this profile should make sure that their use case corresponds to the 1100 expected use of OSCORE, to prevent weakening the security assurances 1101 provided by OSCORE. 1103 Since the use of nonces in the exchange guarantees uniqueness of AEAD 1104 keys and nonces, it is REQUIRED that nonces are not reused with the 1105 same input keying material even in case of re-boots. This document 1106 RECOMMENDS the use of 64 bit random nonces. Considering the birthday 1107 paradox, the average collision for each nonce will happen after 2^32 1108 messages, which is considerably more token provisionings than 1109 expected for intended applications. If applications use something 1110 else, such as a counter, they need to guarantee that reboot and loss 1111 of state on either node does not provoke reuse. If that is not 1112 guaranteed, nodes are susceptible to reuse of AEAD (nonces, keys) 1113 pairs, especially since an on-path attacker can cause the client to 1114 use an arbitrary nonce for Security Context establishment by 1115 replaying client-to-server messages. 1117 This profile recommends that the RS maintains a single access token 1118 for each client. The use of multiple access tokens for a single 1119 client increases the strain on the resource server as it must 1120 consider every access token and calculate the actual permissions of 1121 the client. Also, tokens indicating different or disjoint 1122 permissions from each other may lead the server to enforce wrong 1123 permissions. If one of the access tokens expires earlier than 1124 others, the resulting permissions may offer insufficient protection. 1125 Developers should avoid using multiple access tokens for a same 1126 client. 1128 If a single OSCORE Input Material is used with multiple RSs, the RSs 1129 can impersonate the client to one of the other RS, and impersonate 1130 another RS to the client. If a master secret is used with several 1131 clients, the clients can impersonate RS to one of the other clients. 1132 Similarly if symmetric keys are used to integrity protect the token 1133 between AS and RS and the token can be used with multiple RSs, the 1134 RSs can impersonate AS to one of the other RS. If the token key is 1135 used for any other communication between the RSs and AS, the RSs can 1136 impersonate each other to the AS. 1138 8. Privacy Considerations 1140 This document specifies a profile for the Authentication and 1141 Authorization for Constrained Environments (ACE) framework 1142 [I-D.ietf-ace-oauth-authz]. Thus the general privacy considerations 1143 from the framework also apply to this profile. 1145 As this document uses OSCORE, thus the privacy considerations from 1146 [RFC8613] apply here as well. 1148 An unprotected response to an unauthorized request may disclose 1149 information about the resource server and/or its existing 1150 relationship with the client. It is advisable to include as little 1151 information as possible in an unencrypted response. When an OSCORE 1152 Security Context already exists between the client and the resource 1153 server, more detailed information may be included. 1155 The token is sent in the clear to the authz-info endpoint, so if a 1156 client uses the same single token from multiple locations with 1157 multiple Resource Servers, it can risk being tracked by the token's 1158 value even when the access token is encrypted. 1160 The nonces exchanged in the request and response to the authz-info 1161 endpoint are also sent in the clear, so using random nonces is best 1162 for privacy (as opposed to, e.g., a counter, that might leak some 1163 information about the client). 1165 The identifiers used in OSCORE, negotiated between client and RS are 1166 privacy sensitive (see Section 12.8 of [RFC8613]), and could reveal 1167 information about the client, or may be used for correlating requests 1168 from one client. 1170 Note that some information might still leak after OSCORE is 1171 established, due to observable message sizes, the source, and the 1172 destination addresses. 1174 9. IANA Considerations 1176 Note to RFC Editor: Please replace all occurrences of "[[this 1177 specification]]" with the RFC number of this specification and delete 1178 this paragraph. 1180 9.1. ACE Profile Registry 1182 The following registration is done for the ACE Profile Registry 1183 following the procedure specified in section 8.8 of 1184 [I-D.ietf-ace-oauth-authz]: 1186 o Name: coap_oscore 1187 o Description: Profile for using OSCORE to secure communication 1188 between constrained nodes using the Authentication and 1189 Authorization for Constrained Environments framework. 1190 o CBOR Value: TBD (value between 1 and 255) 1191 o Reference: [[this specification]] 1193 9.2. OAuth Parameters Registry 1195 The following registrations are done for the OAuth Parameters 1196 Registry following the procedure specified in section 11.2 of 1197 [RFC6749]: 1199 o Parameter name: nonce1 1200 o Parameter usage location: client-rs request 1201 o Change Controller: IESG 1202 o Specification Document(s): [[this specification]] 1204 o Parameter name: nonce2 1205 o Parameter usage location: rs-client response 1206 o Change Controller: IESG 1207 o Specification Document(s): [[this specification]] 1209 o Parameter name: ace_client_recipientid 1210 o Parameter usage location: client-rs request 1211 o Change Controller: IESG 1212 o Specification Document(s): [[this specification]] 1214 o Parameter name: ace_server_recipientid 1215 o Parameter usage location: rs-client response 1216 o Change Controller: IESG 1217 o Specification Document(s): [[this specification]] 1219 9.3. OAuth Parameters CBOR Mappings Registry 1221 The following registrations are done for the OAuth Parameters CBOR 1222 Mappings Registry following the procedure specified in section 8.10 1223 of [I-D.ietf-ace-oauth-authz]: 1225 o Name: nonce1 1226 o CBOR Key: TBD1 1227 o Value Type: bstr 1228 o Reference: [[this specification]] 1230 o Name: nonce2 1231 o CBOR Key: TBD2 1232 o Value Type: bstr 1233 o Reference: [[this specification]] 1235 o Name: ace_client_recipientid 1236 o CBOR Key: TBD3 1237 o Value Type: bstr 1238 o Reference: [[this specification]] 1240 o Name: ace_server_recipientid 1241 o CBOR Key: TBD4 1242 o Value Type: bstr 1243 o Reference: [[this specification]] 1245 9.4. OSCORE Security Context Parameters Registry 1247 It is requested that IANA create a new registry entitled "OSCORE 1248 Security Context Parameters" registry. The registry is to be created 1249 as Expert Review Required. Guidelines for the experts is provided 1250 Section 9.7. It should be noted that in addition to the expert 1251 review, some portions of the registry require a specification, 1252 potentially on standards track, be supplied as well. 1254 The columns of the registry are: 1256 name The JSON name requested (e.g., "ms"). Because a core goal of 1257 this specification is for the resulting representations to be 1258 compact, it is RECOMMENDED that the name be short. This name is 1259 case sensitive. Names may not match other registered names in a 1260 case-insensitive manner unless the Designated Experts determine 1261 that there is a compelling reason to allow an exception. The name 1262 is not used in the CBOR encoding. 1263 CBOR label The value to be used to identify this algorithm. Map key 1264 labels MUST be unique. The label can be a positive integer, a 1265 negative integer or a string. Integer values between -256 and 255 1266 and strings of length 1 are designated as Standards Track Document 1267 required. Integer values from -65536 to -257 and from 256 to 1268 65535 and strings of length 2 are designated as Specification 1269 Required. Integer values greater than 65535 and strings of length 1270 greater than 2 are designated as expert review. Integer values 1271 less than -65536 are marked as private use. 1272 CBOR Type This field contains the CBOR type for the field. 1273 registry This field denotes the registry that values may come from, 1274 if one exists. 1275 description This field contains a brief description for the field. 1276 specification This contains a pointer to the public specification 1277 for the field if one exists 1279 This registry will be initially populated by the values in Table 1. 1280 The specification column for all of these entries will be this 1281 document and [RFC8613]. 1283 9.5. CWT Confirmation Methods Registry 1285 The following registration is done for the CWT Confirmation Methods 1286 Registry following the procedure specified in section 7.2.1 of 1287 [RFC8747]: 1289 o Confirmation Method Name: "osc" 1290 o Confirmation Method Description: OSCORE_Input_Material carrying 1291 the parameters for using OSCORE per-message security with implicit 1292 key confirmation 1293 o Confirmation Key: TBD (value between 4 and 255) 1294 o Confirmation Value Type(s): map 1295 o Change Controller: IESG 1296 o Specification Document(s): Section 3.2.1 of [[this specification]] 1298 9.6. JWT Confirmation Methods Registry 1300 The following registration is done for the JWT Confirmation Methods 1301 Registry following the procedure specified in section 6.2.1 of 1302 [RFC7800]: 1304 o Confirmation Method Value: "osc" 1305 o Confirmation Method Description: OSCORE_Input_Material carrying 1306 the parameters for using OSCORE per-message security with implicit 1307 key confirmation 1308 o Change Controller: IESG 1309 o Specification Document(s): Section 3.2.1 of [[this specification]] 1311 9.7. Expert Review Instructions 1313 The IANA registry established in this document is defined to use the 1314 Expert Review registration policy. This section gives some general 1315 guidelines for what the experts should be looking for, but they are 1316 being designated as experts for a reason so they should be given 1317 substantial latitude. 1319 Expert reviewers should take into consideration the following points: 1321 o Point squatting should be discouraged. Reviewers are encouraged 1322 to get sufficient information for registration requests to ensure 1323 that the usage is not going to duplicate one that is already 1324 registered and that the point is likely to be used in deployments. 1325 The zones tagged as private use are intended for testing purposes 1326 and closed environments. Code points in other ranges should not 1327 be assigned for testing. 1328 o Specifications are required for the standards track range of point 1329 assignment. Specifications should exist for specification 1330 required ranges, but early assignment before a specification is 1331 available is considered to be permissible. Specifications are 1332 needed for the first-come, first-serve range if they are expected 1333 to be used outside of closed environments in an interoperable way. 1334 When specifications are not provided, the description provided 1335 needs to have sufficient information to identify what the point is 1336 being used for. 1337 o Experts should take into account the expected usage of fields when 1338 approving point assignment. The fact that there is a range for 1339 standards track documents does not mean that a standards track 1340 document cannot have points assigned outside of that range. The 1341 length of the encoded value should be weighed against how many 1342 code points of that length are left, the size of device it will be 1343 used on, and the number of code points left that encode to that 1344 size. 1346 10. References 1348 10.1. Normative References 1350 [COSE.Algorithms] 1351 IANA, "COSE Algorithms", 1352 . 1355 [I-D.ietf-ace-oauth-authz] 1356 Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and 1357 H. Tschofenig, "Authentication and Authorization for 1358 Constrained Environments (ACE) using the OAuth 2.0 1359 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-36 1360 (work in progress), November 2020. 1362 [I-D.ietf-ace-oauth-params] 1363 Seitz, L., "Additional OAuth Parameters for Authorization 1364 in Constrained Environments (ACE)", draft-ietf-ace-oauth- 1365 params-13 (work in progress), April 2020. 1367 [I-D.ietf-cbor-7049bis] 1368 Bormann, C. and P. Hoffman, "Concise Binary Object 1369 Representation (CBOR)", draft-ietf-cbor-7049bis-16 (work 1370 in progress), September 2020. 1372 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1373 Requirement Levels", BCP 14, RFC 2119, 1374 DOI 10.17487/RFC2119, March 1997, 1375 . 1377 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 1378 Application Protocol (CoAP)", RFC 7252, 1379 DOI 10.17487/RFC7252, June 2014, 1380 . 1382 [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", 1383 RFC 8152, DOI 10.17487/RFC8152, July 2017, 1384 . 1386 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1387 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1388 May 2017, . 1390 [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, 1391 "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, 1392 May 2018, . 1394 [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, "Concise Data 1395 Definition Language (CDDL): A Notational Convention to 1396 Express Concise Binary Object Representation (CBOR) and 1397 JSON Data Structures", RFC 8610, DOI 10.17487/RFC8610, 1398 June 2019, . 1400 [RFC8613] Selander, G., Mattsson, J., Palombini, F., and L. Seitz, 1401 "Object Security for Constrained RESTful Environments 1402 (OSCORE)", RFC 8613, DOI 10.17487/RFC8613, July 2019, 1403 . 1405 10.2. Informative References 1407 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 1408 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 1409 . 1411 [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", 1412 RFC 6749, DOI 10.17487/RFC6749, October 2012, 1413 . 1415 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1416 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1417 DOI 10.17487/RFC7231, June 2014, 1418 . 1420 [RFC7800] Jones, M., Bradley, J., and H. Tschofenig, "Proof-of- 1421 Possession Key Semantics for JSON Web Tokens (JWTs)", 1422 RFC 7800, DOI 10.17487/RFC7800, April 2016, 1423 . 1425 [RFC8747] Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. 1426 Tschofenig, "Proof-of-Possession Key Semantics for CBOR 1427 Web Tokens (CWTs)", RFC 8747, DOI 10.17487/RFC8747, March 1428 2020, . 1430 Appendix A. Profile Requirements 1432 This section lists the specifications on this profile based on the 1433 requirements on the framework, as requested in Appendix C of 1434 [I-D.ietf-ace-oauth-authz]. 1436 o Optionally define new methods for the client to discover the 1437 necessary permissions and AS for accessing a resource, different 1438 from the one proposed in: Not specified 1439 o Optionally specify new grant types: Not specified 1440 o Optionally define the use of client certificates as client 1441 credential type: Not specified 1443 o Specify the communication protocol the client and RS the must use: 1444 CoAP 1445 o Specify the security protocol the client and RS must use to 1446 protect their communication: OSCORE 1447 o Specify how the client and the RS mutually authenticate: 1448 Implicitly by possession of a common OSCORE security context. 1449 Note that the mutual authentication is not completed before the 1450 client has verified an OSCORE response using this security 1451 context. 1452 o Specify the proof-of-possession protocol(s) and how to select one, 1453 if several are available. Also specify which key types (e.g., 1454 symmetric/asymmetric) are supported by a specific proof-of- 1455 possession protocol: OSCORE algorithms; pre-established symmetric 1456 keys 1457 o Specify a unique ace_profile identifier: coap_oscore 1458 o If introspection is supported: Specify the communication and 1459 security protocol for introspection: HTTP/CoAP (+ TLS/DTLS/OSCORE) 1460 o Specify the communication and security protocol for interactions 1461 between client and AS: HTTP/CoAP (+ TLS/DTLS/OSCORE) 1462 o Specify how/if the authz-info endpoint is protected, including how 1463 error responses are protected: Not protected. 1464 o Optionally define other methods of token transport than the authz- 1465 info endpoint: Not defined 1467 Acknowledgments 1469 The authors wish to thank Jim Schaad and Marco Tiloca for the input 1470 on this memo. Special thanks to the responsible area director 1471 Benjamin Kaduk for his extensive review and contributed text. Ludwig 1472 Seitz worked on this document as part of the CelticNext projects 1473 CyberWI, and CRITISEC with funding from Vinnova. The work on this 1474 document has been partly supported also by the H2020 project SIFIS- 1475 Home (Grant agreement 952652). 1477 Authors' Addresses 1479 Francesca Palombini 1480 Ericsson AB 1482 Email: francesca.palombini@ericsson.com 1483 Ludwig Seitz 1484 Combitech 1485 Djaeknegatan 31 1486 Malmoe 211 35 1487 Sweden 1489 Email: ludwig.seitz@combitech.se 1491 Goeran Selander 1492 Ericsson AB 1494 Email: goran.selander@ericsson.com 1496 Martin Gunnarsson 1497 RISE 1498 Scheelevagen 17 1499 Lund 22370 1500 Sweden 1502 Email: martin.gunnarsson@ri.se