Internet-Draft | CoAP Transfer for the CMP | October 2021 |
Sahni & Tripathi | Expires 4 April 2022 | [Page] |
This document specifies the use of Constrained Application Protocol (CoAP) as a transfer mechanism for the Certificate Management Protocol (CMP). purpose of certificate creation and management. CoAP is an HTTP like client-server protocol used by various constrained devices in the IoT space.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 4 April 2022.¶
Copyright (c) 2021 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.¶
The Certificate Management Protocol (CMP) [RFC4210] is used by the PKI entities for the generation and management of certificates. One of the requirements of Certificate Management Protocol is to be independent of the transport protocol in use. CMP has mechanisms to take care of required transactions, error reporting and protection of messages. The Constrained Application Protocol (CoAP) defined in [RFC7252], [RFC7959] and [RFC8323] is a client-server protocol like HTTP. It is designed to be used by constrained devices over constrained networks. The recommended transport for CoAP is UDP, however [RFC8323] specifies the support of CoAP over TCP, TLS and Websockets.¶
This document specifies the use of CoAP over UDP as a transport medium for the CMP version 2 [RFC4210], CMP version 3 [I-D.ietf-lamps-cmp-updates] designated as CMP in this document and Lightweight CMP Profile [I-D.ietf-lamps-lightweight-cmp-profile]. This document, in general, follows the HTTP transfer for CMP specifications defined in [RFC6712] and specifies the requirements for using CoAP as a transfer mechanism for the CMP.¶
This document also provides guidance on how to use a "CoAP-to-HTTP" proxy to ease adoption of CoAP transfer mechanism by enabling the interconnection with existing PKI entities already providing CMP over HTTP.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY",and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
A CMP transaction consists of exchanging PKIMessages [RFC4210] between PKI End Entities (EEs), Registration Authorities (RAs), and Certification Authorities (CAs). If the EEs are constrained devices then they may prefer, as a CMP client, the use of CoAP instead of HTTP as the transfer mechanism. The RAs and CAs, in general, are not constrained and can support both CoAP and HTTP Client and Server implementations. This section specifies how to use CoAP as the transfer mechanism for the Certificate Management Protocol.¶
The CoAP URI format is described in section 6 of [RFC7252]. The CoAP endpoints MUST support use of the path prefix "/.well-known/" as defined in [RFC8615] and the registered name "cmp" to help with endpoint discovery and interoperability. Optional path segments MAY be added after the registered application name (i.e. after "/.well-known/cmp") to provide distinction to support multiple PKI entities on the same endpoint. A valid full operation path segment can look like this:¶
coap://www.example.com/.well-known/cmp coap://www.example.com/.well-known/cmp/operationalLabel coap://www.example.com/.well-known/cmp/profileLabel coap://www.example.com/.well-known/cmp/profileLabel/operationalLabel¶
Here operationalLabel may represent different CAs or Certificate profiles or supported End Entity types and profileLabel may represent different set of supported PKI operations on that particular path.¶
The EEs can be configured with enough information to form the CMP server URI. The minimum information that can be configured is the scheme i.e. "coap://" or "coaps://" and the authority portion of the URI, e.g. "example.com:5683". If the port number is not specified in the authority, then port 5683 MUST be assumed for the "coap://" scheme and port 5684 MUST be assumed for the "coaps://" scheme. Optionally, in the environments where a Local Registration Authority (LRA) or a Local CA is deployed, EEs can also use the CoAP service discovery mechanism [RFC7252] to discover the URI of the Local RA or CA. The CoAP CMP endpoints supporting service discovery MUST also support resource discovery in the CoRE Link Format as described in [RFC6690]. The Link MUST include the 'ct' attribute defined in section 7.2.1 of [RFC7252] with the value of "application/pkixcmp" as defined in the CoAP Content-Formats IANA registry.¶
The CMP PKIMessages MUST be DER encoded and sent as the body of the CoAP POST request. A CMP client SHOULD send CoAP requests marked as Confirmable message ([RFC7252] section 2.1). If the CoAP request is successful then the server MUST return a "2.05 Content" response code. If the CoAP request is not successful then an appropriate CoAP Client Error 4.xx or a Server Error 5.xx response code MUST be returned. A CMP RA or CA may chose to send a Piggybacked response ([RFC7252] section 5.2.1) to the client or it MAY send a Separate response ([RFC7252] section 5.2.2) in case it takes some time for CA RA to process the CMP transaction.¶
When transferring CMP PKIMesssage over CoAP the media type "application/pkixcmp" MUST be used.¶
A CMP PKIMesssage consists of a header, body, protection, and extraCerts structures. These structures may contain many optional and potentially large fields, a CMP message can be much larger than the Maximum Transmission Unit (MTU) of the outgoing interface of the device. In order to avoid IP fragmentation of messages exchanged between EEs and RAs or CAs, the Block-Wise transfer [RFC7959] mode MUST be used for the CMP Transactions over CoAP. If a CoAP-to-HTTP proxy is in the path between EEs and CA or EEs and RA then it MUST receive the entire body from the client before sending the HTTP request to the server. This will avoid unnecessary errors in case the entire content of the PKIMesssage is not received and the proxy opens a connection with the server.¶
CMP PKIMessages sent over CoAP MUST NOT use a Multicast destination address.¶
A CMP server may publish announcements, that can be event triggered or periodic, for the other PKI entities. Here is the list of CMP announcement messages prefixed by their respective ASN.1 identifier (section 5.1.2 [RFC4210])¶
[15] CA Key Update Announcement [16] Certificate Announcement [17] Revocation Announcement [18] CRL Announcement¶
As there are no request messages specified for these announcement messages, an EE MAY use CoAP Observe option [RFC7641] in the Get request to the CMP server's URI followed by "/ann" to register itself for any Announcements messages. If the server supports CMP Announcements messages, then it can respond with response code 2.03 "Valid", otherwise with response code 4.04 "Not Found". If for some reason server cannot add the client to its list of observers for the announcements, it can omit the Observe option [RFC7641] in the 2.03 response to the client. A client on receiving 2.03 response without Observe option [RFC7641] can try after some time to register again for announcements from the CMP server.¶
Alternatively an EE MAY poll for the potential changes via "PKI Information" request using "PKI General Message" defined in the PKIMessage [RFC4210] for various type of changes like CA key update or to get current CRL [RFC5280] to check revocation or using Support messages defined in section 5.4 of Lightweight CMP Profile [I-D.ietf-lamps-lightweight-cmp-profile] . This will help constrained devices that are acting as EEs conserve resources by eliminating the need to create an endpoint for receiving notifications from RA or CA. It will also simplify the implementation of CoAP-to-HTTP proxy.¶
Although CMP protocol does not depend upon the underlying transfer mechanism for protecting the messages but in cases when an end to end secrecy is desired for the CoAP, CoAP over DTLS [I-D.ietf-tls-dtls13] SHOULD be used. Section 9.1 of [RFC7252] defines how to use DTLS [I-D.ietf-tls-dtls13] for securing the CoAP. Once a DTLS [I-D.ietf-tls-dtls13] connection is established it SHOULD be used for as long as possible to avoid the frequent overhead of setting up a DTLS [I-D.ietf-tls-dtls13] connection for constrained devices.¶
This section provides guidance on using a CoAP-to-HTTP proxy between EEs and RAs or CAs in order to avoid changes to the existing PKI implementation. Since the CMP payload is same over CoAP and HTTP transfer mechanisms, a CoAP-to-HTTP cross-protocol proxy can be implemented based on section 10 of [RFC7252] . The CoAP-to-HTTP proxy can be either located closer to the EEs or closer to the RA or CA. In case the proxy is deployed closer to the EEs then it may also support service discovery and resource discovery as described in section 2.2. The CoAP-to-HTTP proxy MUST function as a reverse proxy, only permitting connections to a limited set of pre-configured servers. It is out of scope of this document on how a reverse proxy can route CoAP client requests to one of the configured servers. Some recommended mechanisms are as follows:¶
The CMP protocol depends upon various mechanisms in the protocol itself for making the transactions secure therefore security issues of CoAP due to using UDP do not carry over to the CMP layer. However the CoAP is vulnerable to many issues due to the connectionless characteristics of UDP itself. The Security considerations for CoAP are mentioned in the [RFC7252] .¶
In order to to reduce the risks imposed by DoS attacks, the implementations SHOULD minimize fragmentation of messages, i.e. avoid small packets containing partial CMP PKIMessage data.¶
A CoAP-to-HTTP proxy can also protect the PKI entities from various attacks by enforcing basic checks and validating messages before sending them to PKI entities. Proxy can be deployed at the edge of End Entities" network or in front of an RA and CA to protect them.¶
This document requires a new entry to the CoAP Content-Formats Registry code for the content-type "application/pkixcmp" for transfering CMP transactions over CoAP.¶
Type name: application¶
Subtype name: pkixcmp¶
The authors would like to thank Hendrik Brockhaus, David von Oheimb, and Andreas Kretschmer for their guidance in writing the content of this document and providing valuable feedback.¶