draft-ietf-ace-oscore-profile-04.txt   draft-ietf-ace-oscore-profile-05.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: April 11, 2019 RISE SICS AB Expires: May 11, 2019 RISE SICS AB
G. Selander G. Selander
Ericsson AB Ericsson AB
M. Gunnarsson M. Gunnarsson
RISE SICS AB RISE SICS AB
October 8, 2018 November 7, 2018
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-04 draft-ietf-ace-oscore-profile-05
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 April 11, 2019. This Internet-Draft will expire on May 11, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 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
skipping to change at page 2, line 18 skipping to change at page 2, line 18
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 /token . . . . . . . . . . . . . . . . . . 5 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
4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 11 3.2.1. OSCORE_Security_Context Object . . . . . . . . . . . 10
4.1. C-to-RS: POST /authz-info . . . . . . . . . . . . . . . . 12 4. Client-RS Communication . . . . . . . . . . . . . . . . . . . 13
4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 12 4.1. C-to-RS: POST to authz-info endpoint . . . . . . . . . . 13
4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 13 4.2. RS-to-C: 2.01 (Created) . . . . . . . . . . . . . . . . . 14
4.4. Access rights verification . . . . . . . . . . . . . . . 15 4.3. OSCORE Setup . . . . . . . . . . . . . . . . . . . . . . 15
5. Secure Communication with AS . . . . . . . . . . . . . . . . 15 4.4. Access rights verification . . . . . . . . . . . . . . . 16
6. Security Considerations . . . . . . . . . . . . . . . . . . . 15 5. Secure Communication with AS . . . . . . . . . . . . . . . . 17
7. Privacy Considerations . . . . . . . . . . . . . . . . . . . 16 6. Discarding the Security Context . . . . . . . . . . . . . . . 17
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 7. Security Considerations . . . . . . . . . . . . . . . . . . . 18
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 8. Privacy Considerations . . . . . . . . . . . . . . . . . . . 18
9.1. Normative References . . . . . . . . . . . . . . . . . . 18 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19
9.2. Informative References . . . . . . . . . . . . . . . . . 19 9.1. ACE OAuth Profile Registry . . . . . . . . . . . . . . . 19
Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 19 9.2. OSCORE Security Context Parameters Registry . . . . . . . 19
Appendix B. Using the pop-key with EDHOC (EDHOC+OSCORE) . . . . 20 9.3. CWT Confirmation Methods Registry . . . . . . . . . . . . 20
B.1. Using Asymmetric Keys . . . . . . . . . . . . . . . . . . 20 9.4. JWT Confirmation Methods Registry . . . . . . . . . . . . 20
B.2. Using Symmetric Keys . . . . . . . . . . . . . . . . . . 22 9.5. Expert Review Instructions . . . . . . . . . . . . . . . 20
B.3. Processing . . . . . . . . . . . . . . . . . . . . . . . 24 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 21
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 25 10.1. Normative References . . . . . . . . . . . . . . . . . . 21
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26 10.2. Informative References . . . . . . . . . . . . . . . . . 22
Appendix A. Profile Requirements . . . . . . . . . . . . . . . . 23
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 23
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23
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 3, line 31 skipping to change at page 3, line 33
"authorization", "confidentiality", "(data) integrity", "message "authorization", "confidentiality", "(data) integrity", "message
authentication code", and "verify" are taken from [RFC4949]. authentication code", and "verify" are taken from [RFC4949].
RESTful terminology follows HTTP [RFC7231]. RESTful terminology follows HTTP [RFC7231].
Terminology for entities in the architecture is defined in OAuth 2.0 Terminology for entities in the architecture is defined in OAuth 2.0
[RFC6749], such as client (C), resource server (RS), and [RFC6749], such as client (C), resource server (RS), and
authorization server (AS). It is assumed in this document that a authorization server (AS). It is assumed in this document that a
given resource on a specific RS is associated to a unique AS. given resource on a specific RS is associated to a unique AS.
Note that the term "endpoint" is used here, as in
[I-D.ietf-ace-oauth-authz], following its OAuth definition, which is
to denote resources such as token and introspect at the AS and authz-
info at the RS. The CoAP [RFC7252] definition, which is "An entity
participating in the CoAP protocol" is not used in this memo.
2. Protocol Overview 2. Protocol Overview
This section gives an overview on how to use the ACE Framework This section gives an overview on how to use the ACE Framework
[I-D.ietf-ace-oauth-authz] to secure the communication between a [I-D.ietf-ace-oauth-authz] to secure the communication between a
client and a resource server using OSCORE client and a resource server using OSCORE
[I-D.ietf-core-object-security]. The parameters needed by the client [I-D.ietf-core-object-security]. The parameters needed by the client
to negotiate the use of this profile with the authorization server, to negotiate the use of this profile with the authorization server,
as well as OSCORE setup process, are described in detail in the as well as OSCORE setup process, are described in detail in the
following sections. following sections.
This profile requires a client to retrieve an access token from the This profile requires a client to retrieve an access token from the
AS for the resource it wants to access on a RS, using the token AS for the resource it wants to access on a RS, using the token
resource, as specified in section 5.6 of [I-D.ietf-ace-oauth-authz]. endpoint, as specified in section 5.6 of [I-D.ietf-ace-oauth-authz].
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 posts it to the RS
using the authz-info resource and mechanisms specified in section 5.8 using the authz-info endpoint and mechanisms specified in section 5.8
of [I-D.ietf-ace-oauth-authz]. If the access token is valid, the RS of [I-D.ietf-ace-oauth-authz]. If the access token is valid, the RS
replies to this request with a 2.01 (Created) response, which replies to this request with a 2.01 (Created) response, which
contains a nonce N1. contains a nonce N1.
After receiving the nonce N1, the client generates a nonce N2, After receiving the nonce N1, the client generates a nonce N2,
concatenates it with N1 and sets the ID Context in its Security 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 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 client then derives the complete Security
Context from the ID Context plus the parameters received from the AS. Context from the ID Context plus the parameters received from the AS.
skipping to change at page 4, line 30 skipping to change at page 4, line 39
Context from it, verifies that the first part is equal to the nonce Context from it, verifies that the first part is equal to the nonce
N1 it previously sent, and if so, sets its own ID Context and derives N1 it previously sent, and if so, sets its own ID Context and derives
the complete Security Context from it plus the parameters received in the complete Security Context from it plus the parameters received in
the AS, following section 3.2 of [I-D.ietf-core-object-security]. If the AS, following section 3.2 of [I-D.ietf-core-object-security]. If
the request verifies, then this Security Context is stored in the the request verifies, then this Security Context is stored in the
server, and used in the response, and in further communications with server, and used in the response, and in further communications with
the client, until token expiration. Once the client receives a valid the client, until token expiration. Once the client receives a valid
response, it does not continue to include the ID Context value in response, it does not continue to include the ID Context value in
further requests. further requests.
The use of random nonces during the exchange prevents the reuse of
AEAD nonces and keys with different messages, in case of re-
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
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
token results in a different Security Context, since Master Secret,
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
good amount of randomness. If random nonces were not used, a node
re-using a non-expired old token would be susceptible to on-path
attackers provoking the creation of OSCORE messages using old AEAD
keys and nonces.
An overview of the profile flow for the OSCORE profile is given in An overview of the profile flow for the OSCORE profile is given in
Figure 1. Figure 1.
C RS AS C RS AS
| [-- Resource Request --->] | | | [-- Resource Request --->] | |
| | | | | |
| [<----- AS Information --] | | | [<----- AS Information --] | |
| | | | | |
| ----- POST /token ----------------------------> | | ----- POST /token ----------------------------> |
| | | | | |
skipping to change at page 5, line 36 skipping to change at page 5, line 39
| | | | | |
| ---- OSCORE Request -----> | | | ---- OSCORE Request -----> | |
| | | | | |
| <--- OSCORE Response ----- | | | <--- OSCORE Response ----- | |
| ... | | | ... | |
Figure 1: Protocol Overview Figure 1: Protocol Overview
3. Client-AS Communication 3. Client-AS Communication
The following subsections describe the details of the POST /token The following subsections describe the details of the POST request
request and response between client and AS. Section 3.2 of and response to the token endpoint between client and AS.
[I-D.ietf-core-object-security] defines how to derive a Security Section 3.2 of [I-D.ietf-core-object-security] defines how to derive
Context based on a shared master secret and a set of other a Security Context based on a shared master secret and a set of other
parameters, established between client and server, which the client parameters, established between client and server, which the client
receives from the AS in this exchange. The proof-of-possession key receives from the AS in this exchange. The proof-of-possession key
(pop-key) provisioned from the AS MUST be used as master secret in (pop-key) provisioned from the AS MUST be used as master secret in
OSCORE. OSCORE.
3.1. C-to-AS: POST /token 3.1. C-to-AS: POST to token endpoint
The client-to-AS request is specified in Section 5.6.1 of The client-to-AS request is specified in Section 5.6.1 of
[I-D.ietf-ace-oauth-authz]. [I-D.ietf-ace-oauth-authz].
The client MUST send this POST /token request over a secure channel The client MUST send this POST request to the token endpoint over a
that guarantees authentication, message integrity and confidentiality secure channel that guarantees authentication, message integrity and
(see Section 5). confidentiality (see Section 5).
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", "grant_type" : "client_credentials",
"client_id" : "myclient", "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 /token existing OSCORE Security Context, it MUST include in its POST request
request a req_cnf object carrying the client's identifier (that was to the token endpoint a req_cnf object carrying the client's
assigned in section Section 3.2) in the kid field. This identifier identifier (that was assigned in section Section 3.2) in the kid
can be used by the AS to determine the shared secret to construct the field. This identifier can be used by the AS to determine the shared
proof-of-possession token and therefore MUST identify a symmetric key secret to construct the proof-of-possession token and therefore MUST
that was previously generated by the AS as a shared secret for the identify a symmetric key that was previously generated by the AS as a
communication between the client and the RS. The AS MUST verify that shared secret for the communication between the client and the RS.
the received value identifies a proof-of-possession key and token The AS MUST verify that the received value identifies a proof-of-
that have previously been issued to the requesting client. If that possession key and token that have previously been issued to the
is not the case, the Client-to-AS request MUST be declined with the requesting client. If that is not the case, the Client-to-AS request
error code 'invalid_request' as defined in Section 5.6.3 of MUST be declined with the error code 'invalid_request' as defined in
[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", "grant_type" : "client_credentials",
skipping to change at page 7, line 23 skipping to change at page 7, line 23
"scope" : "write", "scope" : "write",
"req_cnf" : { "req_cnf" : {
"kid" : b64'Qg' "kid" : b64'Qg'
} }
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 /token request and that the client is After verifying the POST request to the token endpoint and that the
authorized to obtain an access token corresponding to its access client is authorized to obtain an access token corresponding to its
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 signals 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.
skipping to change at page 8, line 8 skipping to change at page 8, line 8
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 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 COSE_Key in the 'cnf' The master secret MUST be communicated as the 'ms' field in the
parameter of the access token response as defined in Section 3.2 of OSCORE_Security_Context in the 'cnf' parameter of the access token
[I-D.ietf-ace-oauth-params]. The AEAD algorithm MAY be included as response as defined in Section 3.2 of [I-D.ietf-ace-oauth-params].
the 'alg' parameter in the COSE_Key; the HKDF algorithm MAY be The OSCORE_Security_Context is a CBOR map object, defined in
included as the 'hkdf' parameter of the COSE_Key and the salt MAY be Section 3.2.1. The AEAD algorithm MAY be included as the 'alg'
included as the 'slt' parameter of the COSE_Key as defined in parameter in the OSCORE_Security_Context; the HKDF algorithm MAY be
Figure 4. included as the 'hkdf' parameter of the OSCORE_Security_Context, the
salt MAY be included as the 'salt' parameter of the
COSCORE_Security_Context and the replay window type and size MAY be
included as the 'rpl' of the OSCORE_Security_Context, as defined in
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 COSE_Key structure in [RFC8392]. If the token is a CWT, the same
defined above MUST be placed in the 'cnf' claim of this token. OSCORE_Security_Context structure defined above MUST be placed in the
'cnf' claim of this token.
The AS MUST also assign identifiers to both client and RS, which are The AS MUST also assign identifiers to both client and RS, which are
then used as Sender ID and Recipient ID in the OSCORE context as then used as Sender ID and Recipient ID in the OSCORE context as
described in section 3.1 of [I-D.ietf-core-object-security]. These described in section 3.1 of [I-D.ietf-core-object-security]. The
identifiers MUST be unique in the set of all clients and RS client identifiers MUST be unique in the set of all clients on a
identifiers for a certain AS. Moreover, these MUST be included in single RS, and RS identifiers MUST be unique in the set of all RS for
the COSE_Key as header parameters, as defined in Figure 4. any given client. Moreover, 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
| name | label | CBOR type | registry | description |
+----------+-------+--------------+------------+-------------------+
| clientId | TBD1 | bstr | | Identifies the |
| | | | | client in an |
| | | | | OSCORE context |
| | | | | using this key |
| | | | | |
| serverId | TBD2 | bstr | | Identifies the |
| | | | | server in an |
| | | | | OSCORE context |
| | | | | using this key |
| | | | | |
| hkdf | TBD3 | bstr | | Identifies the |
| | | | | KDF algorithm in |
| | | | | an OSCORE context |
| | | | | using this key |
| | | | | |
| slt | TBD4 | bstr | | Identifies the |
| | | | | master salt in |
| | | | | an OSCORE context |
| | | | | using this key |
+----------+-------+--------------+------------+-------------------+
Figure 4: Additional COSE_Key Common Parameters
Figure 5 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/cose+cbor"
Payload: Payload:
{ {
"access_token" : b64'SlAV32hkKG ... "access_token" : b64'SlAV32hkKG ...
(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" : {
"COSE_Key" : { "OSCORE_Security_Context" : {
"kty" : "Symmetric",
"alg" : "AES-CCM-16-64-128", "alg" : "AES-CCM-16-64-128",
"clientId" : b64'qA', "clientId" : b64'qA',
"serverId" : b64'Qg', "serverId" : b64'Qg',
"k" : b64'+a+Dg2jjU+eIiOFCa9lObw' "ms" : b64'+a+Dg2jjU+eIiOFCa9lObw'
} }
} }
} }
Figure 5: Example AS-to-C Access Token response with OSCORE profile. Figure 4: Example AS-to-C Access Token response with OSCORE profile.
Figure 6 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" : {
"COSE_Key" : { "OSCORE_Security_Context" : {
"kty" : "Symmetric",
"alg" : "AES-CCM-16-64-128", "alg" : "AES-CCM-16-64-128",
"clientId" : b64'Qg', "clientId" : b64'Qg',
"serverId" : b64'qA', "serverId" : b64'qA',
"k" : b64'+a+Dg2jjU+eIiOFCa9lObw' "ms" : b64'+a+Dg2jjU+eIiOFCa9lObw'
} }
} }
Figure 6: Example CWT with OSCORE parameters. Figure 5: 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 7 shows an example of such an AS response, in CBOR diagnostic Figure 6 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/cose+cbor"
Payload: Payload:
{ {
"access_token" : b64'SlAV32hkKG ... "access_token" : b64'SlAV32hkKG ...
(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 7: Example AS-to-C Access Token response with OSCORE profile, Figure 6: Example AS-to-C Access Token response with OSCORE profile,
for update of access rights. for update of access rights.
Figure 8 shows an example CWT, containing the necessary OSCORE Figure 7 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 8: Example CWT with OSCORE parameters for update of access Figure 7: Example CWT with OSCORE parameters for update of access
rights. rights.
3.2.1. OSCORE_Security_Context Object
An OSCORE_Security_Context is an object that represents part or all
of an OSCORE Security Context (Section 3.1 of
[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
common parameters that can appear in an OSCORE_Security_Context
object can be found in the IANA "OSCORE Security Context Parameters"
registry (Section Section 9.2) and is defined below. All parameters
are optional. Table 1 provides a summary of the
OSCORE_Security_Context parameters defined in this section.
+----------+-------+----------------+--------------+----------------+
| name | CBOR | CBOR type | registry | description |
| | label | | | |
+----------+-------+----------------+--------------+----------------+
| ms | 1 | bstr | | OSCORE Master |
| | | | | Secret value |
| | | | | |
| clientId | 2 | bstr | | OSCORE Sender |
| | | | | ID value of |
| | | | | the client, |
| | | | | OSCORE |
| | | | | Recipient ID |
| | | | | value of the |
| | | | | server |
| | | | | |
| serverId | 3 | bstr | | OSCORE Sender |
| | | | | ID value of |
| | | | | the server, |
| | | | | OSCORE |
| | | | | Recipient ID |
| | | | | value of the |
| | | | | client |
| | | | | |
| hkdf | 4 | bstr / int | COSE | OSCORE HKDF |
| | | | Algorithm | value |
| | | | Values | |
| | | | (HMAC-based) | |
| | | | | |
| alg | 5 | tstr / int | COSE | OSCORE AEAD |
| | | | Algorithm | Algorithm |
| | | | Values | value |
| | | | (AEAD) | |
| | | | | |
| salt | 6 | bstr | | OSCORE Master |
| | | | | Salt value |
| | | | | |
| rpl | 7 | bstr / int | | OSCORE Replay |
| | | | | Window Type |
| | | | | and Size |
+----------+-------+----------------+--------------+----------------+
Table 1: OSCORE_Security_Context Parameters
ms: This parameter identifies the OSCORE Master Secret value, which
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"
value is a Base64 encoded byte string. In CBOR, the "ms" type is
bstr, and has label 1.
clientId: This parameter identifies a client identifier as a byte
string. This identifier is used as OSCORE Sender ID in the client
and OSCORE Recipient ID in the server. For more information about
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
CBOR, the "clientID" type is bstr, and has label 2.
serverId: This parameter identifies a server identifier as a byte
string. This identifier is used as OSCORE Sender ID in the client
and OSCORE Recipient ID in the server. For more information about
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
CBOR, the "serverID" type is bstr, and has label 3.
hkdf: This parameter identifies the OSCORE HKDF Algorithm. For more
information about this field, see section 3.1 of
[I-D.ietf-core-object-security]. The values used MUST be
registered in the IANA "COSE Algorithms" registry and MUST be
HMAC-based HKDF algorithms. The value can either be the integer
or the text string value of the HMAC-based HKDF algorithm in the
"COSE Algorithms" registry. In JSON, the "hkdf" value is a case-
sensitive ASCII string or an integer. In CBOR, the "hkdf" type is
tstr or int, and has label 4.
alg: This parameter identifies the OSCORE AEAD Algorithm. For more
information about this field, see section 3.1 of
[I-D.ietf-core-object-security] The values used MUST be registered
in the IANA "COSE Algorithms" registry and MUST be AEAD
algorithms. The value can either be the integer or the text
string value of the HMAC-based HKDF algorithm in the "COSE
Algorithms" registry. In JSON, the "alg" value is a case-
sensitive ASCII string or an integer. In CBOR, the "alg" type is
tstr or int, and has label 5.
salt: This parameter identifies the OSCORE Master Salt value, which
is a byte string. For more information about this field, see
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"
type is bstr, and has label 6.
repl: This parameter is used to carry the OSCORE value, encoded as a
bstr. This parameter identifies the OSCORE Replay Window Size and
Type value, which is a byte string. For more information about
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
CBOR, the "repl" type is bstr, and has label 7.
An example of JSON OSCORE_Security_Context is given in Figure 8.
"OSCORE_Security_Context" : {
"alg" : "AES-CCM-16-64-128",
"clientId" : b64'qA',
"serverId" : b64'Qg',
"ms" : b64'+a+Dg2jjU+eIiOFCa9lObw'
}
Figure 8: Example JSON OSCORE_Security_Context object
The CDDL grammar describing the CBOR OSCORE_Security_Context object
is:
OSCORE_Security_Context = {
? 1 => bstr, ; ms
? 2 => bstr, ; clientId
? 3 => bstr, ; serverId
? 4 => tstr / int, ; hkdf
? 5 => tstr / int, ; alg
? 6 => bstr, ; salt
? 7 => bstr / tstr ; rpl
}
4. Client-RS Communication 4. Client-RS Communication
The following subsections describe the details of the POST /authz- The following subsections describe the details of the POST request
info request and response between client and RS. The client posts and response to the authz-info endpoint between client and RS. The
the token that includes the materials provisioned by the AS to the client posts the token that includes the materials provisioned by the
RS, which can then use Section 3.2 of [I-D.ietf-core-object-security] AS to the RS, which can then use Section 3.2 of
to derive a security context based on a shared master secret and a [I-D.ietf-core-object-security] to derive a security context based on
set of other parameters, established between client and server. a shared master secret and a set of other parameters, established
between client 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 /authz-info 4.1. C-to-RS: POST to authz-info endpoint
The client MUST use CoAP and the Authorization Information resource 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 as described in section 5.8.1 of [I-D.ietf-ace-oauth-authz] to
transport the token to the RS. transport the token to the RS.
The authz-info resource 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 9 shows an example of the request sent from the client to the
RS. RS.
skipping to change at page 13, line 5 skipping to change at page 14, line 36
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) 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
resource. endpoint.
Additionally, the RS MUST generate a nonce (N1) with a good amount of Additionally, the RS MUST generate a nonce (N1) with a good amount of
randomness, and include it in the payload of the 2.01 (Created) randomness, and include it in the payload of the 2.01 (Created)
response as a CBOR byte string. This profile RECOMMENDS to use a response as a CBOR byte string. This profile RECOMMENDS to use a
nonce of 64 bits. The RS MUST store this nonce as long as the access nonce of 64 bits. The RS MUST store this nonce as long as the access
token related to it is still valid. token related to it is still valid.
Note that, when using this profile, an identifier of the token (e.g., Note that, when using this profile, an identifier of the token (e.g.,
the cti for a CWT) is not transported in the payload of this request, the cti for a CWT) is not transported in the payload of this request,
as section 5.8.1 of [I-D.ietf-ace-oauth-authz] allows. as section 5.8.1 of [I-D.ietf-ace-oauth-authz] allows.
skipping to change at page 13, line 42 skipping to change at page 15, line 27
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 /authz-info request, the client MUST extract the nonce N1 from POST request to authz-info endpoint, the client MUST extract the
the CBOR byte string in the payload of the response. The client MUST nonce N1 from the CBOR byte string in the payload of the response.
generate itself a nonce (N2) with a good amount of randomness. This The client MUST generate itself a nonce (N2) with a good amount of
profile RECOMMENDS to use a nonce of 64 bits. Then, the client MUST randomness. This profile RECOMMENDS to use a nonce of 64 bits.
set the ID Context of the Security Context created to communicate Then, the client MUST set the ID Context of the Security Context
with the RS to the concatenation of N1 and N2, in this order: ID created to communicate with the RS to the concatenation of N1 and N2,
Context = N1 | N2, where | denotes byte string concatenation. The in this order: ID Context = N1 | N2, where | denotes byte string
client MUST set the Master Secret, Sender ID and Recipient ID from concatenation. The client MUST set the Master Secret, Sender ID and
the parameters received from the AS in Section 3.2. The client MUST Recipient ID from the parameters received from the AS in Section 3.2.
set the AEAD Algorithm, Master Salt, HKDF and Replay Window from the The client MUST set the AEAD Algorithm, Master Salt, HKDF and Replay
parameters received from the AS in Section 3.2, if present. In case Window from the parameters received from the AS in Section 3.2, if
these parameters are omitted, the default values are used as present. In case these parameters are omitted, the default values
described in section 3.2 of [I-D.ietf-core-object-security]. After are used as described in section 3.2 of
that, the client MUST derive the complete Security Context following [I-D.ietf-core-object-security]. After that, the client MUST derive
section 3.2.1 of [I-D.ietf-core-object-security]. From this point the complete Security Context following section 3.2.1 of
on, the client MUST use this Security Context to communicate with the [I-D.ietf-core-object-security]. From this point on, the client MUST
RS when accessing the resources as specified by the authorization use this Security Context to communicate with the RS when accessing
information. the resources as specified by the authorization information.
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 MUST
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. The client needs to make sure the RS receives the kid
context, possibly adding the kid context to later requests, until it context, possibly adding the kid context to later requests, until it
receives a valid OSCORE response from the RS using the same Security receives a valid OSCORE response from the RS using the same Security
Context. Context.
When the RS receives this first OSCORE-protected request, it MUST When the RS receives this first OSCORE-protected request, it MUST
skipping to change at page 15, line 29 skipping to change at page 17, line 11
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
MUST reject the request with a 4.03 (Forbidden). If RS has an access MUST reject the request with a 4.03 (Forbidden). If RS has an access
token for the client but it does not cover the action that was token for the client but it does not cover the action that was
requested on the resource, RS MUST reject the request with a 4.05 requested on the resource, RS MUST reject the request with a 4.05
(Method Not Allowed). (Method Not Allowed).
5. Secure Communication with AS 5. Secure Communication with AS
As specified in the ACE framework (section 5.7 of As specified in the ACE framework (section 5.7 of
[I-D.ietf-ace-oauth-authz]), the requesting entity (RS and/or client) [I-D.ietf-ace-oauth-authz]), the requesting entity (RS and/or client)
and the AS communicates via the introspection or token resource. The and the AS communicates via the introspection or token endpoint. The
use of CoAP and OSCORE for this communication is RECOMMENDED in this use of CoAP and OSCORE for this communication is RECOMMENDED in this
profile, other protocols (such as HTTP and DTLS or TLS) MAY be used profile, other protocols (such as HTTP and DTLS or TLS) MAY be used
instead. instead.
If OSCORE is used, the requesting entity and the AS are expected to If OSCORE is used, the requesting entity and the AS are expected to
have pre-established security contexts in place. How these security have pre-established security contexts in place. How these security
contexts are established is out of scope for this profile. contexts are established is out of scope for this profile.
Furthermore the requesting entity and the AS communicate using OSCORE Furthermore the requesting entity and the AS communicate using OSCORE
([I-D.ietf-core-object-security]) through the introspection resource ([I-D.ietf-core-object-security]) through the introspection endpoint
as specified in section 5.7 of [I-D.ietf-ace-oauth-authz] and through as specified in section 5.7 of [I-D.ietf-ace-oauth-authz] and through
the token resource as specified in section 5.6 of the token endpoint as specified in section 5.6 of
[I-D.ietf-ace-oauth-authz]. [I-D.ietf-ace-oauth-authz].
6. Security Considerations 6. Discarding the Security Context
There are a number of scenarios where a client or RS needs to discard
the OSCORE security context, and acquire a new one.
The client MUST discard the current security context associated with
an RS when:
o the Sequence Number space ends.
o the access token associated with the context expires.
o the client receives a number of 4.01 Unauthorized responses to
OSCORE requests using the same security context. The exact number
needs to be specified by the application.
o the client receives a new nonce in the 2.01 Created response (see
Section 4.2) to a POST request to the authz-info endpoint, when
re-posting a non-expired token associated to the existing context.
The RS MUST discard the current security context associated with a
client when:
o Sequence Number space ends.
o Access token associated with the context expires.
7. Security Considerations
This document specifies a profile for the Authentication and This document specifies a profile for the Authentication and
Authorization for Constrained Environments (ACE) framework Authorization for Constrained Environments (ACE) framework
[I-D.ietf-ace-oauth-authz]. Thus the general security considerations [I-D.ietf-ace-oauth-authz]. Thus the general security considerations
from the framework also apply to this profile. from the framework also apply to this profile.
Furthermore the general security considerations of OSCORE Furthermore the general security considerations of OSCORE
[I-D.ietf-core-object-security] also apply to this specific use of [I-D.ietf-core-object-security] also apply to this specific use of
the OSCORE protocol. the OSCORE protocol.
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.
The use of nonces during the OSCORE Setup Section 4.3 prevents the Since the use of nonces in the exchange guarantees uniqueness of AEAD
reuse of AEAD nonces in the RS Security Context, in case the RS loses keys and nonces even in case of re-boots, a good amount of randomness
the Security Context associated with a client (e.g. in case of is required. If that is not guaranteed, nodes are still susceptible
unplanned reboot) and receives a replayed access token. In fact, by to re-using nonces and keys, in case the Security Context is lost,
using random nonces as ID Context, the POST /auth-info request and on-path attacker replaying messages.
results in a different Security Context, since Master Secret, 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
good amount of randomness. Moreover, the client echoes the nonce
created by the RS, which verifies it before deriving the Security
Context, and this protects against an adversary acting as a Man-in-
the-Middle and substituting the nonce in transit from client to RS to
provoke the creation of different Security Contexts in the client and
RS.
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.
7. Privacy Considerations 8. Privacy Considerations
This document specifies a profile for the Authentication and This document specifies a profile for the Authentication and
Authorization for Constrained Environments (ACE) framework Authorization for Constrained Environments (ACE) framework
[I-D.ietf-ace-oauth-authz]. Thus the general privacy considerations [I-D.ietf-ace-oauth-authz]. Thus the general privacy considerations
from the framework also apply to this profile. from the framework also apply to this profile.
As this document uses OSCORE, thus the privacy considerations from As this document uses OSCORE, thus the privacy considerations from
[I-D.ietf-core-object-security] apply here as well. [I-D.ietf-core-object-security] apply here as well.
An unprotected response to an unauthorized request may disclose An unprotected response to an unauthorized request may disclose
information about the resource server and/or its existing information about the resource server and/or its existing
relationship with the client. It is advisable to include as little relationship with the client. It is advisable to include as little
information as possible in an unencrypted response. When an OSCORE information as possible in an unencrypted response. When an OSCORE
Security Context already exists between the client and the resource Security Context already exists between the client and the resource
server, more detailed information may be included. server, more detailed information may be included.
Note that some information might still leak after OSCORE is Note that some information might still leak after OSCORE is
established, due to observable message sizes, the source, and the established, due to observable message sizes, the source, and the
destination addresses. destination addresses.
8. IANA Considerations 9. IANA Considerations
Note to RFC Editor: Please replace all occurrences of "[[this Note to RFC Editor: Please replace all occurrences of "[[this
specification]]" with the RFC number of this specification and delete specification]]" with the RFC number of this specification and delete
this paragraph. this paragraph.
9.1. ACE OAuth Profile Registry
The following registration is done for the ACE OAuth Profile Registry The following registration is done for the ACE OAuth Profile Registry
following the procedure specified in section 8.7 of following the procedure specified in section 8.7 of
[I-D.ietf-ace-oauth-authz]: [I-D.ietf-ace-oauth-authz]:
o Profile name: coap_oscore o Profile name: coap_oscore
o Profile Description: Profile for using OSCORE to secure o Profile Description: Profile for using OSCORE to secure
communication between constrained nodes using the Authentication communication between constrained nodes using the Authentication
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]]
The following registrations are done for the COSE Key Common 9.2. OSCORE Security Context Parameters Registry
Parameter Registry specified in section 16.5 of [RFC8152]:
o Name: clientId It is requested that IANA create a new registry entitled "OSCORE
o Label: TBD1 (value between 1 and 255) Security Context Parameters" registry. The registry is to be created
o CBOR Type: bstr as Expert Review Required. Guidelines for the experts is provided
o Value Registry: N/A Section 9.5. It should be noted that in additional to the expert
o Description: Identifies the client in an OSCORE context review, some portions of the registry require a specification,
o Reference: [[this specification]] potentially on standards track, be supplied as well.
o Name: serverId The columns of the registry are:
o Label: TBD2 (value between 1 and 255)
o Value Type: bstr
o Value Registry: N/A
o Description: Identifies the server in an OSCORE context
o Reference: [[this specification]]
o Name: hkdf name This is a descriptive name that enables easier reference to the
o Label: TBD3 (value between 1 and 255) item. It is not used in the CBOR encoding.
o Value Type: bstr CBOR label The value to be used to identify this algorithm. Key map
o Value Registry: COSE Algorithms registry labels MUST be unique. The label can be a positive integer, a
o Description: Identifies the KDF algorithm to be used in an OSCORE negative integer or a string. Integer values between 0 and 255
context and strings of length 1 are designated as Standards Track Document
required. Integer values from 256 to 65535 and strings of length
2 are designated as Specification Required. Integer values of
greater than 65535 and strings of length greater than 2 are
designated as expert review. Integer values less than -65536 are
marked as private use.
CBOR Type This field contains the CBOR type for the field.
registry This field denotes the registry that values may come from,
if one exists.
description This field contains a brief description for the field.
specification This contains a pointer to the public specification
for the field if one exists
o Reference: [[this specification]] This registry will be initially populated by the values in Table 1.
The specification column for all of these entries will be this
document.
o Name: slt 9.3. CWT Confirmation Methods Registry
o Label: TBD4 (value between 1 and 255)
o Value Type: bstr
o Value Registry: N/A
o Description: Identifies the master salt of to be used in an OSCORE
context
o Reference: [[this specification]]
9. References The following registration is done for the CWT Confirmation Methods
Registry following the procedure specified in section 7.2.1 of
[I-D.ietf-ace-cwt-proof-of-possession]:
9.1. Normative References o Confirmation Method Name: "OSCORE_Security_Context"
o Confirmation Method Description: OSCORE_Security_Context carrying
the OSCORE Security Context parameters
o Confirmation Key: TBD (value between 4 and 255)
o Confirmation Value Type(s): map
o Change Controller: IESG
o Specification Document(s): Section 3.2.1 of [[this specification]]
9.4. JWT Confirmation Methods Registry
The following registration is done for the JWT Confirmation Methods
Registry following the procedure specified in section 6.2.1 of
[RFC7800]:
o Confirmation Method Value: "osc"
o Confirmation Method Description: OSCORE_Security_Context carrying
the OSCORE Security Context parameters
o Change Controller: IESG
o Specification Document(s): Section 3.2.1 of [[this specification]]
9.5. Expert Review Instructions
The IANA registry established in this document is defined as expert
review. This section gives some general guidelines for what the
experts should be looking for, but they are being designated as
experts for a reason so they should be given substantial latitude.
Expert reviewers should take into consideration the following points:
o Point squatting should be discouraged. Reviewers are encouraged
to get sufficient information for registration requests to ensure
that the usage is not going to duplicate one that is already
registered and that the point is likely to be used in deployments.
The zones tagged as private use are intended for testing purposes
and closed environments, code points in other ranges should not be
assigned for testing.
o Specifications are required for the standards track range of point
assignment. Specifications should exist for specification
required ranges, but early assignment before a specification is
available is considered to be permissible. Specifications are
needed for the first-come, first-serve range if they are expected
to be used outside of closed environments in an interoperable way.
When specifications are not provided, the description provided
needs to have sufficient information to identify what the point is
being used for.
o Experts should take into account the expected usage of fields when
approving point assignment. The fact that there is a range for
standards track documents does not mean that a standards track
document cannot have points assigned outside of that range. The
length of the encoded value should be weighed against how many
code points of that length are left, the size of device it will be
used on, and the number of code points left that encode to that
size.
10. 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-15 Framework (ACE-OAuth)", draft-ietf-ace-oauth-authz-16
(work in progress), September 2018. (work in progress), October 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-00 (work in progress), September 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
skipping to change at page 19, line 9 skipping to change at page 22, line 23
<https://www.rfc-editor.org/info/rfc7252>. <https://www.rfc-editor.org/info/rfc7252>.
[RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)", [RFC8152] Schaad, J., "CBOR Object Signing and Encryption (COSE)",
RFC 8152, DOI 10.17487/RFC8152, July 2017, RFC 8152, DOI 10.17487/RFC8152, July 2017,
<https://www.rfc-editor.org/info/rfc8152>. <https://www.rfc-editor.org/info/rfc8152>.
[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>.
9.2. Informative References 10.2. Informative References
[I-D.gerdes-ace-dcaf-authorize]
Gerdes, S., Bergmann, O., and C. Bormann, "Delegated CoAP
Authentication and Authorization Framework (DCAF)", draft-
gerdes-ace-dcaf-authorize-04 (work in progress), October
2015.
[I-D.selander-ace-cose-ecdhe] [I-D.ietf-ace-cwt-proof-of-possession]
Selander, G., Mattsson, J., and F. Palombini, "Ephemeral Jones, M., Seitz, L., Selander, G., Erdtman, S., and H.
Diffie-Hellman Over COSE (EDHOC)", draft-selander-ace- Tschofenig, "Proof-of-Possession Key Semantics for CBOR
cose-ecdhe-10 (work in progress), September 2018. Web Tokens (CWTs)", draft-ietf-ace-cwt-proof-of-
possession-04 (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>.
[RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object
Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
October 2013, <https://www.rfc-editor.org/info/rfc7049>.
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231, Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014, DOI 10.17487/RFC7231, June 2014,
<https://www.rfc-editor.org/info/rfc7231>. <https://www.rfc-editor.org/info/rfc7231>.
[RFC7800] Jones, M., Bradley, J., and H. Tschofenig, "Proof-of-
Possession Key Semantics for JSON Web Tokens (JWTs)",
RFC 7800, DOI 10.17487/RFC7800, April 2016,
<https://www.rfc-editor.org/info/rfc7800>.
Appendix A. Profile Requirements Appendix A. Profile Requirements
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
skipping to change at page 20, line 12 skipping to change at page 23, line 26
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/cose+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
o (Optional)other methods of token transport than the /authz-info o (Optional)other methods of token transport than the authz-info
endpoint: no endpoint: no
Appendix B. Using the pop-key with EDHOC (EDHOC+OSCORE)
EDHOC specifies an authenticated Diffie-Hellman protocol that allows
two parties to use CBOR [RFC7049] and COSE in order to establish a
shared secret key with perfect forward secrecy. The use of Ephemeral
Diffie-Hellman Over COSE (EDHOC) [I-D.selander-ace-cose-ecdhe] in
this profile in addition to OSCORE, provides perfect forward secrecy
(PFS) and the initial proof-of-possession, which ties the proof-of-
possession key to an OSCORE security context.
If EDHOC is used together with OSCORE, and the pop-key (symmetric or
asymmetric) is used to authenticate the messages in EDHOC, then the
AS MUST provision the following data, in response to the access token
request:
o a symmetric or public key (associated to the RS)
o a key identifier;
How these parameters are communicated depends on the type of key
(asymmetric or symmetric). Moreover, the AS MUST signal the use of
OSCORE + EDHOC with the 'profile' parameter set to
"coap_oscore_edhoc".
Note that in the case described in this section, the 'expires_in'
parameter, defined in Section 4.2.2. of [RFC6749] defines the
lifetime in seconds of both the access token and the shared secret.
After expiration, C MUST acquire a new access token from the AS, and
run EDHOC again, as specified in this section
B.1. Using Asymmetric Keys
In case of an asymmetric key, C MUST communicate its own asymmetric
key to the AS in the 'req_cnf' parameter of the access token request,
as specified in Section 3.1 of [I-D.ietf-ace-oauth-params]; the AS
MUST communicate the RS's public key to C in the response, in the
'rs_cnf' parameter, as specified in Section 3.2 of
[I-D.ietf-ace-oauth-params]. Note that the RS's public key MUST
include a 'kid' parameter, and that the value of the 'kid' MUST be
included in the access token, to let the RS know which of its public
keys C used. If the access token is a CWT [RFC8392], the key
identifier MUST be placed directly in the 'cnf' structure (if the key
is only referenced).
Figure 3 shows an example of such a request in CBOR diagnostic
notation without tag and value abbreviations.
Header: POST (Code=0.02)
Uri-Host: "server.example.com"
Uri-Path: "token"
Content-Type: "application/cose+cbor"
Payload:
{
"grant_type" : "client_credentials",
"req_cnf" : {
"COSE_Key" : {
"kid" : "client_key"
"kty" : "EC",
"crv" : "P-256",
"x" : b64'usWxHK2PmfnHKwXPS54m0kTcGJ90UiglWiGahtagnv8',
"y" : b64'IBOL+C3BttVivg+lSreASjpkttcsz+1rb7btKLv8EX4'
}
}
}
Figure 3: Example access token request (OSCORE+EDHOC, asymmetric).
Figure 4 shows an example of a corresponding response in CBOR
diagnostic notation without tag and value abbreviations.
Header: Created (Code=2.01)
Content-Type: "application/cose+cbor"
Payload:
{
"access_token" : b64'SlAV32hkKG ...
(contains "kid" : "client_key")',
"profile" : "coap_oscore_edhoc",
"expires_in" : "3600",
"cnf" : {
"COSE_Key" : {
"kid" : "server_key"
"kty" : "EC",
"crv" : "P-256",
"x" : b64'cGJ90UiglWiGahtagnv8usWxHK2PmfnHKwXPS54m0kT',
"y" : b64'reASjpkttcsz+1rb7btKLv8EX4IBOL+C3BttVivg+lS'
}
}
}
Figure 4: Example AS response (EDHOC+OSCORE, asymmetric).
B.2. Using Symmetric Keys
In the case of a symmetric key, the AS MUST communicate the key to
the client in the 'cnf' parameter of the access token response, as
specified in Section 3.2. of [I-D.ietf-ace-oauth-params]. The AS
MUST also select a key identifier, that MUST be included as the 'kid'
parameter of the COSE_key, as in figure 9 of
[I-D.ietf-ace-oauth-authz].
Figure 5 shows an example of the necessary parameters in the AS
response to the access token request when EDHOC is used. The example
uses CBOR diagnostic notation without tag and value abbreviations.
Header: Created (Code=2.01)
Content-Type: "application/cose+cbor"
Payload:
{
"access_token" : b64'SlAV32hkKG ...
(remainder of access token omitted for brevity)',
"profile" : "coap_oscore_edhoc",
"expires_in" : "3600",
"cnf" : {
"COSE_Key" : {
"kty" : "Symmetric",
"kid" : b64'5tOS+h42dkw',
"k" : b64'+a+Dg2jjU+eIiOFCa9lObw'
}
}
}
Figure 5: Example AS response (EDHOC+OSCORE, symmetric).
In both cases, the AS MUST also include the same key identifier as
'kid' parameter in the access token metadata. If the access token is
a CWT [RFC8392], the key identifier MUST be placed inside the 'cnf'
claim as 'kid' parameter of the COSE_Key or directly in the 'cnf'
structure (if the key is only referenced).
Figure 6 shows an example CWT containing the necessary EDHOC+OSCORE
parameters in the 'cnf' claim, in CBOR diagnostic notation without
tag and value abbreviations.
{
"aud" : "tempSensorInLivingRoom",
"iat" : "1360189224",
"exp" : "1360289224",
"scope" : "temperature_g firmware_p",
"cnf" : {
"COSE_Key" : {
"kty" : "Symmetric",
"kid" : b64'5tOS+h42dkw',
"k" : b64'+a+Dg2jjU+eIiOFCa9lObw'
}
}
Figure 6: Example CWT with EDHOC+OSCORE, symmetric case.
All other parameters defining OSCORE security context are derived
from EDHOC message exchange, including the master secret (see
Appendix D.2 of [I-D.selander-ace-cose-ecdhe]).
B.3. Processing
To provide forward secrecy and mutual authentication in the case of
pre-shared keys, pre-established raw public keys or with X.509
certificates it is RECOMMENDED to use EDHOC
[I-D.selander-ace-cose-ecdhe] to generate the keying material. EDHOC
MUST be used as defined in Appendix D of
[I-D.selander-ace-cose-ecdhe], with the following additions and
modifications.
The first EDHOC message is sent after the access token is posted to
the /authz-info resource of the RS as specified in Section 5.8.1 of
[I-D.ietf-ace-oauth-authz]. Then the EDHOC message_1 is sent and the
EDHOC protocol is initiated [I-D.selander-ace-cose-ecdhe]).
Before the RS continues with the EDHOC protocol and responds to this
token submission request, additional verifications on the access
token are done: the RS SHALL process the access token according to
[I-D.ietf-ace-oauth-authz]. If the token is valid then the RS
continues processing EDHOC following Appendix D of
[I-D.selander-ace-cose-ecdhe], otherwise it discontinues EDHOC and
responds with the error code as specified in
[I-D.ietf-ace-oauth-authz].
o In case the EDHOC verification fails, the RS MUST return an error
response to the client with code 4.01 (Unauthorized).
o If RS has an access token for C but not for the resource that C
has requested, RS MUST reject the request with a 4.03 (Forbidden).
o If RS has an access token for C but it does not cover the action C
requested on the resource, RS MUST reject the request with a 4.05
(Method Not Allowed).
o If all verifications above succeeds, further communication between
client and RS is protected with OSCORE, including the RS response
to the OSCORE request.
In the case of EDHOC being used with symmetric keys, the protocol in
Section 5 of [I-D.selander-ace-cose-ecdhe] MUST be used. If the key
is asymmetric, the RS MUST also use an asymmetric key for
authentication. This key is known to the client through the access
token response (see Section 5.6.2 of [I-D.ietf-ace-oauth-authz]). In
this case the protocol in Section 4 of [I-D.selander-ace-cose-ecdhe]
MUST be used.
Figure 7 illustrates the message exchanges for using OSCORE+EDHOC
(step C in figure 1 of [I-D.ietf-ace-oauth-authz]).
Resource
Client Server
| |
| |
+--------->| Header: POST (Code=0.02)
| POST | Uri-Path:"authz-info"
| | Content-Type: application/cbor
| | Payload: access token
| |
| |
+--------->| Header: POST (Code=0.02)
| POST | Uri-Path: "/.well-known/edhoc"
| | Content-Type: application/edhoc
| | Payload: EDHOC message_1
| |
|<---------+ Header: 2.04 Changed
| 2.04 | Content-Type: application/edhoc
| | Payload: EDHOC message_2
| |
+--------->| Header: POST (Code=0.02)
| POST | Uri-Path: "/.well-known/edhoc"
| | Content-Type: application/edhoc
| | Payload: EDHOC message_3
| |
|<---------+ Header: 2.04 Changed
| 2.04 |
| |
start of protected communication
| |
+--------->| CoAP request +
| OSCORE | Object-Security option
| request |
| |
|<---------+ CoAP response +
| OSCORE | Object-Security option
| response |
| |
Figure 7: Access token and key establishment with EDHOC
Acknowledgments Acknowledgments
The authors wish to thank Jim Schaad and Marco Tiloca for the input The authors wish to thank Jim Schaad and Marco Tiloca for the input
on this memo. on this memo.
Authors' Addresses Authors' Addresses
Francesca Palombini Francesca Palombini
Ericsson AB Ericsson AB
 End of changes. 60 change blocks. 
435 lines changed or deleted 408 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/