draft-ietf-ace-oscore-profile-05.txt   draft-ietf-ace-oscore-profile-06.txt 
ACE Working Group F. Palombini ACE Working Group F. Palombini
Internet-Draft Ericsson AB Internet-Draft Ericsson AB
Intended status: Standards Track L. Seitz Intended status: Standards Track L. Seitz
Expires: May 11, 2019 RISE SICS AB Expires: July 7, 2019 RISE SICS AB
G. Selander G. Selander
Ericsson AB Ericsson AB
M. Gunnarsson M. Gunnarsson
RISE SICS AB RISE SICS AB
November 7, 2018 January 3, 2019
OSCORE profile of the Authentication and Authorization for Constrained OSCORE profile of the Authentication and Authorization for Constrained
Environments Framework Environments Framework
draft-ietf-ace-oscore-profile-05 draft-ietf-ace-oscore-profile-06
Abstract Abstract
This memo specifies a profile for the Authentication and This memo specifies a profile for the Authentication and
Authorization for Constrained Environments (ACE) framework. It Authorization for Constrained Environments (ACE) framework. It
utilizes Object Security for Constrained RESTful Environments utilizes Object Security for Constrained RESTful Environments
(OSCORE) to provide communication security, server authentication, (OSCORE) to provide communication security, server authentication,
and proof-of-possession for a key owned by the client and bound to an and proof-of-possession for a key owned by the client and bound to an
OAuth 2.0 access token. OAuth 2.0 access token.
skipping to change at page 1, line 41 skipping to change at page 1, line 41
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 11, 2019. This Internet-Draft will expire on July 7, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2019 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 3 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 3
3. Client-AS Communication . . . . . . . . . . . . . . . . . . . 5 3. Client-AS Communication . . . . . . . . . . . . . . . . . . . 5
3.1. C-to-AS: POST to token endpoint . . . . . . . . . . . . . 6 3.1. C-to-AS: POST to token endpoint . . . . . . . . . . . . . 6
3.2. AS-to-C: Access Token . . . . . . . . . . . . . . . . . . 7 3.2. AS-to-C: Access Token . . . . . . . . . . . . . . . . . . 7
3.2.1. OSCORE_Security_Context Object . . . . . . . . . . . 10 3.2.1. OSCORE_Security_Context Object . . . . . . . . . . . 11
4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 13 4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 14
4.1. C-to-RS: POST to authz-info endpoint . . . . . . . . . . 13 4.1. C-to-RS: POST to authz-info endpoint . . . . . . . . . . 15
4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 14 4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 16
4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 15 4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 17
4.4. Access rights verification . . . . . . . . . . . . . . . 16 4.4. Access rights verification . . . . . . . . . . . . . . . 18
5. Secure Communication with AS . . . . . . . . . . . . . . . . 17 5. Secure Communication with AS . . . . . . . . . . . . . . . . 19
6. Discarding the Security Context . . . . . . . . . . . . . . . 17 6. Discarding the Security Context . . . . . . . . . . . . . . . 19
7. Security Considerations . . . . . . . . . . . . . . . . . . . 18 7. Security Considerations . . . . . . . . . . . . . . . . . . . 20
8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 18 8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 21
9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21
9.1. ACE OAuth Profile Registry . . . . . . . . . . . . . . . 19 9.1. ACE OAuth Profile Registry . . . . . . . . . . . . . . . 21
9.2. OSCORE Security Context Parameters Registry . . . . . . . 19 9.2. OSCORE Security Context Parameters Registry . . . . . . . 22
9.3. CWT Confirmation Methods Registry . . . . . . . . . . . . 20 9.3. CWT Confirmation Methods Registry . . . . . . . . . . . . 22
9.4. JWT Confirmation Methods Registry . . . . . . . . . . . . 20 9.4. JWT Confirmation Methods Registry . . . . . . . . . . . . 23
9.5. Expert Review Instructions . . . . . . . . . . . . . . . 20 9.5. Expert Review Instructions . . . . . . . . . . . . . . . 23
10. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 24
10.1. Normative References . . . . . . . . . . . . . . . . . . 21 10.1. Normative References . . . . . . . . . . . . . . . . . . 24
10.2. Informative References . . . . . . . . . . . . . . . . . 22 10.2. Informative References . . . . . . . . . . . . . . . . . 24
Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 23 Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 25
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 23 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 26
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26
1. Introduction 1. Introduction
This memo specifies a profile of the ACE framework This memo specifies a profile of the ACE framework
[I-D.ietf-ace-oauth-authz]. In this profile, a client and a resource [I-D.ietf-ace-oauth-authz]. In this profile, a client and a resource
server use CoAP [RFC7252] to communicate. The client uses an access server use CoAP [RFC7252] to communicate. The client uses an access
token, bound to a key (the proof-of-possession key) to authorize its token, bound to a key (the proof-of-possession key) to authorize its
access to the resource server. In order to provide communication access to the resource server. In order to provide communication
security, proof of possession, and server authentication they use security, proof of possession, and server authentication they use
Object Security for Constrained RESTful Environments (OSCORE) Object Security for Constrained RESTful Environments (OSCORE)
skipping to change at page 4, line 14 skipping to change at page 4, line 14
To determine the AS in charge of a resource hosted at the RS, the To determine the AS in charge of a resource hosted at the RS, the
client C MAY send an initial Unauthorized Resource Request message to client C MAY send an initial Unauthorized Resource Request message to
the RS. The RS then denies the request and sends the address of its the RS. The RS then denies the request and sends the address of its
AS back to the client C as specified in section 5.1 of AS back to the client C as specified in section 5.1 of
[I-D.ietf-ace-oauth-authz]. The access token request and response [I-D.ietf-ace-oauth-authz]. The access token request and response
MUST be confidentiality-protected and ensure authenticity. This MUST be confidentiality-protected and ensure authenticity. This
profile RECOMMENDS the use of OSCORE between client and AS, but TLS profile RECOMMENDS the use of OSCORE between client and AS, but TLS
or DTLS MAY be used additionally or instead. or DTLS MAY be used additionally or instead.
Once the client has retrieved the access token, it posts it to the RS Once the client has retrieved the access token, it generates a nonce
using the authz-info endpoint and mechanisms specified in section 5.8 N1 and posts both the token and N1 to the RS using the authz-info
of [I-D.ietf-ace-oauth-authz]. If the access token is valid, the RS endpoint and mechanisms specified in section 5.8 of
replies to this request with a 2.01 (Created) response, which [I-D.ietf-ace-oauth-authz] and Content-Format = application/ace+cbor.
contains a nonce N1.
After receiving the nonce N1, the client generates a nonce N2, If the access token is valid, the RS replies to this request with a
concatenates it with N1 and sets the ID Context in its Security 2.01 (Created) response with Content-Format = application/ace+cbor,
which contains a nonce N2 in a CBOR map. Moreover, the server
concatenates N1 with N2 and sets the ID Context in the Security
Context (see section 3 of [I-D.ietf-core-object-security]) to N1 Context (see section 3 of [I-D.ietf-core-object-security]) to N1
concatenated with N2. The client then derives the complete Security concatenated with N2. The RS then derives the complete Security
Context from the ID Context plus the parameters received from the AS. Context associated with the received token from it plus the
parameters received in the AS, following section 3.2 of
[I-D.ietf-core-object-security].
After receiving the nonce N2, the client concatenates it with N1 and
sets the ID Context in its Security Context (see section 3 of
[I-D.ietf-core-object-security]) to N1 concatenated with N2. The
client then derives the complete Security Context from the ID Context
plus the parameters received from the AS.
Finally, the client sends a request protected with OSCORE to the RS. Finally, the client sends a request protected with OSCORE to the RS.
This message contains the ID Context value. When receiving this This message may contain the ID Context value. If the request
request after the 2.01 (Created) response, the server extract the ID verifies, then this Security Context is stored in the server, and
Context from it, verifies that the first part is equal to the nonce used in the response, and in further communications with the client,
N1 it previously sent, and if so, sets its own ID Context and derives until token expiration. This Security Context is discarded if the
the complete Security Context from it plus the parameters received in same token is re-used to successfully derive a new Security Context.
the AS, following section 3.2 of [I-D.ietf-core-object-security]. If Once the client receives a valid response, it does not continue to
the request verifies, then this Security Context is stored in the include the ID Context value in further requests.
server, and used in the response, and in further communications with
the client, until token expiration. Once the client receives a valid
response, it does not continue to include the ID Context value in
further requests.
The use of random nonces during the exchange prevents the reuse of The use of random nonces during the exchange prevents the reuse of
AEAD nonces and keys with different messages, in case of re- AEAD nonces and keys with different messages, in case of re-
derivation of the Security Context both for Clients and Resource derivation of the Security Context both for Clients and Resource
Servers from an old non-expired access token, e.g. in case of re-boot Servers from an old non-expired access token, e.g. in case of re-boot
of either the client or RS. In fact, by using random nonces as ID of either the client or RS. In fact, by using random nonces as ID
Context, the request to the authz-info endpoint posting the same Context, the request to the authz-info endpoint posting the same
token results in a different Security Context, since Master Secret, token results in a different Security Context, since Master Secret,
Sender ID and Recipient ID are the same but ID Context is different. Sender ID and Recipient ID are the same but ID Context is different.
Therefore, the main requirement for the nonces is that they have a Therefore, the main requirement for the nonces is that they have a
skipping to change at page 5, line 18 skipping to change at page 5, line 22
C RS AS C RS AS
| [-- Resource Request --->] | | | [-- Resource Request --->] | |
| | | | | |
| [<----- AS Information --] | | | [<----- AS Information --] | |
| | | | | |
| ----- POST /token ----------------------------> | | ----- POST /token ----------------------------> |
| | | | | |
| <---------------------------- Access Token ----- | | <---------------------------- Access Token ----- |
| + RS Information | | + RS Information |
| ---- POST /authz-info ---> | | | ---- POST /authz-info ---> | |
| (access_token, N1) | |
| | | | | |
| <--- 2.01 Created (N1) --- | | | <--- 2.01 Created (N2) --- | |
| | | | | |
/Sec Context Derivation/ | | /Sec Context /Sec Context |
Derivation/ Derivation/ |
| | | | | |
| ---- OSCORE Request -----> | | | ---- OSCORE Request -----> | |
| (N1, N2) | | | ?(N1, N2) | |
| | |
| /Sec Context Derivation/ |
| | | | | |
| <--- OSCORE Response ----- | | | <--- OSCORE Response ----- | |
| | | | | |
| ---- OSCORE Request -----> | | | ---- OSCORE Request -----> | |
| | | | | |
| <--- OSCORE Response ----- | | | <--- OSCORE Response ----- | |
| ... | | | ... | |
Figure 1: Protocol Overview Figure 1: Protocol Overview
skipping to change at page 6, line 23 skipping to change at page 6, line 23
An example of such a request, in CBOR diagnostic notation without the An example of such a request, in CBOR diagnostic notation without the
tag and value abbreviations is reported in Figure 2 tag and value abbreviations is reported in Figure 2
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "as.example.com" Uri-Host: "as.example.com"
Uri-Path: "token" Uri-Path: "token"
Content-Format: "application/ace+cbor" Content-Format: "application/ace+cbor"
Payload: Payload:
{ {
"grant_type" : "client_credentials",
"client_id" : "myclient",
"req_aud" : "tempSensor4711", "req_aud" : "tempSensor4711",
"scope" : "read" "scope" : "read"
} }
Figure 2: Example C-to-AS POST /token request for an access token Figure 2: Example C-to-AS POST /token request for an access token
bound to a symmetric key. bound to a symmetric key.
If the client wants to update its access rights without changing an If the client wants to update its access rights without changing an
existing OSCORE Security Context, it MUST include in its POST request existing OSCORE Security Context, it MUST include in its POST request
to the token endpoint a req_cnf object carrying the client's to the token endpoint a req_cnf object carrying the client's
skipping to change at page 7, line 10 skipping to change at page 7, line 10
Section 5.6.3 of [I-D.ietf-ace-oauth-authz]. Section 5.6.3 of [I-D.ietf-ace-oauth-authz].
An example of such a request, in CBOR diagnostic notation without the An example of such a request, in CBOR diagnostic notation without the
tag and value abbreviations is reported in Figure 3 tag and value abbreviations is reported in Figure 3
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "as.example.com" Uri-Host: "as.example.com"
Uri-Path: "token" Uri-Path: "token"
Content-Format: "application/ace+cbor" Content-Format: "application/ace+cbor"
Payload: Payload:
{ {
"grant_type" : "client_credentials",
"client_id" : "myclient",
"req_aud" : "tempSensor4711", "req_aud" : "tempSensor4711",
"scope" : "write", "scope" : "write",
"req_cnf" : { "req_cnf" : {
"kid" : b64'Qg' "kid" : "myclient"
} }
Figure 3: Example C-to-AS POST /token request for updating rights to Figure 3: Example C-to-AS POST /token request for updating rights to
an access token bound to a symmetric key. an access token bound to a symmetric key.
3.2. AS-to-C: Access Token 3.2. AS-to-C: Access Token
After verifying the POST request to the token endpoint and that the After verifying the POST request to the token endpoint and that the
client is authorized to obtain an access token corresponding to its client is authorized to obtain an access token corresponding to its
access token request, the AS responds as defined in section 5.6.2 of access token request, the AS responds as defined in section 5.6.2 of
[I-D.ietf-ace-oauth-authz]. If the client request was invalid, or [I-D.ietf-ace-oauth-authz]. If the client request was invalid, or
not authorized, the AS returns an error response as described in not authorized, the AS returns an error response as described in
section 5.6.3 of [I-D.ietf-ace-oauth-authz]. section 5.6.3 of [I-D.ietf-ace-oauth-authz].
The AS signals that the use of OSCORE is REQUIRED for a specific The AS can signal that the use of OSCORE is REQUIRED for a specific
access token by including the "profile" parameter with the value access token by including the "profile" parameter with the value
"coap_oscore" in the access token response. This means that the "coap_oscore" in the access token response. This means that the
client MUST use OSCORE towards all resource servers for which this client MUST use OSCORE towards all resource servers for which this
access token is valid, and follow Section 4.3 to derive the security access token is valid, and follow Section 4.3 to derive the security
context to run OSCORE. context to run OSCORE. Usually it is assumed that constrained
devices will be pre-configured with the necessary profile, so that
this kind of profile negotiation can be omitted.
Moreover, the AS MUST provision the following data: Moreover, the AS MUST provision the following data:
o a master secret o a master secret
o a client identifier
o a server identifier o a server identifier
Additionally, the AS MAY provision the following data, in the same Additionally, the AS MAY provision the following data, in the same
response. response.
o a client identifier
o an AEAD algorithm o an AEAD algorithm
o an HKDF algorithm o an HKDF algorithm
o a salt o a salt
o a replay window type and size o a replay window type and size
The master secret MUST be communicated as the 'ms' field in the The master secret MUST be communicated as the 'ms' field in the
OSCORE_Security_Context in the 'cnf' parameter of the access token OSCORE_Security_Context in the 'cnf' parameter of the access token
response as defined in Section 3.2 of [I-D.ietf-ace-oauth-params]. response as defined in Section 3.2 of [I-D.ietf-ace-oauth-params].
The OSCORE_Security_Context is a CBOR map object, defined in The OSCORE_Security_Context is a CBOR map object, defined in
Section 3.2.1. The AEAD algorithm MAY be included as the 'alg' Section 3.2.1. The AEAD algorithm MAY be included as the 'alg'
parameter in the OSCORE_Security_Context; the HKDF algorithm MAY be parameter in the OSCORE_Security_Context; the HKDF algorithm MAY be
included as the 'hkdf' parameter of the OSCORE_Security_Context, the included as the 'hkdf' parameter of the OSCORE_Security_Context, the
salt MAY be included as the 'salt' parameter of the salt MAY be included as the 'salt' parameter of the
COSCORE_Security_Context and the replay window type and size MAY be COSCORE_Security_Context, and the replay window type and size MAY be
included as the 'rpl' of the OSCORE_Security_Context, as defined in included as the 'rpl' of the OSCORE_Security_Context, as defined in
Section 3.2.1. Section 3.2.1.
The same parameters MUST be included as metadata of the access token. The same parameters MUST be included as metadata of the access token.
This profile RECOMMENDS the use of CBOR web token (CWT) as specified This profile RECOMMENDS the use of CBOR web token (CWT) as specified
in [RFC8392]. If the token is a CWT, the same in [RFC8392]. If the token is a CWT, the same
OSCORE_Security_Context structure defined above MUST be placed in the OSCORE_Security_Context structure defined above MUST be placed in the
'cnf' claim of this token. 'cnf' claim of this token.
The AS MUST also assign identifiers to both client and RS, which are The AS MUST also assign an identifier to the RS, and MAY assign an
then used as Sender ID and Recipient ID in the OSCORE context as identifier to the client. These identifiers are then used as Sender
described in section 3.1 of [I-D.ietf-core-object-security]. The ID and Recipient ID in the OSCORE context as described in section 3.1
client identifiers MUST be unique in the set of all clients on a of [I-D.ietf-core-object-security]. The client identifiers MUST be
single RS, and RS identifiers MUST be unique in the set of all RS for unique in the set of all clients on a single RS, and RS identifiers
any given client. Moreover, these MUST be included in the MUST be unique in the set of all RS for any given client. Moreover,
OSCORE_Security_Context, as defined in Section 3.2.1. when assigned, these MUST be included in the OSCORE_Security_Context,
as defined in Section 3.2.1.
We assume in this document that a resource is associated to one We assume in this document that a resource is associated to one
single AS, which makes it possible to assume unique identifiers for single AS, which makes it possible to assume unique identifiers for
each client requesting a particular resource to a RS. If this is not each client requesting a particular resource to a RS. If this is not
the case, collisions of identifiers may appear in the RS, in which the case, collisions of identifiers may appear in the RS, in which
case the RS needs to have a mechanism in place to disambiguate case the RS needs to have a mechanism in place to disambiguate
identifiers or mitigate their effect. identifiers or mitigate their effect.
Note that in Section 4.3 C sets the Sender ID of its Security Context Note that in Section 4.3 C sets the Sender ID of its Security Context
to the clientId value received and the Recipient ID to the serverId to the clientId value received and the Recipient ID to the serverId
value, and RS does the opposite. value, and RS does the opposite.
Figure 4 shows an example of such an AS response, in CBOR diagnostic Figure 4 shows an example of such an AS response, in CBOR diagnostic
notation without the tag and value abbreviations. notation without the tag and value abbreviations.
Header: Created (Code=2.01) Header: Created (Code=2.01)
Content-Type: "application/cose+cbor" Content-Type: "application/ace+cbor"
Payload: Payload:
{ {
"access_token" : b64'SlAV32hkKG ... "access_token" : h'a5037674656d7053656e73 ...'
(remainder of access token omitted for brevity)', (remainder of access token omitted for brevity)',
"profile" : "coap_oscore", "profile" : "coap_oscore",
"expires_in" : "3600", "expires_in" : "3600",
"cnf" : { "cnf" : {
"OSCORE_Security_Context" : { "OSCORE_Security_Context" : {
"alg" : "AES-CCM-16-64-128", "alg" : "AES-CCM-16-64-128",
"clientId" : b64'qA', "clientId" : b64'qA',
"serverId" : b64'Qg', "serverId" : b64'Qg',
"ms" : b64'+a+Dg2jjU+eIiOFCa9lObw' "ms" : h'f9af838368e353e78888e1426bd94e6f'
} }
} }
} }
Figure 4: Example AS-to-C Access Token response with OSCORE profile. Figure 4: Example AS-to-C Access Token response with OSCORE profile.
Figure 5 shows an example CWT, containing the necessary OSCORE Figure 5 shows an example CWT, containing the necessary OSCORE
parameters in the 'cnf' claim, in CBOR diagnostic notation without parameters in the 'cnf' claim, in CBOR diagnostic notation without
tag and value abbreviations. tag and value abbreviations.
{ {
"aud" : "tempSensorInLivingRoom", "aud" : "tempSensorInLivingRoom",
"iat" : "1360189224", "iat" : "1360189224",
"exp" : "1360289224", "exp" : "1360289224",
"scope" : "temperature_g firmware_p", "scope" : "temperature_g firmware_p",
"cnf" : { "cnf" : {
"OSCORE_Security_Context" : { "OSCORE_Security_Context" : {
"alg" : "AES-CCM-16-64-128", "alg" : "AES-CCM-16-64-128",
"clientId" : b64'Qg', "clientId" : "client",
"serverId" : b64'qA', "serverId" : "server",
"ms" : b64'+a+Dg2jjU+eIiOFCa9lObw' "ms" : h'f9af838368e353e78888e1426bd94e6f'
} }
} }
Figure 5: Example CWT with OSCORE parameters. Figure 5: Example CWT with OSCORE parameters.
The same CWT token as in Figure 5, using the value abbreviations
defined in [I-D.ietf-ace-oauth-authz] and
[I-D.ietf-ace-cwt-proof-of-possession] and encoded in CBOR is shown
in Figure 6.
NOTE TO THE RFC EDITOR: before publishing, it should be checked (and
in case fixed) that the values used below (which are not yet
registered) are the final values registered in IANA.
A5 # map(5)
03 # unsigned(3)
76 # text(22)
74656D7053656E736F72496E4C6976696E67526F6F6D
# "tempSensorInLivingRoom"
06 # unsigned(6)
1A 5112D728 # unsigned(1360189224)
04 # unsigned(4)
1A 51145DC8 # unsigned(1360289224)
09 # unsigned(9)
78 18 # text(24)
74656D70657261747572655F67206669726D776172655F70
# "temperature_g firmware_p"
08 # unsigned(8)
A1 # map(1)
04 # unsigned(4)
A4 # map(4)
05 # unsigned(5)
0A # unsigned(10)
02 # unsigned(2)
66 # text(6)
636C69656E74 # "client"
03 # unsigned(3)
66 # text(6)
736572766572 # "server"
01 # unsigned(1)
50 # bytes(16)
F9AF838368E353E78888E1426BD94E6F
Figure 6: Example CWT with OSCORE parameters.
If the client has requested an update to its access rights using the If the client has requested an update to its access rights using the
same OSCORE Security Context, which is valid and authorized, the AS same OSCORE Security Context, which is valid and authorized, the AS
MUST omit the 'cnf' parameter in the response, and MUST carry the MUST omit the 'cnf' parameter in the response, and MUST carry the
client identifier in the 'kid' field in the 'cnf' parameter of the client identifier in the 'kid' field in the 'cnf' parameter of the
token. The client identifier needs to be provisioned, in order for token. The client identifier needs to be provisioned, in order for
the RS to identify the previously generated Security Context. the RS to identify the previously generated Security Context.
Figure 6 shows an example of such an AS response, in CBOR diagnostic Figure 7 shows an example of such an AS response, in CBOR diagnostic
notation without the tag and value abbreviations. notation without the tag and value abbreviations.
Header: Created (Code=2.01) Header: Created (Code=2.01)
Content-Type: "application/cose+cbor" Content-Type: "application/ace+cbor"
Payload: Payload:
{ {
"access_token" : b64'SlAV32hkKG ... "access_token" : h'a5037674656d7053656e73 ...'
(remainder of access token omitted for brevity)', (remainder of access token omitted for brevity)',
"profile" : "coap_oscore", "profile" : "coap_oscore",
"expires_in" : "3600" "expires_in" : "3600"
} }
Figure 6: Example AS-to-C Access Token response with OSCORE profile, Figure 7: Example AS-to-C Access Token response with OSCORE profile,
for update of access rights. for update of access rights.
Figure 7 shows an example CWT, containing the necessary OSCORE Figure 8 shows an example CWT, containing the necessary OSCORE
parameters in the 'cnf' claim for update of access rights, in CBOR parameters in the 'cnf' claim for update of access rights, in CBOR
diagnostic notation without tag and value abbreviations. diagnostic notation without tag and value abbreviations.
{ {
"aud" : "tempSensorInLivingRoom", "aud" : "tempSensorInLivingRoom",
"iat" : "1360189224", "iat" : "1360189224",
"exp" : "1360289224", "exp" : "1360289224",
"scope" : "temperature_h", "scope" : "temperature_h",
"cnf" : { "cnf" : {
"kid" : b64'Qg' "kid" : b64'Qg'
} }
} }
Figure 7: Example CWT with OSCORE parameters for update of access Figure 8: Example CWT with OSCORE parameters for update of access
rights. rights.
3.2.1. OSCORE_Security_Context Object 3.2.1. OSCORE_Security_Context Object
An OSCORE_Security_Context is an object that represents part or all An OSCORE_Security_Context is an object that represents part or all
of an OSCORE Security Context (Section 3.1 of of an OSCORE Security Context (Section 3.1 of
[I-D.ietf-core-object-security]). The OSCORE_Security_Context object [I-D.ietf-core-object-security]). The OSCORE_Security_Context object
can either be encoded as JSON or as CBOR. In both cases, the set of can either be encoded as JSON or as CBOR. In both cases, the set of
common parameters that can appear in an OSCORE_Security_Context common parameters that can appear in an OSCORE_Security_Context
object can be found in the IANA "OSCORE Security Context Parameters" object can be found in the IANA "OSCORE Security Context Parameters"
registry (Section Section 9.2) and is defined below. All parameters registry (Section Section 9.2) and is defined below. All parameters
are optional. Table 1 provides a summary of the are optional. Table 1 provides a summary of the
OSCORE_Security_Context parameters defined in this section. OSCORE_Security_Context parameters defined in this section.
+----------+-------+----------------+--------------+----------------+ +-----------+-------+----------------+--------------+---------------+
| name | CBOR | CBOR type | registry | description | | name | CBOR | CBOR type | registry | description |
| | label | | | | | | label | | | |
+----------+-------+----------------+--------------+----------------+ +-----------+-------+----------------+--------------+---------------+
| ms | 1 | bstr | | OSCORE Master | | ms | 1 | bstr | | OSCORE Master |
| | | | | Secret value | | | | | | Secret value |
| | | | | | | | | | | |
| clientId | 2 | bstr | | OSCORE Sender | | clientId | 2 | bstr | | OSCORE Sender |
| | | | | ID value of | | | | | | ID value of |
| | | | | the client, | | | | | | the client, |
| | | | | OSCORE | | | | | | OSCORE |
| | | | | Recipient ID | | | | | | Recipient ID |
| | | | | value of the | | | | | | value of the |
| | | | | server | | | | | | server |
| | | | | | | | | | | |
| serverId | 3 | bstr | | OSCORE Sender | | serverId | 3 | bstr | | OSCORE Sender |
| | | | | ID value of | | | | | | ID value of |
| | | | | the server, | | | | | | the server, |
| | | | | OSCORE | | | | | | OSCORE |
| | | | | Recipient ID | | | | | | Recipient ID |
| | | | | value of the | | | | | | value of the |
| | | | | client | | | | | | client |
| | | | | | | | | | | |
| hkdf | 4 | bstr / int | COSE | OSCORE HKDF | | hkdf | 4 | bstr / int | COSE | OSCORE HKDF |
| | | | Algorithm | value | | | | | Algorithm | value |
| | | | Values | | | | | | Values | |
| | | | (HMAC-based) | | | | | | (HMAC-based) | |
| | | | | | | | | | | |
| alg | 5 | tstr / int | COSE | OSCORE AEAD | | alg | 5 | tstr / int | COSE | OSCORE AEAD |
| | | | Algorithm | Algorithm | | | | | Algorithm | Algorithm |
| | | | Values | value | | | | | Values | value |
| | | | (AEAD) | | | | | | (AEAD) | |
| | | | | | | | | | | |
| salt | 6 | bstr | | OSCORE Master | | salt | 6 | bstr | | OSCORE Master |
| | | | | Salt value | | | | | | Salt value |
| | | | | | | | | | | |
| rpl | 7 | bstr / int | | OSCORE Replay | | contextId | 7 | bstr | | OSCORE ID |
| | | | | Window Type | | | | | | Context value |
| | | | | and Size | | | | | | |
+----------+-------+----------------+--------------+----------------+ | rpl | 8 | bstr / int | | OSCORE Replay |
| | | | | Window Type |
| | | | | and Size |
+-----------+-------+----------------+--------------+---------------+
Table 1: OSCORE_Security_Context Parameters Table 1: OSCORE_Security_Context Parameters
ms: This parameter identifies the OSCORE Master Secret value, which ms: This parameter identifies the OSCORE Master Secret value, which
is a byte string. For more information about this field, see is a byte string. For more information about this field, see
section 3.1 of [I-D.ietf-core-object-security]. In JSON, the "ms" section 3.1 of [I-D.ietf-core-object-security]. In JSON, the "ms"
value is a Base64 encoded byte string. In CBOR, the "ms" type is value is a Base64 encoded byte string. In CBOR, the "ms" type is
bstr, and has label 1. bstr, and has label 1.
clientId: This parameter identifies a client identifier as a byte clientId: This parameter identifies a client identifier as a byte
string. This identifier is used as OSCORE Sender ID in the client string. This identifier is used as OSCORE Sender ID in the client
and OSCORE Recipient ID in the server. For more information about and OSCORE Recipient ID in the server. For more information about
this field, see section 3.1 of [I-D.ietf-core-object-security]. this field, see section 3.1 of [I-D.ietf-core-object-security].
In JSON, the "clientID" value is a Base64 encoded byte string. In In JSON, the "clientId" value is a Base64 encoded byte string. In
CBOR, the "clientID" type is bstr, and has label 2. CBOR, the "clientId" type is bstr, and has label 2.
serverId: This parameter identifies a server identifier as a byte serverId: This parameter identifies a server identifier as a byte
string. This identifier is used as OSCORE Sender ID in the client string. This identifier is used as OSCORE Sender ID in the client
and OSCORE Recipient ID in the server. For more information about and OSCORE Recipient ID in the server. For more information about
this field, see section 3.1 of [I-D.ietf-core-object-security]. this field, see section 3.1 of [I-D.ietf-core-object-security].
In JSON, the "serverID" value is a Base64 encoded byte string. In In JSON, the "serverId" value is a Base64 encoded byte string. In
CBOR, the "serverID" type is bstr, and has label 3. CBOR, the "serverId" type is bstr, and has label 3.
hkdf: This parameter identifies the OSCORE HKDF Algorithm. For more hkdf: This parameter identifies the OSCORE HKDF Algorithm. For more
information about this field, see section 3.1 of information about this field, see section 3.1 of
[I-D.ietf-core-object-security]. The values used MUST be [I-D.ietf-core-object-security]. The values used MUST be
registered in the IANA "COSE Algorithms" registry and MUST be registered in the IANA "COSE Algorithms" registry and MUST be
HMAC-based HKDF algorithms. The value can either be the integer HMAC-based HKDF algorithms. The value can either be the integer
or the text string value of the HMAC-based HKDF algorithm in the or the text string value of the HMAC-based HKDF algorithm in the
"COSE Algorithms" registry. In JSON, the "hkdf" value is a case- "COSE Algorithms" registry. In JSON, the "hkdf" value is a case-
sensitive ASCII string or an integer. In CBOR, the "hkdf" type is sensitive ASCII string or an integer. In CBOR, the "hkdf" type is
tstr or int, and has label 4. tstr or int, and has label 4.
skipping to change at page 12, line 45 skipping to change at page 13, line 48
Algorithms" registry. In JSON, the "alg" value is a case- Algorithms" registry. In JSON, the "alg" value is a case-
sensitive ASCII string or an integer. In CBOR, the "alg" type is sensitive ASCII string or an integer. In CBOR, the "alg" type is
tstr or int, and has label 5. tstr or int, and has label 5.
salt: This parameter identifies the OSCORE Master Salt value, which salt: This parameter identifies the OSCORE Master Salt value, which
is a byte string. For more information about this field, see is a byte string. For more information about this field, see
section 3.1 of [I-D.ietf-core-object-security]. In JSON, the section 3.1 of [I-D.ietf-core-object-security]. In JSON, the
"salt" value is a Base64 encoded byte string. In CBOR, the "salt" "salt" value is a Base64 encoded byte string. In CBOR, the "salt"
type is bstr, and has label 6. type is bstr, and has label 6.
contextId: This parameter identifies the security context as a byte
string. This identifier is used as OSCORE ID Context. For more
information about this field, see section 3.1 of
[I-D.ietf-core-object-security]. In JSON, the "contextID" value
is a Base64 encoded byte string. In CBOR, the "contextID" type is
bstr, and has label 7.
repl: This parameter is used to carry the OSCORE value, encoded as a repl: This parameter is used to carry the OSCORE value, encoded as a
bstr. This parameter identifies the OSCORE Replay Window Size and bstr. This parameter identifies the OSCORE Replay Window Size and
Type value, which is a byte string. For more information about Type value, which is a byte string. For more information about
this field, see section 3.1 of [I-D.ietf-core-object-security]. this field, see section 3.1 of [I-D.ietf-core-object-security].
In JSON, the "repl" value is a Base64 encoded byte string. In In JSON, the "repl" value is a Base64 encoded byte string. In
CBOR, the "repl" type is bstr, and has label 7. CBOR, the "repl" type is bstr, and has label 8.
An example of JSON OSCORE_Security_Context is given in Figure 8. An example of JSON OSCORE_Security_Context is given in Figure 9.
"OSCORE_Security_Context" : { "OSCORE_Security_Context" : {
"alg" : "AES-CCM-16-64-128", "alg" : "AES-CCM-16-64-128",
"clientId" : b64'qA', "clientId" : b64'qA',
"serverId" : b64'Qg', "serverId" : b64'Qg',
"ms" : b64'+a+Dg2jjU+eIiOFCa9lObw' "ms" : b64'+a+Dg2jjU+eIiOFCa9lObw'
} }
Figure 8: Example JSON OSCORE_Security_Context object Figure 9: Example JSON OSCORE_Security_Context object
The CDDL grammar describing the CBOR OSCORE_Security_Context object The CDDL grammar describing the CBOR OSCORE_Security_Context object
is: is:
OSCORE_Security_Context = { OSCORE_Security_Context = {
? 1 => bstr, ; ms ? 1 => bstr, ; ms
? 2 => bstr, ; clientId ? 2 => bstr, ; clientId
? 3 => bstr, ; serverId ? 3 => bstr, ; serverId
? 4 => tstr / int, ; hkdf ? 4 => tstr / int, ; hkdf
? 5 => tstr / int, ; alg ? 5 => tstr / int, ; alg
? 6 => bstr, ; salt ? 6 => bstr, ; salt
? 7 => bstr / tstr ; rpl ? 7 => bstr, ; contextId
? 8 => bstr / tstr, ; rpl
* int / tstr => any
} }
4. Client-RS Communication 4. Client-RS Communication
The following subsections describe the details of the POST request The following subsections describe the details of the POST request
and response to the authz-info endpoint between client and RS. The and response to the authz-info endpoint between client and RS. The
client posts the token that includes the materials provisioned by the client generates a nonce N1 and posts it together with the token that
AS to the RS, which can then use Section 3.2 of includes the materials provisioned by the AS to the RS. The RS then
derives a nonce N2 and use Section 3.2 of
[I-D.ietf-core-object-security] to derive a security context based on [I-D.ietf-core-object-security] to derive a security context based on
a shared master secret and a set of other parameters, established a shared master secret and the two nonces, established between client
between client and server. and server.
Note that the proof-of-possession required to bind the access token Note that the proof-of-possession required to bind the access token
to the client is implicitly performed by generating the shared OSCORE to the client is implicitly performed by generating the shared OSCORE
Security Context using the pop-key as master secret, for both client Security Context using the pop-key as master secret, for both client
and RS. An attacker using a stolen token will not be able to and RS. An attacker using a stolen token will not be able to
generate a valid OSCORE context and thus not be able to prove generate a valid OSCORE context and thus not be able to prove
possession of the pop-key. possession of the pop-key.
4.1. C-to-RS: POST to authz-info endpoint 4.1. C-to-RS: POST to authz-info endpoint
The client MUST use CoAP and the Authorization Information resource The client MUST generate a nonce N1 very unlikely to have been
as described in section 5.8.1 of [I-D.ietf-ace-oauth-authz] to previously used with the same input keying material. This profile
transport the token to the RS. RECOMMENDS to use a 64-bit long random number as nonce. The client
MUST store this nonce as long as the response from the RS is not
received and the access token related to it is still valid. The
client MUST use CoAP and the Authorization Information resource as
described in section 5.8.1 of [I-D.ietf-ace-oauth-authz] to transport
the token and N1 to the RS. The client MUST use the Content-Format
"application/ace+cbor" defined in section 8.14 of
[I-D.ietf-ace-oauth-authz]. The client MUST include the access token
using the correct CBOR label (e.g., "cwt" for CWT, "jwt" for JWT) and
N1 using the 'nonce' parameter defined in section 5.1.2 of
[I-D.ietf-ace-oauth-authz].
The authz-info endpoint is not protected, nor are the responses from The authz-info endpoint is not protected, nor are the responses from
this resource. this resource.
The access token MUST be encrypted, since it is transferred from the The access token MUST be encrypted, since it is transferred from the
client to the RS over an unprotected channel. client to the RS over an unprotected channel.
Note that a client may be required to re-POST the access token, since Note that a client may be required to re-POST the access token, since
an RS may delete a stored access token, due to lack of memory. an RS may delete a stored access token, due to lack of memory.
Figure 9 shows an example of the request sent from the client to the Figure 10 shows an example of the request sent from the client to the
RS. RS, in CBOR diagnostic notation without the tag and value
abbreviations.
Header: POST (Code=0.02) Header: POST (Code=0.02)
Uri-Host: "rs.example.com" Uri-Host: "rs.example.com"
Uri-Path: "authz-info" Uri-Path: "authz-info"
Content-Format: "application/cwt" Content-Format: "application/ace+cbor"
Payload: Payload:
b64'SlAV32hkKG ... {
(remainder of access token omitted for brevity)', "access_token": h'a5037674656d7053656e73 ...'
(remainder of access token omitted for brevity)',
"nonce": h'018a278f7faab55a'
}
Figure 9: Example C-to-RS POST /authz-info request using CWT Figure 10: Example C-to-RS POST /authz-info request using CWT
4.2. RS-to-C: 2.01 (Created) 4.2. RS-to-C: 2.01 (Created)
The RS MUST follow the procedures defined in section 5.8.1 of The RS MUST follow the procedures defined in section 5.8.1 of
[I-D.ietf-ace-oauth-authz]: the RS MUST verify the validity of the [I-D.ietf-ace-oauth-authz]: the RS MUST verify the validity of the
token. If the token is valid, the RS MUST respond to the POST token. If the token is valid, the RS MUST respond to the POST
request with 2.01 (Created). If the token is valid but is associated request with 2.01 (Created). If the token is valid but is associated
to claims that the RS cannot process (e.g., an unknown scope) the RS to claims that the RS cannot process (e.g., an unknown scope), or if
any of the expected parameters in the OSCORE_Security_Context is
missing (e.g. any of the mandatory parameters from the AS), the RS
MUST respond with a response code equivalent to the CoAP code 4.00 MUST respond with a response code equivalent to the CoAP code 4.00
(Bad Request). In the latter case the RS MAY provide additional (Bad Request). In the latter case the RS MAY provide additional
information in the error response, in order to clarify what went information in the error response, in order to clarify what went
wrong. The RS MAY make an introspection request to validate the wrong. The RS MAY make an introspection request to validate the
token before responding to the POST request to the authz-info token before responding to the POST request to the authz-info
endpoint. endpoint.
Additionally, the RS MUST generate a nonce (N1) with a good amount of Additionally, the RS MUST generate a nonce N2 very unlikely to have
randomness, and include it in the payload of the 2.01 (Created) been previously used with the same input keying material, and send it
response as a CBOR byte string. This profile RECOMMENDS to use a within the 2.01 (Created) response. The payload of the 2.01
nonce of 64 bits. The RS MUST store this nonce as long as the access (Created) response MUST be a CBOR map containing the 'nonce'
token related to it is still valid. parameter defined in section 5.1.2 of [I-D.ietf-ace-oauth-authz], set
to N2. This profile RECOMMENDS to use a 64-bit long random number as
Note that, when using this profile, an identifier of the token (e.g., nonce. Moreover, if the OSCORE_Security_Context in the token did not
the cti for a CWT) is not transported in the payload of this request, contain a 'clientId' parameter, the RS MUST generate an identifier,
as section 5.8.1 of [I-D.ietf-ace-oauth-authz] allows. unique in the set of all its existing client identifiers, and send it
in a 'clientId' parameter in the CBOR map as a CBOR bstr. The RS MAY
generate and send a 'ClientId' identifier even though the
OSCORE_Security_Context contained such a parameter, in order to
guarantee the uniqueness of the client identifier. The RS MUST use
the Content-Format "application/ace+cbor" defined in section 8.14 of
[I-D.ietf-ace-oauth-authz].
Figure 10 shows an example of the response sent from the RS to the Figure 11 shows an example of the response sent from the RS to the
client. client, in CBOR diagnostic notation without the tag and value
abbreviations.
Header: Created (Code=2.01) Header: Created (Code=2.01)
Content-Format: "application/cbor" Content-Format: "application/ace+cbor"
Payload: Payload:
h'018a278f7faab55a', {
"nonce": h'25a8991cd700ac01'
}
Figure 10: Example RS-to-C 2.01 (Created) response Figure 11: Example RS-to-C 2.01 (Created) response
When receiving an updated access token with updated authorization When receiving an updated access token with updated authorization
information from the client (see section Section 3.1), it is information from the client (see section Section 3.1), it is
RECOMMENDED that the RS overwrites the previous token, that is only RECOMMENDED that the RS overwrites the previous token, that is only
the latest authorization information in the token received by the RS the latest authorization information in the token received by the RS
is valid. This simplifies for the RS to keep track of authorization is valid. This simplifies for the RS to keep track of authorization
information for a given client. information for a given client.
As specified in section 5.8.3 of [I-D.ietf-ace-oauth-authz], the RS As specified in section 5.8.3 of [I-D.ietf-ace-oauth-authz], the RS
MUST notify the client with an error response with code 4.01 MUST notify the client with an error response with code 4.01
(Unauthorized) for any long running request before terminating the (Unauthorized) for any long running request before terminating the
session, when the access token expires. session, when the access token expires.
4.3. OSCORE Setup 4.3. OSCORE Setup
Once receiving the 2.01 (Created) response from the RS, following the Once receiving the 2.01 (Created) response from the RS, following the
POST request to authz-info endpoint, the client MUST extract the POST request to authz-info endpoint, the client MUST extract the
nonce N1 from the CBOR byte string in the payload of the response. nonce N2 from the 'nonce' parameter and the client identifier from
The client MUST generate itself a nonce (N2) with a good amount of the 'clientId' in the CBOR map in the payload of the response. Then,
randomness. This profile RECOMMENDS to use a nonce of 64 bits. the client MUST set the ID Context of the Security Context created to
Then, the client MUST set the ID Context of the Security Context communicate with the RS to the concatenation of N1 and N2, in this
created to communicate with the RS to the concatenation of N1 and N2, order: ID Context = N1 | N2, where | denotes byte string
in this order: ID Context = N1 | N2, where | denotes byte string concatenation. The client MUST set the Master Secret and Recipient
concatenation. The client MUST set the Master Secret, Sender ID and ID from the parameters received from the AS in Section 3.2. The
Recipient ID from the parameters received from the AS in Section 3.2. client MUST set the AEAD Algorithm, Master Salt, HKDF, and Replay
The client MUST set the AEAD Algorithm, Master Salt, HKDF and Replay
Window from the parameters received from the AS in Section 3.2, if Window from the parameters received from the AS in Section 3.2, if
present. In case these parameters are omitted, the default values present. In case these parameters are omitted, the default values
are used as described in section 3.2 of are used as described in section 3.2 of
[I-D.ietf-core-object-security]. After that, the client MUST derive [I-D.ietf-core-object-security]. The client MUST set the Sender ID
the complete Security Context following section 3.2.1 of from the 'clientId in the 2.01 (Created) response, if present;
otherwise, the client MUST set the Sender ID from the parameters
received from the AS in Section 3.2. After that, the client MUST
derive the complete Security Context following section 3.2.1 of
[I-D.ietf-core-object-security]. From this point on, the client MUST [I-D.ietf-core-object-security]. From this point on, the client MUST
use this Security Context to communicate with the RS when accessing use this Security Context to communicate with the RS when accessing
the resources as specified by the authorization information. the resources as specified by the authorization information.
If any of the expected parameters is missing (e.g. any of the
mandatory parameters from the AS, or the 'clientId', either received
from the AS or in the 2.01 (Created) response from the RS), the
client MUST stop the exchange, and MUST NOT derive the Security
Context. The client MAY restart the exchange, to get the correct
security material.
The client then uses this Security Context to send requests to RS The client then uses this Security Context to send requests to RS
using OSCORE. In the first request sent to the RS, the client MUST using OSCORE. In the first request sent to the RS, the client MAY
include the kid context, with value ID Context, i.e. N1 concatenated include the kid context, with value ID Context, i.e. N1 concatenated
with N2. The client needs to make sure the RS receives the kid with N2.
context, possibly adding the kid context to later requests, until it
receives a valid OSCORE response from the RS using the same Security
Context.
When the RS receives this first OSCORE-protected request, it MUST After sending the 2.01 (Created) response, the RS MUST set the ID
extract the kid context from the message first. Then, it needs to Context of the Security Context created to communicate with the
verify that the first part of the kid context corresponds to the client to the concatenation of N1 and N2, in this order: ID Context =
nonce N1 it previously sent, and that it is followed by a non-zero- N1 | N2, where | denotes byte string concatenation. The RS MUST set
length byte string. If that is verified, the RS MUST set the ID the Master Secret, Sender ID and Recipient ID from the parameters,
Context to the kid context value. Then, the RS MUST set the Master received from the client in the access token in Section 4.1 after
Secret, Sender ID and Recipient ID from the parameters received from validation of the token as specified in Section 4.2. The RS MUST set
the client in the access token in Section 4.1. The RS MUST set the the AEAD Algorithm, Master Salt, HKDF, and Replay Window from the
AEAD Algorithm, Master Salt, HKDF and Replay Window from the
parameters received from the client in the access token in parameters received from the client in the access token in
Section 4.1, if present. In case these parameters are omitted, the Section 4.1 after validation of the token as specified in
Section 4.2, if present. In case these parameters are omitted, the
default values are used as described in section 3.2 of default values are used as described in section 3.2 of
[I-D.ietf-core-object-security]. After that, the RS MUST derive the [I-D.ietf-core-object-security]. After that, the RS MUST derive the
complete Security Context following section 3.2.1 of complete Security Context following section 3.2.1 of
[I-D.ietf-core-object-security], and MUST associate this Security [I-D.ietf-core-object-security], and MUST associate this Security
Context with the authorization information from the access token. Context with the authorization information from the access token.
Then, the RS MUST delete the nonce N1 from memory.
The RS then uses this Security Context to verify the request and send The RS then uses this Security Context to verify the request and send
responses to RS using OSCORE. If OSCORE verification fails, error responses to RS using OSCORE. If OSCORE verification fails, error
responses are used, as specified in section 8 of responses are used, as specified in section 8 of
[I-D.ietf-core-object-security]. Additionally, if OSCORE [I-D.ietf-core-object-security]. Additionally, if OSCORE
verification succeeds, the verification of access rights is performed verification succeeds, the verification of access rights is performed
as described in section Section 4.4. The RS MUST NOT use the as described in section Section 4.4. The RS MUST NOT use the
Security Context after the related token has expired, and MUST Security Context after the related token has expired, and MUST
respond with a unprotected 4.01 (Unauthorized) error message. respond with a unprotected 4.01 (Unauthorized) error message.
4.4. Access rights verification 4.4. Access rights verification
The RS MUST follow the procedures defined in section 5.8.2 of The RS MUST follow the procedures defined in section 5.8.2 of
[I-D.ietf-ace-oauth-authz]: if an RS receives an OSCORE-protected [I-D.ietf-ace-oauth-authz]: if an RS receives an OSCORE-protected
request from a client, then it processes according to request from a client, then the RS processes it according to
[I-D.ietf-core-object-security]. If OSCORE verification succeeds, [I-D.ietf-core-object-security]. If OSCORE verification succeeds,
and the target resource requires authorization, the RS retrieves the and the target resource requires authorization, the RS retrieves the
authorization information from the access token associated to the authorization information from the access token associated to the
Security Context. The RS then MUST verify that the authorization Security Context. The RS then MUST verify that the authorization
information covers the resource and the action requested. information covers the resource and the action requested.
The response code MUST be 4.01 (Unauthorized) in case the client has The response code MUST be 4.01 (Unauthorized) in case the client has
not used the Security Context associated with the access token, or if not used the Security Context associated with the access token, or if
RS has no valid access token for the client. If RS has an access RS has no valid access token for the client. If RS has an access
token for the client but not for the resource that was requested, RS token for the client but not for the resource that was requested, RS
skipping to change at page 17, line 41 skipping to change at page 20, line 5
an RS when: an RS when:
o the Sequence Number space ends. o the Sequence Number space ends.
o the access token associated with the context expires. o the access token associated with the context expires.
o the client receives a number of 4.01 Unauthorized responses to o the client receives a number of 4.01 Unauthorized responses to
OSCORE requests using the same security context. The exact number OSCORE requests using the same security context. The exact number
needs to be specified by the application. needs to be specified by the application.
o the client receives a new nonce in the 2.01 Created response (see o the client receives a new nonce in the 2.01 (Created) response
Section 4.2) to a POST request to the authz-info endpoint, when (see Section 4.2) to a POST request to the authz-info endpoint,
re-posting a non-expired token associated to the existing context. when re-posting a non-expired token associated to the existing
context.
The RS MUST discard the current security context associated with a The RS MUST discard the current security context associated with a
client when: client when:
o Sequence Number space ends. o Sequence Number space ends.
o Access token associated with the context expires. o Access token associated with the context expires.
7. Security Considerations 7. Security Considerations
skipping to change at page 18, line 25 skipping to change at page 20, line 37
OSCORE is designed to secure point-to-point communication, providing OSCORE is designed to secure point-to-point communication, providing
a secure binding between the request and the response(s). Thus the a secure binding between the request and the response(s). Thus the
basic OSCORE protocol is not intended for use in point-to-multipoint basic OSCORE protocol is not intended for use in point-to-multipoint
communication (e.g. multicast, publish-subscribe). Implementers of communication (e.g. multicast, publish-subscribe). Implementers of
this profile should make sure that their usecase corresponds to the this profile should make sure that their usecase corresponds to the
expected use of OSCORE, to prevent weakening the security assurances expected use of OSCORE, to prevent weakening the security assurances
provided by OSCORE. provided by OSCORE.
Since the use of nonces in the exchange guarantees uniqueness of AEAD Since the use of nonces in the exchange guarantees uniqueness of AEAD
keys and nonces even in case of re-boots, a good amount of randomness keys and nonces, it is REQUIRED that nonces are not reused with the
is required. If that is not guaranteed, nodes are still susceptible same input keying material even in case of re-boots. This document
to re-using nonces and keys, in case the Security Context is lost, RECOMMENDS the use of 64 bit random nonces to guarantee non-reuse; if
and on-path attacker replaying messages. applications use something else, such as a counter, they need to
guarantee that reboot and lost of state on either node does not
provoke re-use. If that is not guaranteed, nodes are still
susceptible to re-using AEAD nonces and keys, in case the Security
Context is lost, and on-path attacker replay messages.
This profiles recommends that the RS maintains a single access token This profiles recommends that the RS maintains a single access token
for a client. The use of multiple access tokens for a single client for a client. The use of multiple access tokens for a single client
increases the strain on the resource server as it must consider every increases the strain on the resource server as it must consider every
access token and calculate the actual permissions of the client. access token and calculate the actual permissions of the client.
Also, tokens may contradict each other which may lead the server to Also, tokens may contradict each other which may lead the server to
enforce wrong permissions. If one of the access tokens expires enforce wrong permissions. If one of the access tokens expires
earlier than others, the resulting permissions may offer insufficient earlier than others, the resulting permissions may offer insufficient
protection. Developers should avoid using multiple access tokens for protection. Developers should avoid using multiple access tokens for
a client. a client.
skipping to change at page 19, line 37 skipping to change at page 22, line 10
and Authorization for Constrained Environments framework. and Authorization for Constrained Environments framework.
o Profile ID: TBD (value between 1 and 255) o Profile ID: TBD (value between 1 and 255)
o Change Controller: IESG o Change Controller: IESG
o Specification Document(s): [[this specification]] o Specification Document(s): [[this specification]]
9.2. OSCORE Security Context Parameters Registry 9.2. OSCORE Security Context Parameters Registry
It is requested that IANA create a new registry entitled "OSCORE It is requested that IANA create a new registry entitled "OSCORE
Security Context Parameters" registry. The registry is to be created Security Context Parameters" registry. The registry is to be created
as Expert Review Required. Guidelines for the experts is provided as Expert Review Required. Guidelines for the experts is provided
Section 9.5. It should be noted that in additional to the expert Section 9.5. It should be noted that in addition to the expert
review, some portions of the registry require a specification, review, some portions of the registry require a specification,
potentially on standards track, be supplied as well. potentially on standards track, be supplied as well.
The columns of the registry are: The columns of the registry are:
name This is a descriptive name that enables easier reference to the name The JSON name requested (e.g., "ms"). Because a core goal of
item. It is not used in the CBOR encoding. this specification is for the resulting representations to be
compact, it is RECOMMENDED that the name be short. This name is
case sensitive. Names may not match other registered names in a
case-insensitive manner unless the Designated Experts state that
there is a compelling reason to allow an exception. The name is
not used in the CBOR encoding.
CBOR label The value to be used to identify this algorithm. Key map CBOR label The value to be used to identify this algorithm. Key map
labels MUST be unique. The label can be a positive integer, a labels MUST be unique. The label can be a positive integer, a
negative integer or a string. Integer values between 0 and 255 negative integer or a string. Integer values between 0 and 255
and strings of length 1 are designated as Standards Track Document and strings of length 1 are designated as Standards Track Document
required. Integer values from 256 to 65535 and strings of length required. Integer values from 256 to 65535 and strings of length
2 are designated as Specification Required. Integer values of 2 are designated as Specification Required. Integer values of
greater than 65535 and strings of length greater than 2 are greater than 65535 and strings of length greater than 2 are
designated as expert review. Integer values less than -65536 are designated as expert review. Integer values less than -65536 are
marked as private use. marked as private use.
CBOR Type This field contains the CBOR type for the field. CBOR Type This field contains the CBOR type for the field.
skipping to change at page 21, line 38 skipping to change at page 24, line 15
size. size.
10. References 10. References
10.1. Normative References 10.1. Normative References
[I-D.ietf-ace-oauth-authz] [I-D.ietf-ace-oauth-authz]
Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and
H. Tschofenig, "Authentication and Authorization for H. Tschofenig, "Authentication and Authorization for
Constrained Environments (ACE) using the OAuth 2.0 Constrained Environments (ACE) using the OAuth 2.0
Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-16 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-17
(work in progress), October 2018. (work in progress), November 2018.
[I-D.ietf-ace-oauth-params] [I-D.ietf-ace-oauth-params]
Seitz, L., "Additional OAuth Parameters for Authorization Seitz, L., "Additional OAuth Parameters for Authorization
in Constrained Environments (ACE)", draft-ietf-ace-oauth- in Constrained Environments (ACE)", draft-ietf-ace-oauth-
params-00 (work in progress), September 2018. params-01 (work in progress), November 2018.
[I-D.ietf-core-object-security] [I-D.ietf-core-object-security]
Selander, G., Mattsson, J., Palombini, F., and L. Seitz, Selander, G., Mattsson, J., Palombini, F., and L. Seitz,
"Object Security for Constrained RESTful Environments "Object Security for Constrained RESTful Environments
(OSCORE)", draft-ietf-core-object-security-15 (work in (OSCORE)", draft-ietf-core-object-security-15 (work in
progress), August 2018. progress), August 2018.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
skipping to change at page 22, line 29 skipping to change at page 25, line 9
[RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig, [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig,
"CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392, "CBOR Web Token (CWT)", RFC 8392, DOI 10.17487/RFC8392,
May 2018, <https://www.rfc-editor.org/info/rfc8392>. May 2018, <https://www.rfc-editor.org/info/rfc8392>.
10.2. Informative References 10.2. Informative References
[I-D.ietf-ace-cwt-proof-of-possession] [I-D.ietf-ace-cwt-proof-of-possession]
Jones, M., Seitz, L., Selander, G., Erdtman, S., and H. Jones, M., Seitz, L., Selander, G., Erdtman, S., and H.
Tschofenig, "Proof-of-Possession Key Semantics for CBOR Tschofenig, "Proof-of-Possession Key Semantics for CBOR
Web Tokens (CWTs)", draft-ietf-ace-cwt-proof-of- Web Tokens (CWTs)", draft-ietf-ace-cwt-proof-of-
possession-04 (work in progress), November 2018. possession-05 (work in progress), November 2018.
[RFC4949] Shirey, R., "Internet Security Glossary, Version 2", [RFC4949] Shirey, R., "Internet Security Glossary, Version 2",
FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007,
<https://www.rfc-editor.org/info/rfc4949>. <https://www.rfc-editor.org/info/rfc4949>.
[RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework", [RFC6749] Hardt, D., Ed., "The OAuth 2.0 Authorization Framework",
RFC 6749, DOI 10.17487/RFC6749, October 2012, RFC 6749, DOI 10.17487/RFC6749, October 2012,
<https://www.rfc-editor.org/info/rfc6749>. <https://www.rfc-editor.org/info/rfc6749>.
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
skipping to change at page 23, line 17 skipping to change at page 25, line 41
This section lists the specifications on this profile based on the This section lists the specifications on this profile based on the
requirements on the framework, as requested in Appendix C of requirements on the framework, as requested in Appendix C of
[I-D.ietf-ace-oauth-authz]. [I-D.ietf-ace-oauth-authz].
o (Optional) discovery process of how the client finds the right AS o (Optional) discovery process of how the client finds the right AS
for an RS it wants to send a request to: Not specified for an RS it wants to send a request to: Not specified
o communication protocol the client and the RS must use: CoAP o communication protocol the client and the RS must use: CoAP
o security protocol the client and RS must use: OSCORE o security protocol the client and RS must use: OSCORE
o how the client and the RS mutually authenticate: Implicitly by o how the client and the RS mutually authenticate: Implicitly by
possession of a common OSCORE security context possession of a common OSCORE security context
o Content-format of the protocol messages: "application/cose+cbor" o Content-format of the protocol messages: "application/ace+cbor"
o proof-of-possession protocol(s) and how to select one; which key o proof-of-possession protocol(s) and how to select one; which key
types (e.g. symmetric/asymmetric) supported: OSCORE algorithms; types (e.g. symmetric/asymmetric) supported: OSCORE algorithms;
pre-established symmetric keys pre-established symmetric keys
o profile identifier: coap_oscore o profile identifier: coap_oscore
o (Optional) how the RS talks to the AS for introspection: HTTP/CoAP o (Optional) how the RS talks to the AS for introspection: HTTP/CoAP
(+ TLS/DTLS/OSCORE) (+ TLS/DTLS/OSCORE)
o how the client talks to the AS for requesting a token: HTTP/CoAP o how the client talks to the AS for requesting a token: HTTP/CoAP
(+ TLS/DTLS/OSCORE) (+ TLS/DTLS/OSCORE)
o how/if the authz-info endpoint is protected: Security protocol o how/if the authz-info endpoint is protected: Security protocol
above above
 End of changes. 72 change blocks. 
200 lines changed or deleted 297 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/