--- 1/draft-ietf-ace-coap-est-15.txt 2019-10-22 20:13:11.118968545 -0700 +++ 2/draft-ietf-ace-coap-est-16.txt 2019-10-22 20:13:11.210970883 -0700 @@ -1,23 +1,23 @@ ACE P. van der Stok Internet-Draft Consultant Intended status: Standards Track P. Kampanakis -Expires: April 2, 2020 Cisco Systems +Expires: April 24, 2020 Cisco Systems M. Richardson SSW S. Raza RISE SICS - September 30, 2019 + October 22, 2019 EST over secure CoAP (EST-coaps) - draft-ietf-ace-coap-est-15 + draft-ietf-ace-coap-est-16 Abstract Enrollment over Secure Transport (EST) is used as a certificate provisioning protocol over HTTPS. Low-resource devices often use the lightweight Constrained Application Protocol (CoAP) for message exchanges. This document defines how to transport EST payloads over secure CoAP (EST-coaps), which allows constrained devices to use existing EST functionality for provisioning certificates. @@ -29,21 +29,21 @@ 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 April 2, 2020. + This Internet-Draft will expire on April 24, 2020. Copyright Notice Copyright (c) 2019 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 @@ -54,37 +54,37 @@ described in the Simplified BSD License. Table of Contents 1. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6 3. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. DTLS and conformance to RFC7925 profiles . . . . . . . . . . 7 5. Protocol Design . . . . . . . . . . . . . . . . . . . . . . . 10 5.1. Discovery and URIs . . . . . . . . . . . . . . . . . . . 10 - 5.2. Mandatory/optional EST Functions . . . . . . . . . . . . 12 + 5.2. Mandatory/optional EST Functions . . . . . . . . . . . . 13 5.3. Payload formats . . . . . . . . . . . . . . . . . . . . . 13 - 5.4. Message Bindings . . . . . . . . . . . . . . . . . . . . 14 + 5.4. Message Bindings . . . . . . . . . . . . . . . . . . . . 15 5.5. CoAP response codes . . . . . . . . . . . . . . . . . . . 15 5.6. Message fragmentation . . . . . . . . . . . . . . . . . . 16 5.7. Delayed Responses . . . . . . . . . . . . . . . . . . . . 17 5.8. Server-side Key Generation . . . . . . . . . . . . . . . 19 6. HTTPS-CoAPS Registrar . . . . . . . . . . . . . . . . . . . . 21 - 7. Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 22 + 7. Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 23 8. Deployment limitations . . . . . . . . . . . . . . . . . . . 23 - 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 + 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 9.1. Content-Format Registry . . . . . . . . . . . . . . . . . 24 9.2. Resource Type registry . . . . . . . . . . . . . . . . . 24 10. Security Considerations . . . . . . . . . . . . . . . . . . . 25 10.1. EST server considerations . . . . . . . . . . . . . . . 25 10.2. HTTPS-CoAPS Registrar considerations . . . . . . . . . . 27 - 11. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 28 + 11. Contributors . . . . . . . . . . . . . . . . . . . . . . . . 27 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 28 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 28 13.1. Normative References . . . . . . . . . . . . . . . . . . 28 13.2. Informative References . . . . . . . . . . . . . . . . . 30 Appendix A. EST messages to EST-coaps . . . . . . . . . . . . . 32 A.1. cacerts . . . . . . . . . . . . . . . . . . . . . . . . . 33 A.2. enroll / reenroll . . . . . . . . . . . . . . . . . . . . 35 A.3. serverkeygen . . . . . . . . . . . . . . . . . . . . . . 36 A.4. csrattrs . . . . . . . . . . . . . . . . . . . . . . . . 38 Appendix B. EST-coaps Block message examples . . . . . . . . . . 39 @@ -94,20 +94,26 @@ C.1. cacerts . . . . . . . . . . . . . . . . . . . . . . . . . 44 C.2. enroll / reenroll . . . . . . . . . . . . . . . . . . . . 45 C.3. serverkeygen . . . . . . . . . . . . . . . . . . . . . . 47 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 49 1. Change Log EDNOTE: Remove this section before publication + -16 + + Updates to address Yaron S.'s Secdir review. + + Updates to address David S.'s Gen-ART review. + -15 Updates to addressed Ben's AD follow up feedback. -14 Updates to complete Ben's AD review feedback and discussions. -13 @@ -328,23 +335,23 @@ +------------------------------------------------+ | Secure Transport | +------------------------------------------------+ Figure 1: EST-coaps protocol layers In accordance with sections 3.3 and 4.4 of [RFC7925], the mandatory cipher suite for DTLS in EST-coaps is TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 [RFC7251]. Curve secp256r1 MUST be supported [RFC8422]; this curve is equivalent to the NIST P-256 - curve. Additionally, crypto agility is important, and the - recommendations in Section 4.4 of [RFC7925] and any updates to it - concerning Curve25519 and other curves also apply. + curve. After the standardization of [RFC7748], support for + Curve25519 will likely be required in the future by (D)TLS Profiles + for the Internet of Things [RFC7925]. DTLS 1.2 implementations must use the Supported Elliptic Curves and Supported Point Formats Extensions in [RFC8422]. Uncompressed point format must also be supported. DTLS 1.3 [I-D.ietf-tls-dtls13] implementations differ from DTLS 1.2 because they do not support point format negotiation in favor of a single point format for each curve. Thus, support for DTLS 1.3 does not mandate point format extensions and negotiation. In addition, in DTLS 1.3 the Supported Elliptic Curves extension has been renamed to Supported Groups. @@ -388,30 +395,33 @@ clients and servers. When proof-of-possession is desired, a set of actions are required regarding the use of tls-unique, described in Section 3.5 in [RFC7030]. The tls-unique information consists of the contents of the first "Finished" message in the (D)TLS handshake between server and client [RFC5929]. The client adds the "Finished" message as a ChallengePassword in the attributes section of the PKCS#10 Request [RFC5967] to prove that the client is indeed in control of the private key at the time of the (D)TLS session establishment. - In the case of EST-coaps, the same operations can be performed during - the DTLS handshake. For DTLS 1.2, in the event of handshake message - fragmentation, the Hash of the handshake messages used in the MAC - calculation of the Finished message must be computed as if each - handshake message had been sent as a single fragment (Section 4.2.6 - of [RFC6347]). The Finished message is calculated as shown in - Section 7.4.9 of [RFC5246]. Similarly, for DTLS 1.3, the Finished + In the case of handshake message fragmentation, if proof-of- + possession is desired, the Finished message added as the + ChallengePassword in the CSR is calculated as specified by the DTLS + standards. We summarize it here for convenience. For DTLS 1.2, in + the event of handshake message fragmentation, the Hash of the + handshake messages used in the MAC calculation of the Finished message must be computed as if each handshake message had been sent - as a single fragment (Section 5.8 of [I-D.ietf-tls-dtls13]) following - the algorithm described in 4.4.4 of [RFC8446]. + as a single fragment (Section 4.2.6 of [RFC6347]). The Finished + message is calculated as shown in Section 7.4.9 of [RFC5246]. + Similarly, for DTLS 1.3, the Finished message must be computed as if + each handshake message had been sent as a single fragment + (Section 5.8 of [I-D.ietf-tls-dtls13]) following the algorithm + described in 4.4.4 of [RFC8446]. In a constrained CoAP environment, endpoints can't always afford to establish a DTLS connection for every EST transaction. Authenticating and negotiating DTLS keys requires resources on low- end endpoints and consumes valuable bandwidth. To alleviate this situation, an EST-coaps DTLS connection MAY remain open for sequential EST transactions. For example, an EST csrattrs request that is followed by a simpleenroll request can use the same authenticated DTLS connection. However, when a cacerts request is included in the set of sequential EST transactions, some additional @@ -419,22 +429,22 @@ Explicit TA database as explained in Section 10.1. Given that after a successful enrollment, it is more likely that a new EST transaction will take place after a significant amount of time, the DTLS connections SHOULD only be kept alive for EST messages that are relatively close to each other. In some cases, like NAT rebinding, keeping the state of a connection is not possible when devices sleep for extended periods of time. In such occasions, [I-D.ietf-tls-dtls-connection-id] negotiates a connection ID that can eliminate the need for new handshake and its additional cost; or DTLS - 1.3 session resumption provides a less costly alternative than re- - doing a full DTLS handshake. + session resumption provides a less costly alternative than re-doing a + full DTLS handshake. 5. Protocol Design EST-coaps uses CoAP to transfer EST messages, aided by Block-Wise Transfer [RFC7959] to avoid IP fragmentation. The use of Blocks for the transfer of larger EST messages is specified in Section 5.6. Figure 1 shows the layered EST-coaps architecture. The EST-coaps protocol design follows closely the EST design. The supported message types in EST-coaps are: @@ -497,21 +507,21 @@ | /serverkeygen | /skg (PKCS#7) | | /serverkeygen | /skc (application/pkix-cert) | | /csrattrs | /att | +------------------+------------------------------+ Table 1: Short EST-coaps URI path The /skg message is the EST /serverkeygen equivalent where the client requests a certificate in PKCS#7 format and a private key. If the client prefers a single application/pkix-cert certificate instead of - PKCS#7, she will make an /skc request. In both cases (i.e., /skg, + PKCS#7, it will make an /skc request. In both cases (i.e., /skg, /skc) a private key MUST be returned Clients and servers MUST support the short resource EST-coaps URIs. In the context of CoAP, the presence and location of (path to) the EST resources are discovered by sending a GET request to "/.well- known/core" including a resource type (RT) parameter with the value "ace.est*" [RFC6690]. The example below shows the discovery over CoAPS of the presence and location of EST-coaps resources. Linefeeds are included only for readability. @@ -547,23 +558,23 @@ ;rt="ace.est.sren"; ct="281 TBD287", ;rt="ace.est.att"; ct=285, ;rt="ace.est.skg"; ct=62, ;rt="ace.est.skc"; ct=62 The server MUST support the default /.well-known/est root resource. - The server SHOULD support resource discovery when he supports non- + The server SHOULD support resource discovery when it supports non- default URIs (like /est or /est/ArbitraryLabel) or ports. The client - SHOULD use resource discovery when she is unaware of the available + SHOULD use resource discovery when it is unaware of the available EST-coaps resources. Throughout this document the example root resource of /est is used. 5.2. Mandatory/optional EST Functions This specification contains a set of required-to-implement functions, optional functions, and not specified functions. The latter ones are deemed too expensive for low-resource devices in payload and calculation times. @@ -648,22 +659,22 @@ +----------+-----------------+-----------------+ | Function | Response part 1 | Response part 2 | +----------+-----------------+-----------------+ | /skg | 284 | 281 | | /skc | 280 | TBD287 | +----------+-----------------+-----------------+ Table 3: response content formats for skg and skc - The key and certificate representations are ASN.1 encoded in binary - format. An example is shown in Appendix A.3. + The key and certificate representations are DER-encoded ASN.1, in its + native binary form. An example is shown in Appendix A.3. 5.4. Message Bindings The general EST-coaps message characteristics are: o EST-coaps servers sometimes need to provide delayed responses which are preceded by an immediately returned empty ACK or an ACK containing response code 5.03 as explained in Section 5.7. Thus, it is RECOMMENDED for implementers to send EST-coaps requests in confirmable CON CoAP messages. @@ -808,38 +819,38 @@ <-- (ACK) (2:1/1/256) (2.04 Changed) {Cert resp (frag# 2)} . . . POST [2001:db8::2:1]:61616/est/sen (CON)(2:N2/0/256) --> <-- (ACK) (2:N2/0/256) (2.04 Changed) {Cert resp (frag# N2+1)} Figure 2: EST-COAP enrollment with short wait If the server is very slow (i.e., minutes) in providing the response - (i.e., when a manual intervention is needed), he SHOULD respond with + (i.e., when a manual intervention is needed), it SHOULD respond with an ACK containing response code 5.03 (Service unavailable) and a Max- Age Option to indicate the time the client SHOULD wait to request the content later. After a delay of Max-Age, the client SHOULD resend the identical CSR to the server. As long as the server responds with response code 5.03 (Service Unavailable) with a Max-Age Option, the client SHOULD keep resending the enrollment request until the server responds with the certificate or the client abandons the request for other reasons. To demonstrate this scenario, Figure 3 shows a client sending an enrollment request that uses N1+1 Block1 blocks to send the CSR to the server. The server needs N2+1 Block2 blocks to respond, but also needs to take a long delay (minutes) to provide the response. Consequently, the server uses a 5.03 ACK response with a Max-Age - Option. The client waits for a period of Max-Age as many times as - she receives the same 5.03 response and retransmits the enrollment - request until she receives a certificate in a fragmented 2.04 + Option. The client waits for a period of Max-Age as many times as it + receives the same 5.03 response and retransmits the enrollment + request until it receives a certificate in a fragmented 2.04 response. POST [2001:db8::2:1]:61616/est/sen (CON)(1:0/1/256) {CSR (frag# 1)} --> <-- (ACK) (1:0/1/256) (2.31 Continue) POST [2001:db8::2:1]:61616/est/sen (CON)(1:1/1/256) {CSR (frag# 2)} --> <-- (ACK) (1:1/1/256) (2.31 Continue) . . . POST [2001:db8::2:1]:61616/est/sen(CON)(1:N1/0/256){CSR (frag# N1+1)}--> @@ -988,39 +999,41 @@ the EST server when a Registrar is present. The EST server becomes aware of the presence of a Registrar from its TLS client certificate that includes id-kp-cmcRA [RFC6402] extended key usage extension (EKU). As explained in Section 3.7 of [RFC7030], the "EST server SHOULD apply an authorization policy consistent with a Registrar client. For example, it could be configured to accept PoP linking information that does not match the current TLS session because the authenticated EST client Registrar has verified this information when acting as an EST server". - For some use-cases, clients that leverage server-side key generation - might prefer for the enrolled keys to be generated by the Registrar - if the CA does not support server-side key generation. Such a - Registrar is responsible for generating a new CSR signed by a new key - which will be returned to the client along with the certificate from - the CA. In these cases, the Registrar MUST use random number - generation with proper entropy. - Table 1 contains the URI mappings between EST-coaps and EST that the Registrar MUST adhere to. Section 5.5 of this specification and Section 7 of [RFC8075] define the mappings between EST-coaps and HTTP response codes, that determine how the Registrar MUST translate CoAP response codes from/to HTTP status codes. The mapping from CoAP Content-Format to HTTP Media-Type is defined in Section 9.1. Additionally, a conversion from CBOR major type 2 to Base64 encoding MUST take place at the Registrar. If CMS end-to-end encryption is employed for the private key, the encrypted CMS EnvelopedData blob MUST be converted at the Registrar to binary CBOR type 2 downstream - to the client. + to the client. This is a format conversion that does not require + decryption of the CMS EnvelopedData. + + A deviation from the mappings in Table 1 could take place if clients + that leverage server-side key generation preferred for the enrolled + keys to be generated by the Registrar in the case the CA does not + support server-side key generation. Such a Registrar is responsible + for generating a new CSR signed by a new key which will be returned + to the client along with the certificate from the CA. In these + cases, the Registrar MUST use random number generation with proper + entropy. Due to fragmentation of large messages into blocks, an EST-coaps-to- HTTP Registrar MUST reassemble the BLOCKs before translating the binary content to Base64, and consecutively relay the message upstream. The EST-coaps-to-HTTP Registrar MUST support resource discovery according to the rules in Section 5.1. 7. Parameters @@ -1181,21 +1195,21 @@ In cases where the IDevID used to authenticate the client is expired the server MAY still authenticate the client because IDevIDs are expected to live as long as the device itself (Section 4). In such occasions, checking the certificate revocation status or authorizing the client using another method is important for the server to ensure that the client is to be trusted. In accordance with [RFC7030], TLS cipher suites that include "_EXPORT_" and "_DES_" in their names MUST NOT be used. More information about recommendations of TLS and DTLS are included in - [RFC7525]. + [BCP195]. As described in CMC, Section 6.7 of [RFC5272], "For keys that can be used as signature keys, signing the certification request with the private key serves as a PoP on that key pair". The inclusion of tls- unique in the certificate request links the proof-of-possession to the TLS proof-of-identity. This implies but does not prove that only the authenticated client currently has access to the private key. What's more, CMC PoP linking uses tls-unique as it is defined in [RFC5929]. The 3SHAKE attack [tripleshake] poses a risk by allowing @@ -1212,23 +1226,20 @@ prf defined in [I-D.josefsson-sasl-tls-cb] by using a TLS exporter [RFC5705] in TLS 1.2 or TLS 1.3's updated exporter (Section 7.5 of [RFC8446]) value in place of the tls-unique value in the CSR. Such mechanism has not been standardized yet. Adopting a channel binding value generated from an exporter would break backwards compatibility for an RA that proxies through to a classic EST server. Thus, in this specification we still depend on the tls-unique mechanism defined in [RFC5929], especially since a 3SHAKE attack does not expose messages exchanged with EST-coaps. - Regarding the Certificate Signing Request (CSR), an EST-coaps server - is expected to be able to recover from improper CSR requests. - Interpreters of ASN.1 structures should be aware of the use of invalid ASN.1 length fields and should take appropriate measures to guard against buffer overflows, stack overruns in particular, and malicious content in general. 10.2. HTTPS-CoAPS Registrar considerations The Registrar proposed in Section 6 must be deployed with care, and only when direct client-server connections are not possible. When PoP linking is used the Registrar terminating the DTLS connection @@ -1237,23 +1248,22 @@ transaction. The EST server could be configured to accept PoP linking information that does not match the current TLS session because the authenticated EST Registrar is assumed to have verified PoP linking downstream to the client. The introduction of an EST-coaps-to-HTTP Registrar assumes the client can authenticate the Registrar using its implicit or explicit TA database. It also assumes the Registrar has a trust relationship with the upstream EST server in order to act on behalf of the clients. When a client uses the Implicit TA database for certificate - validation, she SHOULD confirm if the server is acting as an RA by - the presence of the id-kp-cmcRA EKU [RFC6402] in the server - certificate. + validation, it SHOULD confirm if the server is acting as an RA by the + presence of the id-kp-cmcRA EKU [RFC6402] in the server certificate. In a server-side key generation case, if no end-to-end encryption is used, the Registrar may be able see the private key as it acts as a man-in-the-middle. Thus, the client puts its trust on the Registrar not exposing the private key. Clients that leverage server-side key generation without end-to-end encryption of the private key (Section 5.8) have no knowledge if the Registrar will be generating the private key and enrolling the certificates with the CA or if the CA will be responsible for @@ -1297,21 +1307,21 @@ [I-D.ietf-lamps-rfc5751-bis] Schaad, J., Ramsdell, B., and S. Turner, "Secure/ Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 Message Specification", draft-ietf-lamps-rfc5751-bis-12 (work in progress), September 2018. [I-D.ietf-tls-dtls13] Rescorla, E., Tschofenig, H., and N. Modadugu, "The Datagram Transport Layer Security (DTLS) Protocol Version - 1.3", draft-ietf-tls-dtls13-32 (work in progress), July + 1.3", draft-ietf-tls-dtls13-33 (work in progress), October 2019. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC2585] Housley, R. and P. Hoffman, "Internet X.509 Public Key Infrastructure Operational Protocols: FTP and HTTP", RFC 2585, DOI 10.17487/RFC2585, May 1999, @@ -1374,29 +1384,35 @@ Security (TLS) Versions 1.2 and Earlier", RFC 8422, DOI 10.17487/RFC8422, August 2018, . [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, . 13.2. Informative References + [BCP195] Sheffer, Y., Holz, R., and P. Saint-Andre, + "Recommendations for Secure Use of Transport Layer + Security (TLS) and Datagram Transport Layer Security + (DTLS)", BCP 195, RFC 7525, May 2015, + . + [COREparams] "Constrained RESTful Environments (CoRE) Parameters", . [I-D.ietf-tls-dtls-connection-id] Rescorla, E., Tschofenig, H., and T. Fossati, "Connection Identifiers for DTLS 1.2", draft-ietf-tls-dtls-connection- - id-06 (work in progress), July 2019. + id-07 (work in progress), October 2019. [I-D.josefsson-sasl-tls-cb] Josefsson, S., "Channel Bindings for TLS based on the PRF", draft-josefsson-sasl-tls-cb-03 (work in progress), March 2015. [I-D.moskowitz-ecdsa-pki] Moskowitz, R., Birkholz, H., Xia, L., and M. Richardson, "Guide for building an ECC pki", draft-moskowitz-ecdsa- pki-07 (work in progress), August 2019. @@ -1445,32 +1461,30 @@ [RFC7251] McGrew, D., Bailey, D., Campagna, M., and R. Dugal, "AES- CCM Elliptic Curve Cryptography (ECC) Cipher Suites for TLS", RFC 7251, DOI 10.17487/RFC7251, June 2014, . [RFC7299] Housley, R., "Object Identifier Registry for the PKIX Working Group", RFC 7299, DOI 10.17487/RFC7299, July 2014, . - [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, - "Recommendations for Secure Use of Transport Layer - Security (TLS) and Datagram Transport Layer Security - (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May - 2015, . - [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., Langley, A., and M. Ray, "Transport Layer Security (TLS) Session Hash and Extended Master Secret Extension", RFC 7627, DOI 10.17487/RFC7627, September 2015, . + [RFC7748] Langley, A., Hamburg, M., and S. Turner, "Elliptic Curves + for Security", RFC 7748, DOI 10.17487/RFC7748, January + 2016, . + [RSAfact] "Factoring RSA keys from certified smart cards: Coppersmith in the wild", Advances in Cryptology - ASIACRYPT 2013, August 2013. [tripleshake] "Triple Handshakes and Cookie Cutters: Breaking and Fixing Authentication over TLS", IEEE Security and Privacy ISBN 978-1-4799-4686-0, May 2014. Appendix A. EST messages to EST-coaps