RFC 9482
Constrained Application Protocol (CoAP) Transfer for the Certificate Management Protocol
๐ RFC 9482: Constrained Application Protocol (CoAP) Transfer for the Certificate Management Protocol ๐
okay bestie, settle in because this one is a whole vibe ๐ โจ
Here's the title block tea โ: this doc is RFC 9482, published in November 2023 as a Standards Track document, which means it's the real deal and not just a suggestion ๐. The editors are M. Sahni and S. Tripathi (both listed as "Ed.", so they're the editors who pulled it all together) ๐ซถ, and they're from Palo Alto Networks. It's part of the ISSN: 2070-1721 series. It doesn't say it obsoletes or updates anything, so it's standing on its own ๐ฆ.
Also, the title is giving "CoAP meets CMP," and I am here for the crossover ๐ง๐
Abstract
So the big idea is that this doc explains how to use CoAP (the Constrained Application Protocol) as a transfer mechanism for CMP (the Certificate Management Protocol) ๐ฅ. CMP is how different PKI entities talk to each other to create and manage certificates ๐. CoAP is basically HTTP's cute, lightweight cousin that constrained IoT devices use ๐ธ. The whole point is getting these two to work together, no cap โจ.
Status of This Memo
Okay so this is an Internet Standards Track document ๐. It's a product of the IETF and has the consensus of the IETF community, plus it got public review and was approved by the IESG ๐. If you want more info on Internet Standards, check Section 2 of RFC 7841 ๐ฆ. The current status, errata, and feedback stuff lives at https://www.rfc-editor.org/info/rfc9482 ๐.
Copyright Notice
Copyright (c) 2023 IETF Trust and the document authors, all rights reserved ๐ . This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they stood on the publication date ๐. Read those carefully, because they spell out your rights and restrictions ๐. If you pull Code Components out of this document, they have to include the Revised BSD License text described in Section 4.e of the Trust Legal Provisions, and they come with no warranty as described in that license ๐ซถ.
Table of Contents
1. Introduction
1.1. Requirements Language
2. CoAP Transfer Mechanism for CMP
2.1. CoAP URI Format
2.2. Discovery of CMP RA/CA
2.3. CoAP Request Format
2.4. CoAP Block-Wise Transfer Mode
2.5. Multicast CoAP
2.6. Announcement PKIMessage
3. Proxy Support
4. Security Considerations
5. IANA Considerations
6. References
6.1. Normative References
6.2. Informative References
Acknowledgements
Authors' Addresses
1. Introduction โจ
CMP ([RFC4210]) is what PKI entities use to generate and manage certificates ๐. One of its big requirements is that it doesn't care which transport protocol you use ๐ฆ. It also has built-in mechanisms for handling required transactions, error reporting, and protecting messages ๐.
CoAP is defined in [RFC7252], [RFC7959], and [RFC8323] ๐ธ. It's a client-server protocol, kinda like HTTP, and it's designed for constrained devices running on constrained networks ๐ง. The recommended transport for CoAP is UDP ๐ , but [RFC8323] also covers CoAP over TCP, TLS, and WebSockets ๐.
This document is about using CoAP over UDP as the transport for CMP version 2 [RFC4210], CMP version 3 [RFC9480] (which is just "CMP" in this doc ๐), and the Lightweight CMP Profile [RFC9483] โจ. Generally, it follows the HTTP transfer for CMP specs in [RFC6712] and lays out the requirements for using CoAP as the CMP transfer mechanism ๐.
It also gives guidance on using a "CoAP-to-HTTP" proxy ๐ฆ. This helps folks adopt CoAP without ditching the PKI entities that already speak CMP over HTTP, since the proxy connects the two worlds ๐ซถ.
1.1. Requirements Language
Okay, this part is super important ๐. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" get interpreted as described in BCP 14 [RFC2119] [RFC8174], but only when they show up in ALL CAPS like this ๐ . Anything lowercase is just regular English ๐.
2. CoAP Transfer Mechanism for CMP ๐ธ
A CMP transaction is basically a bunch of PKIMessages [RFC4210] getting swapped between PKI end entities (EEs), registration authorities (RAs), and certification authorities (CAs) ๐ฅ. If the EEs are constrained devices, they may prefer to use CoAP instead of HTTP as the transfer mechanism when they act as a CMP client ๐ง. Generally, RAs and CAs aren't constrained, so they can handle both CoAP and HTTP, as client or server ๐. This section explains how to use CoAP for CMP ๐.
2.1. CoAP URI Format โจ
The CoAP URI format is in Section 6 of [RFC7252] ๐ฆ. CoAP endpoints MUST support the path prefix "/.well-known/" from [RFC8615] along with the registered name "cmp" ๐. That helps with endpoint discovery and interoperability ๐ซถ. You MAY add optional path segments after the registered application name (so, after "/.well-known/cmp") to tell things apart ๐. For example, the path segment 'p' followed by an arbitraryLabel <name> could help tell specific CAs or certificate profiles apart ๐ . More path segments, like the ones in the Lightweight CMP Profile [RFC9483], can name PKI management operations using an operationLabel <operation> ๐ง. Here's what a valid full CMP URI can look like ๐:
coap://www.example.com/.well-known/cmp
coap://www.example.com/.well-known/cmp/<operation>
coap://www.example.com/.well-known/cmp/p/<profileLabel>
coap://www.example.com/.well-known/cmp/p/<profileLabel>/<operation>
2.2. Discovery of CMP RA/CA ๐
EEs can be set up with enough info to build the CMP server URI ๐. The bare minimum is the scheme, which is "coap:" or "coaps:", plus the authority part, like "example.com:5683" ๐. If the port isn't in the authority, the default port numbers MUST be assumed for "coap:" and "coaps:" URIs ๐ฆ. The default port for "coap:" is 5683, and for "coaps:" it's 5684 [RFC7252] ๐ธ.
Optionally, if a Local RA or CA is deployed, EEs can use the CoAP service discovery mechanism [RFC7252] to find the URI of that Local RA or CA ๐ง. CoAP CMP endpoints that support service discovery MUST also support resource discovery in the Constrained RESTful Environments (CoRE) Link Format, as described in [RFC6690] ๐ . The link MUST include the 'ct' attribute from Section 7.2.1 of [RFC7252], with the value "application/pkixcmp", as defined in the "CoAP Content-Formats" IANA registry ๐ซถ.
2.3. CoAP Request Format ๐ฎ
CMP PKIMessages MUST be DER encoded and sent as the body of a CoAP POST request ๐. A CMP client MUST send each CoAP request as a Confirmable message [RFC7252] ๐ฅ. If the CoAP request works, the CMP RA or CA MUST return a Success 2.xx response code ๐. If it doesn't, the CMP RA or CA MUST return an appropriate Client Error 4.xx or Server Error 5.xx response code ๐. A CMP RA or CA MAY send a piggybacked response [RFC7252] to the client ๐ฆ. Or it MAY send a separate response [RFC7252] if it takes a while to process the CMP transaction โณ.
When you transfer a CMP PKIMessage over CoAP, the content-format "application/pkixcmp" MUST be used ๐.
2.4. CoAP Block-Wise Transfer Mode ๐งฉ
A CMP PKIMessage has a header, body, protection, and extraCerts structure, and it can include lots of optional and potentially big fields ๐. So a CMP message can end up way bigger than the MTU of the device's outgoing interface ๐ญ. The EEs, RAs, and CAs MUST use the block-wise transfer mode [RFC7959] for big messages, instead of leaning on IP fragmentation ๐ .
If a CoAP-to-HTTP proxy sits in the path between EEs and an RA, or between EEs and a CA, and the server supports it, the proxy MUST use chunked transfer encoding [RFC9112] to send data over HTTP ๐ง. The proxy MUST also try to cut down on the number of packets by picking an optimal chunk length for the HTTP transport ๐ซถ.
2.5. Multicast CoAP ๐ซ
CMP PKIMessages sent over CoAP MUST NOT use a Multicast destination address ๐ โโ๏ธ.
2.6. Announcement PKIMessage ๐ฃ
A CMP server can publish announcements, either because of an event or on a schedule, for the other PKI entities ๐. Here's the list of CMP announcement messages, each with its ASN.1 identifier (see Section 5.1.2 of [RFC4210]) ๐:
[15] CA Key Update Announcement
[16] Certificate Announcement
[17] Revocation Announcement
[18] CRL Announcement
An EE MAY use the CoAP Observe Option [RFC7641] to sign itself up for announcement messages from the RA or CA ๐ฆ. It can send a GET request to the server's URI with "/ann" added on the end ๐ธ. For example, the path to register for announcements might look like this ๐ง:
coap://www.example.com/.well-known/cmp/ann
coap://www.example.com/.well-known/cmp/p/<profileLabel>/ann
If the server supports CMP announcement messages, it MUST send an appropriate Success 2.xx response code ๐ . Otherwise, it MUST send an appropriate Client Error 4.xx or Server Error 5.xx response code ๐. If for some reason the server can't add the client to its list of observers for announcements, it MAY leave out the Observe Option [RFC7641] in the response to the client ๐ซถ. If a client gets a Success 2.xx response without the Observe Option [RFC7641], it MAY try to register for announcements from the CMP server again after some time ๐. The server can remove an EE from its observer list, so an EE SHOULD periodically re-register for announcement messages ๐.
Alternatively, an EE MAY periodically poll the CA's current status with the "PKI Information Request" message (see Section 6.5 of [RFC4210]) ๐. If it's supported, EEs MAY also use the "support messages" from Section 4.3 of the Lightweight CMP Profile [RFC9483] to get CA status info ๐. These approaches help constrained devices acting as EEs save resources, since they don't have to set up an endpoint to receive notifications from the RA or CA โจ. They also make a CoAP-to-HTTP proxy simpler to build ๐.
3. Proxy Support ๐
This section explains how to use a CoAP-to-HTTP proxy between EEs and RAs or CAs, so you don't have to change the existing PKI implementation ๐ฆ.
Since the CMP payload is the same over CoAP and HTTP, a CoAP-to-HTTP cross-protocol proxy can be built based on Section 10 of [RFC7252] ๐. The proxy can sit closer to the EEs or closer to the RA or CA ๐ซถ. The proxy MAY support service discovery and resource discovery, as described in Section 2.2 ๐ . The CoAP-to-HTTP proxy MUST work as a reverse proxy, only allowing connections to a limited set of preconfigured servers ๐. How a reverse proxy routes CoAP client requests to one of those configured servers is out of scope for this document ๐. Some recommended mechanisms are:
- Use the Uri-Path option to identify a server.
- Use separate hostnames for each configured server, then use the Uri-Host option to route CoAP requests.
- Use separate hostnames for each configured server, then use Server Name Indication [RFC8446] for the "coaps://" scheme to route CoAP requests.
Part 1 done, bestie! ๐ง More is coming, so stay tuned ๐
4. Security Considerations โจ
- okay so, if PKIProtection is used, the PKIHeader and PKIBody of the CMP are cryptographically protected against malicious modifications ๐. That means UDP can be used without compromising the security of the CMP ๐ . Security considerations for CoAP are defined in [RFC7252].
- The CMP does not provide confidentiality of the CMP payloads ๐ญ. If confidentiality is desired, CoAP over DTLS [RFC9147] SHOULD be used to provide confidentiality for the CMP payloads. Even so, it cannot conceal that the CMP is used within the DTLS layer ๐.
- Section 9.1 of [RFC7252] explains how to use DTLS [RFC9147] for securing CoAP ๐ง. DTLS [RFC9147] associations SHOULD be kept alive and reused where possible, to amortize the additional overhead of DTLS on constrained devices. Main character energy for those tiny devices ๐ซถ.
- An EE might not witness all of the announcement messages when using the CoAP Observe Option [RFC7641]. The Observe Option is a "best-effort" approach, and the server might lose its state for subscribers to its announcement messages ๐. The EEs may use an alternate method described in Section 2.6 to obtain time critical changes, such as Certificate Revocation List (CRL) [RFC5280] updates.
- Implementations SHOULD use the available datagram size and avoid sending small datagrams containing partial CMP PKIMessage data. This keeps memory usage for packet buffering down ๐ง โจ.
- A CoAP-to-HTTP proxy can also protect the PKI entities by handling UDP and CoAP messages ๐ก๏ธ. The proxy can mitigate attacks, like denial-of-service attacks, replay attacks, and resource-exhaustion attacks, by enforcing basic checks. Those checks include validating that the ASN.1 syntax is compliant to CMP messages and validating the PKIMessage protection before sending them to PKI entities ๐ฅ.
- Since the proxy may have access to the CMP-level metadata and control over the flow of CMP messages, proper role-based access control should be in place ๐. The proxy can be deployed at the edge of the "end entities" network or in front of an RA and CA to protect them. However, the proxy may itself be vulnerable to resource-exhaustion attacks, as it's required to buffer the CMP messages received over CoAP transport before sending them to the HTTP endpoint ๐ฑ. This can be mitigated by using short timers for discarding the buffered messages and rate limiting clients based on the resource usage. Literally the most dramatic plot twist of the whole spec ๐ญ.
5. IANA Considerations ๐
IANA has registered "application/pkixcmp" (ID 259) in the "CoAP Content-Formats" registry at https://www.iana.org/assignments/core-parameters to transfer CMP transactions over CoAP ๐ฆ.
Type name: application
Subtype name: pkixcmp
Reference: RFC 9482 [RFC4210]
IANA has also registered a new path segment "ann" in the "CMP Well-Known URI Path Segments" registry at https://www.iana.org/assignments/cmp. This is so the EEs can register themselves for the announcement messages ๐ฃ.
Path Segment: ann
Description: The path to send a GET request with the CoAP Observe
Option to register for CMP announcement messages.
Reference: RFC 9482
IANA has added this document as a reference for the "cmp" entry in the "Well-Known URIs" registry at https://www.iana.org/assignments/well-known-uris. Iconic paperwork moment ๐๐
.
IANA has also added this document as a reference for the "p" entry in the "CMP Well-Known URI Path Segments" registry at https://www.iana.org/assignments/cmp/ ๐ธ.
6. References ๐
6.1. Normative References
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997,
https://www.rfc-editor.org/info/rfc2119. - [RFC4210] Adams, C., Farrell, S., Kause, T., and T. Mononen, "Internet X.509 Public Key Infrastructure Certificate Management Protocol (CMP)", RFC 4210, DOI 10.17487/RFC4210, September 2005,
https://www.rfc-editor.org/info/rfc4210. - [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link Format", RFC 6690, DOI 10.17487/RFC6690, August 2012,
https://www.rfc-editor.org/info/rfc6690. - [RFC6712] Kause, T. and M. Peylo, "Internet X.509 Public Key Infrastructure -- HTTP Transfer for the Certificate Management Protocol (CMP)", RFC 6712, DOI 10.17487/RFC6712, September 2012,
https://www.rfc-editor.org/info/rfc6712. - [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained Application Protocol (CoAP)", RFC 7252, DOI 10.17487/RFC7252, June 2014,
https://www.rfc-editor.org/info/rfc7252. - [RFC7641] Hartke, K., "Observing Resources in the Constrained Application Protocol (CoAP)", RFC 7641, DOI 10.17487/RFC7641, September 2015,
https://www.rfc-editor.org/info/rfc7641. - [RFC7959] Bormann, C. and Z. Shelby, Ed., "Block-Wise Transfers in the Constrained Application Protocol (CoAP)", RFC 7959, DOI 10.17487/RFC7959, August 2016,
https://www.rfc-editor.org/info/rfc7959. - [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017,
https://www.rfc-editor.org/info/rfc8174. - [RFC8615] Nottingham, M., "Well-Known Uniform Resource Identifiers (URIs)", RFC 8615, DOI 10.17487/RFC8615, May 2019,
https://www.rfc-editor.org/info/rfc8615. - [RFC9112] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "HTTP/1.1", STD 99, RFC 9112, DOI 10.17487/RFC9112, June 2022,
https://www.rfc-editor.org/info/rfc9112. - [RFC9147] Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version 1.3", RFC 9147, DOI 10.17487/RFC9147, April 2022,
https://www.rfc-editor.org/info/rfc9147. - [RFC9480] Brockhaus, H., von Oheimb, D., and J. Gray, "Certificate Management Protocol (CMP) Updates", RFC 9480, DOI 10.17487/RFC9480, November 2023,
https://www.rfc-editor.org/info/rfc9480. - [RFC9483] Brockhaus, H., von Oheimb, D., and S. Fries, "Lightweight Certificate Management Protocol (CMP) Profile", RFC 9483, DOI 10.17487/RFC9483, November 2023,
https://www.rfc-editor.org/info/rfc9483.
6.2. Informative References
- [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
https://www.rfc-editor.org/info/rfc5280. - [RFC8323] Bormann, C., Lemay, S., Tschofenig, H., Hartke, K., Silverajan, B., and B. Raymor, Ed., "CoAP (Constrained Application Protocol) over TCP, TLS, and WebSockets", RFC 8323, DOI 10.17487/RFC8323, February 2018,
https://www.rfc-editor.org/info/rfc8323. - [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
https://www.rfc-editor.org/info/rfc8446.
Acknowledgements ๐
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 ๐ซถ๐.
Authors' Addresses ๐ฆ
Mohit Sahni (editor)
Palo Alto Networks
3000 Tannery Way
Santa Clara, CA 95054
United States of America
Email: msahni@paloaltonetworks.com
Saurabh Tripathi (editor)
Palo Alto Networks
3000 Tannery Way
Santa Clara, CA 95054
United States of America
Email: stripathi@paloaltonetworks.com
๐ฆ where this page comes from
- ietf: rfc9482 2023-11
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms