<?xml version="1.0" encoding="US-ASCII"?>
<!-- change the "txt" on the previous line to "xml" to make this a valid XML2RFC template --> 
<!-- this is version 5 of this xml2rfc template -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC4210 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4210.xml">
<!ENTITY RFC6712 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6712.xml">
<!ENTITY RFC7252 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7252.xml">
<!ENTITY RFC7959 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7959.xml">
<!ENTITY RFC6347 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6347.xml">
<!ENTITY RFC8446 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8446.xml">
<!ENTITY RFC8323 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8323.xml">
<!ENTITY RFC8615 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8615.xml">
<!ENTITY RFC6690 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6690.xml">
<!ENTITY RFC5280 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml">
]>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict="no"?>
<?rfc rfcedstyle="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>

<rfc category="std" docName="draft-ietf-ace-cmpv2-coap-transport-01" ipr="trust200902">
  <front>

    <title abbrev="CoAP Transport for CMPV2">CoAP Transport for CMPV2</title>

    <author fullname="Mohit Sahni" initials="M" role="editor" surname="Sahni">
      <organization>Palo Alto Networks</organization>

      <address>
	<postal>
	<street>3000 Tannery Way</street>
	<city>Santa Clara</city>
	<region>CA</region>
	<code>95054</code>
	<country>US</country>
	</postal>
        <email>msahni@paloaltonetworks.com</email>
      </address>
    </author>
    <author fullname="Saurabh Tripathi" initials="S" role="editor" surname="Tripathi">
        <organization>Palo Alto Networks</organization>
  
        <address>
      <postal>
      <street>3000 Tannery Way</street>
      <city>Santa Clara</city>
      <region>CA</region>
      <code>95054</code>
      <country>US</country>
      </postal>
          <email>stripathi@paloaltonetworks.com</email>
        </address>
      </author>
    <!-- month and day will be generated automatically by XML2RFC; 
be sure the year is current.-->

    <date  year="2021" />

    <!-- IETF area is optional -->

    <area>Authentication and Authorization for Constrained Environments</area>

    <!--WG name at the upperleft corner of the doc, 
IETF is fine for non-WG IETF submissions -->

    <workgroup>ACE</workgroup>

    <!--add additional keywords here for IETF website search engine -->
<abstract>

	<t> 
   This document specifies the use of Constrained Application Protocol
   (CoAP) as a transport medium for the Certificate Management Protocol (CMP).
   CMP defines the interaction between various PKI entities for the 
   purpose of certificate creation and management. 
   CoAP is an HTTP like client-server protocol used by
   various constrained devices in the IoT space.
   </t>

</abstract>
</front>

  <middle>
    <section title="Introduction" anchor="sect-1">
   <t>
 The Certificate Management Protocol (CMP) <xref target="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 encryption of messages.  The Constrained Application Protocol (CoAP) defined in <xref target="RFC7252"/>, <xref target="RFC7959"/> and <xref target="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 <xref target="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 <xref target="RFC4210"/>, <xref target="Certificate-Management-Protocol-Updates"> CMP version 3 </xref> and <xref target="Lightweight-CMP-Profile">Lightweight CMP Profile</xref>. This document, in general, follows the HTTP transport specifications for CMP defined in <xref target="RFC6712"/> and specifies the additional requirements for using CoAP as a transport medium. This document also provides guidance on how to use a "CoAP-to-HTTP" proxy for a better adaptation of CoAP transport without significant changes to the existing PKI entities. Although CoAP transport can be used for communication between Registration Authority (RA) and Certification Authority (CA) or between CAs, the scope of this document is for communication between End Entity (EE) and RA or EE and CA.  This document is applicable only when the CoAP transport is used for the CMP transactions.

	    </t>
		<section title="Terminology">
		<t>
   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 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.
</t>
		</section>
    </section>
    <section title="CoAP Transport For CMP" anchor="sect-2"> 
	    <t>
		   A CMP transaction consists of exchanging PKIMessages <xref target="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 transport medium, while 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 transport medium for the Certificate Management Protocol.

		</t>
	    <section title="CoAP URI Format" anchor="sect-2.1">
		    <t>
			    The CoAP URI format is described in section 6 of <xref target="RFC7252"/>. The CoAP endpoints MUST support use of the path prefix "/.well-known/" as defined in <xref target="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 path specific to a CA, certificate profile or PKI management operations. A valid full operation path segment can look like this: 
<figure><artwork><![CDATA[
    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
]]></artwork>
        </figure>

    </t>
    	</section>
	<section title="Discovery of CMP RA/CA" anchor="sect-2.2">
			<t>
	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 <xref target="RFC7252"/> to discover the URI of the Local RA or CA's CMP endpoint. The CoAP CMP endpoints supporting service discovery MUST also support resource discovery in the CoRE Link Format as described in <xref target="RFC6690"/>.
			</t>
		</section>
	    <section title="CoAP Request Format" anchor="sect-2.3">
		    <t>
		    The CMP PKIMessages MUST be DER encoded and sent as the body of the CoAP POST request. 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. 
		    </t>
            </section>
	    <section title="CoAP Content-Format" anchor="sect-2.4">
		    <t>
		    When transferring CMP PKIMesssage over CoAP the media type "application/pkixcmp" MUST be used. 
		    </t>
            </section>
	    <section title="Announcement PKIMessage" anchor="sect-2.5">
		    <t>
			    When using the CoAP protocol, a PKI EE SHOULD poll for the potential changes via "PKI Information" request using "PKI General Message" defined in the PKIMessage <xref target="RFC4210"/> for various type of changes like CA key update or to get current CRL <xref target="RFC5280"/> to check revocation or using Support messages defined in section 5.4 of <xref target="Lightweight-CMP-Profile">Lightweight CMP Profile</xref>. 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. 
		    </t>
            </section>
	    <section title="CoAP Block-Wise Transfer Mode" anchor="sect-2.6">
		    <t>
		    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 <xref target="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. 
		    </t>
            </section>
	    <section title="Multicast CoAP" anchor="sect-2.7">
		    <t>
		    CMP PKIMessages sent over CoAP transport MUST NOT use a Multicast destination address.
		    </t>
            </section>
    </section>
    <section title="Using CoAP over DTLS" anchor="sect-3">
	    <t>
		    Although CMP protocol does not depend upon the underlying transport for protecting the messages but in cases when an end to end secrecy is desired for the CoAP transport, CoAP over DTLS <xref target="RFC6347"/> as a transport medium SHOULD be used. Section 9.1 of <xref target="RFC7252"/> defines how to use DTLS <xref target="RFC6347"/> for securing the CoAP. Once a DTLS <xref target="RFC6347"/> connection is established it SHOULD be used for as long as possible to avoid the frequent overhead of setting up a DTLS <xref target="RFC6347"/> connection for constrained devices.
	    </t>
    </section>
    <section title="Proxy support" anchor="sect-4">
	    <t>
			    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 transport, a CoAP-to-HTTP cross protocol proxy can be implemented based on section 10 of <xref target="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:</t>
		    <t><list style="symbols"><?rfc subcompact="yes"?>
				    <t>Use Uri-Path option to identify a server.</t>
				    <t>Use separate hostnames for each of the configured servers and then use Uri-Host option for routing the CoAP requests.</t>
				    <t>Use separate hostnames for each of the configured servers and then use Server Name Indication (<xref target="RFC8446"/>) in case of "coaps://" scheme for routing CoAP requests. </t>
			    </list></t>
		<t>
	</t>
    </section>
    <section title="Security Considerations" anchor="sect-5">
	    <t>
			    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 protocol are mentioned in the <xref target="RFC7252"/>. </t><t>
	In order to protect themselves against DDoS attacks, the implementations SHOULD avoid sending or receiving very 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.  
	    </t>
    </section>
    <section title="IANA Considerations" anchor="sect-6">
	<t>
	This document requires a new entry to the CoAP Content-Formats Registry code for the content-type "application/pkixcmp" and a new entry in Well-Known URIs for URI Suffix "cmp".
	</t>
    </section>

    <section title="Acknowledgments" anchor="sect-7">
	    <t>
		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.
	</t>
    </section>
  </middle>

  <back>

    <!-- References Section -->

    <references title="Normative References">
	&RFC2119;
	&RFC8174;
	&RFC4210;
	&RFC6712;
	&RFC7252;
	&RFC7959;
	&RFC8323;
	&RFC5280;
	&RFC8615;
	&RFC6690;
</references>

    <references title="Informative References">
	
	&RFC6347;
	&RFC8446;
    <reference anchor="Lightweight-CMP-Profile" target="https://tools.ietf.org/html/draft-ietf-lamps-lightweight-cmp-profile-05">
	<front>
		<title>Lightweight CMP Profile</title>
   <author fullname="Hendrik Brockhaus" initials="H."
           surname="Brockhaus">
      <organization abbrev="Siemens">Siemens AG</organization>
      <address>
       <email>hendrik.brockhaus@siemens.com</email>
	   <uri>http://www.siemens.com/</uri>
      </address>
   </author>
   <author fullname="Steffen Fries" initials="S." surname="Fries">
	  <organization abbrev="Siemens">Siemens AG</organization>
      <address>
        <email>steffen.fries@siemens.com</email>
		<uri>http://www.siemens.com/</uri>
      </address>
    </author>
    <author fullname="David von Oheimb" initials="D." surname="von Oheimb">
	  <organization abbrev="Siemens">Siemens AG</organization>
      <address>
        <email>david.von.oheimb@siemens.com</email>
		<uri>http://www.siemens.com/</uri>
      </address>
	  </author>
    	<date year="2021"></date>
	</front>
       <seriesInfo name='Work in Progress,' value='draft-ietf-lamps-lightweight-cmp-profile-05'/>
</reference>			
<reference anchor="Certificate-Management-Protocol-Updates" target="https://tools.ietf.org/html/draft-brockhaus-lamps-cmp-updates-03">
	<front>
		<title>Certificate Management Protocol (CMP) Updates</title>
   <author fullname="Hendrik Brockhaus" initials="H."
           surname="Brockhaus">
      <organization abbrev="Siemens">Siemens AG</organization>
      <address>
       <email>hendrik.brockhaus@siemens.com</email>
	   <uri>http://www.siemens.com/</uri>
      </address>
   </author>
    <author fullname="David von Oheimb" initials="D." surname="von Oheimb">
	  <organization abbrev="Siemens">Siemens AG</organization>
      <address>
        <email>david.von.oheimb@siemens.com</email>
		<uri>http://www.siemens.com/</uri>
      </address>
	  </author>
    	<date year="2021"></date>
	</front>
       <seriesInfo name='Work in Progress,' value='draft-brockhaus-lamps-cmp-updates-03'/>
</reference>			
</references>	
  </back>
</rfc>
