idnits 2.17.00 (12 Aug 2021) /tmp/idnits34645/draft-ietf-dice-profile-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). == Couldn't figure out when the document was first submitted -- there may comments or warnings related to the use of a disclaimer for pre-RFC5378 work that could not be issued because of this. Please check the Legal Provisions document at https://trustee.ietf.org/license-info to determine if you need the pre-RFC5378 disclaimer. -- The document date (July 4, 2014) is 2877 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'ChangeCipherSpec' is mentioned on line 609, but not defined == Unused Reference: 'RFC5246' is defined on line 917, but no explicit reference was found in the text == Unused Reference: 'I-D.cooper-ietf-privacy-requirements' is defined on line 965, but no explicit reference was found in the text == Unused Reference: 'RFC3552' is defined on line 992, but no explicit reference was found in the text == Unused Reference: 'RFC4492' is defined on line 999, but no explicit reference was found in the text == Unused Reference: 'RFC5289' is defined on line 1015, but no explicit reference was found in the text == Unused Reference: 'RFC6973' is defined on line 1032, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'EUI64' == Outdated reference: draft-ietf-tls-cached-info has been published as RFC 7924 ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6347 (Obsoleted by RFC 9147) ** Downref: Normative reference to an Informational RFC: RFC 7251 -- No information found for draft-bmoeller-tls-downgrade-scsv - is the name correct? == Outdated reference: draft-ietf-uta-tls-bcp has been published as RFC 7525 == Outdated reference: A later version (-01) exists of draft-schmertmann-dice-ccm-psk-pfs-00 -- Obsolete informational reference (is this intentional?): RFC 4492 (Obsoleted by RFC 8422) -- Obsolete informational reference (is this intentional?): RFC 5077 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 6961 (Obsoleted by RFC 8446) Summary: 3 errors (**), 0 flaws (~~), 13 warnings (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 dice H. Tschofenig, Ed. 3 Internet-Draft ARM Ltd. 4 Intended status: Standards Track July 4, 2014 5 Expires: January 5, 2015 7 A Datagram Transport Layer Security (DTLS) 1.2 Profile for the Internet 8 of Things 9 draft-ietf-dice-profile-03.txt 11 Abstract 13 This document defines a DTLS profile that is suitable for Internet of 14 Things applications and is reasonably implementable on many 15 constrained devices. 17 A common design pattern in IoT deployments is the use of a 18 constrained device (typically providing sensor data) that interacts 19 with the web infrastructure. This document focuses on this 20 particular pattern. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on January 5, 2015. 39 Copyright Notice 41 Copyright (c) 2014 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 58 3. The Communication Model . . . . . . . . . . . . . . . . . . . 5 59 4. The Ciphersuite Concept . . . . . . . . . . . . . . . . . . . 6 60 5. Pre-Shared Secret Authentication with DTLS . . . . . . . . . 8 61 6. Raw Public Key Use with DTLS . . . . . . . . . . . . . . . . 9 62 7. Certificate Use with DTLS . . . . . . . . . . . . . . . . . . 11 63 8. Error Handling . . . . . . . . . . . . . . . . . . . . . . . 12 64 9. Session Resumption . . . . . . . . . . . . . . . . . . . . . 13 65 10. Compression . . . . . . . . . . . . . . . . . . . . . . . . . 14 66 11. Perfect Forward Secrecy . . . . . . . . . . . . . . . . . . . 14 67 12. Keep-Alive . . . . . . . . . . . . . . . . . . . . . . . . . 15 68 13. Random Number Generation . . . . . . . . . . . . . . . . . . 16 69 14. Client Certificate URLs . . . . . . . . . . . . . . . . . . . 17 70 15. Trusted CA Indication . . . . . . . . . . . . . . . . . . . . 17 71 16. Truncated MAC Extension . . . . . . . . . . . . . . . . . . . 17 72 17. Server Name Indication (SNI) . . . . . . . . . . . . . . . . 18 73 18. Maximum Fragment Length Negotiation . . . . . . . . . . . . . 18 74 19. Negotiation and Downgrading Attacks . . . . . . . . . . . . . 18 75 20. Privacy Considerations . . . . . . . . . . . . . . . . . . . 19 76 21. Security Considerations . . . . . . . . . . . . . . . . . . . 19 77 22. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 78 23. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 20 79 24. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 80 24.1. Normative References . . . . . . . . . . . . . . . . . . 20 81 24.2. Informative References . . . . . . . . . . . . . . . . . 21 82 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 23 84 1. Introduction 86 This document defines a DTLS 1.2 [RFC6347] profile that offers 87 communication security for Internet of Things (IoT) applications and 88 is reasonably implementable on many constrained devices. It aims to 89 meet the following goals: 91 o Serves as a one-stop shop for implementers to know which pieces of 92 the specification jungle contain relevant details. 94 o Does not alter the DTLS 1.2 specification. 96 o Does not introduce any new extensions. 98 o Aligns with the DTLS security modes of the Constrained Application 99 Protocol (CoAP) [RFC7252]. 101 DTLS is used to secure a number of applications run over an 102 unreliable datagram transport. CoAP [RFC7252] is one such protocol 103 and has been designed specifically for use in IoT environments. CoAP 104 can be secured a number of different ways, also called security 105 modes. These security modes are as follows, see Section 5, 106 Section 6, Section 7 for additional details: 108 No Security Protection at the Transport Layer: No DTLS is used but 109 instead application layer security functionality is assumed. 111 Shared Secret-based DTLS Authentication: DTLS supports the use of 112 shared secrets [RFC4279]. This mode is useful if the number of 113 communication relationships between the IoT device and servers is 114 small and for very constrained devices. Shared secret-based 115 authentication mechanisms offer good performance and require a 116 minimum of data to be exchanged. 118 DTLS Authentication using Asymmetric Cryptography: TLS supports 119 client and server authentication using asymmetric cryptography. 120 Two approaches for validating these public keys are available. 121 First, [RFC7250] allows raw public keys to be used in TLS without 122 the overhead of certificates. This approach requires out-of-band 123 validation of the public key. Second, the use of X.509 124 certificates [RFC5280] with TLS is common on the Web today (at 125 least for server-side authentication) and certain IoT environments 126 may also re-use those capabilities. Certificates bind an 127 identifier to the public key signed by a certification authority 128 (CA). A trust anchor store has to be provisioned on the device to 129 indicate what CAs are trusted. Furthermore, the certificate may 130 contain a wealth of other information used to make authorization 131 decisions. 133 As described in [I-D.ietf-lwig-tls-minimal], an application designer 134 developing an IoT device needs to consider the security threats and 135 the security services that can be used to mitigate the threats. 136 Enabling devices to upload data and retrieve configuration 137 information, inevitably requires that Internet-connected devices be 138 able to authenticate themselves to servers and vice versa as well as 139 to ensure that the data and information exchanged is integrity and 140 confidentiality protected. While these security services can be 141 provided at different layers in the protocol stack the use of 142 communication security, as offered by DTLS, has been very popular on 143 the Internet and it is likely to be useful for IoT scenarios as well. 144 In case the communication security features offered by DTLS meet the 145 security requirements of your application the remainder of the 146 document might offer useful guidance. 148 Not every IoT deployment will use CoAP but the discussion regarding 149 choice of credentials and cryptographic algorithms will be very 150 similar. As such, the discussions in this document are applicable 151 beyond the use of the CoAP protocol. 153 The design of DTLS is intentionally very similar to TLS. Since DTLS 154 operates on top of an unreliable datagram transport a few 155 enhancements to the TLS structure are, however necessary. RFC 6347 156 explains these differences in great detail. As a short summary, for 157 those not familiar with DTLS the differences are: 159 o An explicit sequence number and an epoch field is included in the 160 TLS Record Layer. Section 4.1 of RFC 6347 explains the processing 161 rules for these two new fields. The value used to compute the MAC 162 is the 64-bit value formed by concatenating the epoch and the 163 sequence number. 165 o Stream ciphers must not be used with DTLS. The only stream cipher 166 defined for TLS 1.2 is RC4 and due to cryptographic weaknesses it 167 is not recommended anymore even for use with TLS. 169 o The TLS Handshake Protocol has been enhanced to include a 170 stateless cookie exchange for Denial of Service (DoS) resistance. 171 Furthermore, the header has been extended to deal with message 172 loss, reordering, and fragmentation. Retransmission timers have 173 been included to deal with message loss. For DoS protection a new 174 handshake message, the HelloVerifyRequest, was added to DTLS. 175 This handshake message is sent by the server and includes a 176 stateless cookie, which is returned in a ClientHello message back 177 to the server. This type of DoS protection mechanism has also 178 been incorporated into the design of IKEv2. Although the exchange 179 is optional for the server to execute, a client implementation has 180 to be prepared to respond to it. 182 2. Terminology 184 The key words "MUST", "MUST NOT", "REQUIRED", "MUST", "MUST NOT", 185 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 186 document are to be interpreted as described in [RFC2119]. 188 Note that "Client" and "Server" in this document refer to TLS roles, 189 where the Client initiates the TLS handshake. This does not restrict 190 the interaction pattern of the protocols carried inside TLS as the 191 record layer allows bi-directional communication. In the case of 192 CoAP the "Client" can act as a CoAP Server or Client. 194 3. The Communication Model 196 This document describes a profile of DTLS 1.2 and, to be useful, it 197 has to make assumptions about the envisioned communication 198 architecture. 200 The communication architecture shown in Figure 1 assumes a uni-cast 201 communication interaction with an IoT device utilizing a DTLS client 202 and that client interacts with one or multiple DTLS servers. 204 Clients are preconfigured with the address or addresses of servers 205 (e.g., as part of the firmware) they will communicate with as well as 206 authentication information: 208 o For PSK-based authentication (see Section 5), this includes the 209 paired "PSK identity" and shared secret to be used with each 210 server. 212 o For raw public key-based authentication (see Section 6), this 213 includes either the server's public key or the hash of the 214 server's public key. 216 o For certificate-based authentication (see Section 7), this may 217 include a pre-populated trust anchor store that allows the client 218 to perform path validation for the certificate obtained during the 219 handshake with the server. 221 This document only focuses on the description of the DTLS client-side 222 functionality. 224 +////////////////////////////////////+ 225 | Configuration | 226 |////////////////////////////////////| 227 | Server A --> PSK Identity, PSK | 228 | Server B --> Public Key (Server B),| 229 | Public Key (Client) | 230 | Server C --> Public Key (Client), | 231 | Trust Anchor Store | 232 +------------------------------------+ 233 oo 234 oooooo 235 o 236 +------+ 237 |Client|--- 238 +------+ \ 239 \ ,-------. 240 ,' `. +------+ 241 / IP-based \ |Server| 242 ( Network ) | A | 243 \ / +------+ 244 `. ,' 245 '---+---' +------+ 246 | |Server| 247 | | B | 248 | +------+ 249 | 250 | +------+ 251 +----------------->|Server| 252 | C | 253 +------+ 255 Figure 1: Constrained DTLS Client Profile. 257 4. The Ciphersuite Concept 259 TLS (and consequently DTLS) has the concept of ciphersuites and an 260 IANA registry [IANA-TLS] was created to register the suites. A 261 ciphersuite (and the specification that defines it) contains the 262 following information: 264 o Authentication and Key Exchange Algorithm (e.g., PSK) 266 o Cipher and Key Length (e.g., AES with 128 bit keys) 268 o Mode of operation (e.g., CBC) 269 o Hash Algorithm for Integrity Protection (e.g., SHA in combination 270 with HMAC) 272 o Hash Algorithm for use with the Pseudorandom Function (e.g. HMAC 273 with the SHA-256) 275 o Misc information (e.g., length of authentication tags) 277 o Information whether the ciphersuite is suitable for DTLS or only 278 for TLS 280 The TLS ciphersuite TLS_PSK_WITH_AES_128_CCM_8, for example, uses a 281 pre-shared authentication and key exchange algorithm. RFC 6655 282 [RFC6655] defines this ciphersuite. It uses the Advanced Encryption 283 Standard (AES) encryption algorithm, which is a block cipher. Since 284 the AES algorithm supports different key lengths (such as 128, 192 285 and 256 bits) this information has to be specified as well and the 286 selected ciphersuite supports 128 bit keys. A block cipher encrypts 287 plaintext in fixed-size blocks and AES operates on fixed block size 288 of 128 bits. For messages exceeding 128 bits, the message is 289 partitioned into 128-bit blocks and the AES cipher is applied to 290 these input blocks with appropriate chaining, which is called mode of 291 operation. 293 TLS 1.2 introduced Authenticated Encryption with Associated Data 294 (AEAD) ciphersuites [RFC5116]. AEAD is a class of block cipher modes 295 which encrypt (parts of) the message and authenticate the message 296 simultaneously. Examples of such modes include the Counter with CBC- 297 MAC (CCM) mode, and the Galois/Counter Mode (GCM). 299 Some AEAD ciphersuites have shorter authentication tags and are 300 therefore more suitable for networks with low bandwidth where small 301 message size matters. The TLS_PSK_WITH_AES_128_CCM_8 ciphersuite 302 that ends in "_8" has an 8-octet authentication tag, while the 303 regular CCM ciphersuites have 16-octet authentication tags. 305 TLS 1.2 also replaced the combination of MD5/SHA-1 hash functions in 306 the TLS pseudo random function (PRF) with cipher-suite-specified 307 PRFs. For this reason authors of more recent TLS 1.2 ciphersuite 308 specifications explicitly indicate the MAC algorithm and the hash 309 functions used with the TLS PRF. 311 This document references the CoAP recommended ciphersuite choices, 312 which have been selected based on implementation and deployment 313 experience from the IoT community. Over time the preference for 314 certain algorithms will, however, change. Not all components of a 315 ciphersuite change at the same speed. Changes are more likely to 316 expect for ciphers, the mode of operation, and the hash algorithms. 318 Some deployment environments will also be impacted by local 319 regulation, which might dictate a certain and less likely for public 320 key algorithms (such as RSA vs. ECC). 322 5. Pre-Shared Secret Authentication with DTLS 324 The use of pre-shared secret credentials is one of the most basic 325 techniques for DTLS since it is both computational efficient and 326 bandwidth conserving. Pre-shared secret based authentication was 327 introduced to TLS with RFC 4279 [RFC4279]. The exchange shown in 328 Figure 2 illustrates the DTLS exchange including the cookie exchange. 329 While the server is not required to initiate a cookie exchange with 330 every handshake, the client is required to implement and to react on 331 it when challenged. 333 Client Server 334 ------ ------ 335 ClientHello --------> 337 <-------- HelloVerifyRequest 338 (contains cookie) 340 ClientHello --------> 341 (with cookie) 342 ServerHello 343 *ServerKeyExchange 344 <-------- ServerHelloDone 345 ClientKeyExchange 346 ChangeCipherSpec 347 Finished --------> 348 ChangeCipherSpec 349 <-------- Finished 351 Application Data <-------> Application Data 353 Legend: 355 * indicates an optional message payload 357 Figure 2: DTLS PSK Authentication including the Cookie Exchange. 359 [RFC4279] does not mandate the use of any particular type of 360 identity. Hence, the TLS client and server clearly have to agree on 361 the identities and keys to be used. The mandated encoding of 362 identities in Section 5.1 of RFC 4279 aims to improve 363 interoperability for those cases where the identity is configured by 364 a person using some management interface. Many IoT devices do, 365 however, not have a user interface and most of their credentials are 366 bound to the device rather than the user. Furthermore, credentials 367 are provisioned into trusted hardware modules or in the firmware by 368 the developers. As such, the encoding considerations are not 369 applicable to this usage environment. For use with this profile the 370 PSK identities SHOULD NOT assume a structured format (as domain 371 names, Distinguished Names, or IP addresses have) and a bit-by-bit 372 comparison operation can then be used by the server-side 373 infrastructure. 375 As described in Section 3 clients may have pre-shared keys with 376 several different servers. The client indicates which key it uses by 377 including a "PSK identity" in the ClientKeyExchange message. To help 378 the client in selecting which PSK identity / PSK pair to use, the 379 server can provide a "PSK identity hint" in the ServerKeyExchange 380 message. For IoT environments a simplifying assumption is made that 381 the hint for PSK key selection is based on the domain name of the 382 server. Hence, servers SHOULD NOT send the "PSK identity hint" in 383 the ServerKeyExchange message and client MUST ignore the message. 384 This approach is inline with RFC 4279 [RFC4279]. 386 RFC 4279 requires TLS implementations supporting PSK ciphersuites to 387 support arbitrary PSK identities up to 128 octets in length, and 388 arbitrary PSKs up to 64 octets in length. This is a useful 389 assumption for TLS stacks used in the desktop and mobile environment 390 where management interfaces are used to provision identities and 391 keys. For the IoT environment, however, many devices are not 392 equipped with displays and input devices (e.g., keyboards). Hence, 393 keys are distributed as part of hardware modules or are embedded into 394 the firmware. As such, these restrictions are not applicable to this 395 profile. 397 Constrained Application Protocol (CoAP) [RFC7252] currently specifies 398 TLS_PSK_WITH_AES_128_CCM_8 as the mandatory to implement ciphersuite 399 for use with shared secrets. This ciphersuite uses the AES algorithm 400 with 128 bit keys and CCM as the mode of operation. The label "_8" 401 indicates that an 8-octet authentication tag is used. This 402 ciphersuite makes use of the default TLS 1.2 Pseudorandom Function 403 (PRF), which uses HMAC with the SHA-256 hash function. 405 6. Raw Public Key Use with DTLS 407 The use of raw public keys with DTLS, as defined in [RFC7250], is the 408 first entry point into public key cryptography without having to pay 409 the price of certificates and a PKI. The specification re-uses the 410 existing Certificate message to convey the raw public key encoded in 411 the SubjectPublicKeyInfo structure. To indicate support two new TLS 412 extensions had been defined, as shown in Figure 3, namely the 413 server_certificate_type and the client_certificate_type. To operate 414 this mechanism securely it is necessary to authenticate and authorize 415 the public keys out-of-band. This document therefore assumes that a 416 client implementation comes with one or multiple raw public keys of 417 servers, it has to communicate with, pre-provisioned. Additionally, 418 a device will have its own raw public key. To replace, delete, or 419 add raw public key to this list requires a software update, for 420 example using a firmware update mechanism. 422 Client Server 423 ------ ------ 425 ClientHello --------> 426 client_certificate_type 427 server_certificate_type 429 <------- HelloVerifyRequest 431 ClientHello --------> 432 client_certificate_type 433 server_certificate_type 435 ServerHello 436 client_certificate_type 437 server_certificate_type 438 Certificate 439 ServerKeyExchange 440 CertificateRequest 441 <-------- ServerHelloDone 443 Certificate 444 ClientKeyExchange 445 CertificateVerify 446 [ChangeCipherSpec] 447 Finished --------> 449 [ChangeCipherSpec] 450 <-------- Finished 452 Figure 3: DTLS Raw Public Key Exchange including the Cookie Exchange. 454 The CoAP recommended ciphersuite for use with this credential type is 455 TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 [RFC7251]. This elliptic curve 456 cryptography (ECC) based AES-CCM TLS ciphersuite uses the Elliptic 457 Curve Diffie-Hellman (ECDHE) as the key establishment mechanism and 458 an Elliptic Curve Digital Signature Algorithm (ECDSA) for 459 authentication. This ciphersuite make use of the AEAD capability in 460 DTLS 1.2 and utilizes an eight-octet authentication tag. The use of 461 a Diffie-Hellman key exchange adds perfect forward secrecy (PFS). 462 More details about PFS can be found in Section 11. 464 RFC 6090 [RFC6090] provides valuable information for implementing 465 Elliptic Curve Cryptography algorithms. 467 Since many IoT devices will either have limited ways to log error or 468 no ability at all, any error will lead to implementations attempting 469 to re-try the exchange. 471 7. Certificate Use with DTLS 473 The use of mutual certificate-based authentication is shown in 474 Figure 4, which makes use of the cached info extension 475 [I-D.ietf-tls-cached-info]. Support of the cached info extension is 476 required. Caching certificate chains allows the client to reduce the 477 communication overhead significantly since otherwise the server would 478 provide the end entity certificate, and the certificate chain. 479 Because certificate validation requires that root keys be distributed 480 independently, the self-signed certificate that specifies the root 481 certificate authority is omitted from the chain. Client 482 implementations MUST be provisioned with a trust anchor store that 483 contains the root certificates. The use of the Trust Anchor 484 Management Protocol (TAMP) [RFC5934] is, however, not envisioned. 485 Instead IoT devices using this profile MUST rely a software update 486 mechanism to provision these trust anchors. 488 When DTLS is used to secure CoAP messages then the server provided 489 certificates MUST contain the fully qualified DNS domain name or 490 "FQDN". The coaps URI scheme is described in Section 6.2 of 491 [RFC7252]. This FQDN is stored in the SubjectAltName or in the CN, 492 as explained in Section 9.1.3.3 of [RFC7252], and used by the client 493 to match it against the FQDN used during the look-up process, as 494 described in RFC 6125 [RFC6125]. For the profile in this 495 specification does not assume dynamic discovery of local servers. 497 For client certificates the identifier used in the SubjectAltName or 498 in the CN MUST be an EUI-64 [EUI64], as mandated in Section 9.1.3.3 499 of [RFC7252]. 501 For certificate revocation neither the Online Certificate Status 502 Protocol (OCSP) nor Certificate Revocation Lists (CRLs) are used. 503 Instead, this profile relies on a software update mechanism. While 504 multiple OCSP stapling [RFC6961] has recently been introduced as a 505 mechanism to piggyback OCSP request/responses inside the DTLS/TLS 506 handshake to avoid the cost of a separate protocol handshake further 507 investigations are needed to determine its suitability for the IoT 508 environment. 510 Client Server 511 ------ ------ 513 ClientHello --------> 514 cached_information 516 <------- HelloVerifyRequest 518 ClientHello --------> 519 cached_information 520 ServerHello 521 cached_information 522 Certificate 523 ServerKeyExchange 524 CertificateRequest 525 <-------- ServerHelloDone 527 Certificate 528 ClientKeyExchange 529 CertificateVerify 530 [ChangeCipherSpec] 531 Finished --------> 533 [ChangeCipherSpec] 534 <-------- Finished 536 Figure 4: DTLS Mutual Certificate-based Authentication. 538 Regarding the ciphersuite choice the discussion in Section 6 applies. 539 Further details about X.509 certificates can be found in 540 Section 9.1.3.3 of [RFC7252]. 542 8. Error Handling 544 DTLS uses the Alert protocol to convey error messages and specifies a 545 longer list of errors. However, not all error messages defined in 546 the TLS specification are applicable to this profile. All error 547 messages marked as RESERVED are only supported for backwards 548 compatibility with SSL and are therefore not applicable to this 549 profile. Those include decryption_failed_RESERVED, 550 no_certificate_RESERVE, and export_restriction_RESERVED. 552 A number of the error messages are applicable only for certificate- 553 based authentication ciphersuites. Hence, for PSK and raw public key 554 use the following error messages are not applicable: 556 o bad_certificate, 558 o unsupported_certificate, 560 o certificate_revoked, 562 o certificate_expired, 564 o certificate_unknown, 566 o unknown_ca, and 568 o access_denied. 570 Since this profile does not make use of compression at the TLS layer 571 the decompression_failure error message is not applicable either. 573 RFC 4279 introduced a new alert message unknown_psk_identity for PSK 574 ciphersuites. As stated in Section 2 of RFC 4279 the 575 decryption_error error message may also be used instead. For this 576 profile the TLS server MUST return the decryption_error error message 577 instead of the unknown_psk_identity. 579 Furthermore, the following errors should not occur based on the 580 description in this specification: 582 protocol_version: This document only focuses on one version of the 583 DTLS protocol. 585 insufficient_security: This error message indicates that the server 586 requires ciphers to be more secure. This document does, however, 587 specify the only acceptable ciphersuites and client 588 implementations must support them. 590 user_canceled: The IoT devices in focus of this specification are 591 assumed to be unattended. 593 9. Session Resumption 595 Session resumption is a feature of DTLS that allows a client to 596 continue with an earlier established session state. The resulting 597 exchange is shown in Figure 5. In addition, the server may choose 598 not to do a cookie exchange when a session is resumed. Still, 599 clients have to be prepared to do a cookie exchange with every 600 handshake. 602 Client Server 603 ------ ------ 605 ClientHello --------> 606 ServerHello 607 [ChangeCipherSpec] 608 <-------- Finished 609 [ChangeCipherSpec] 610 Finished --------> 611 Application Data <-------> Application Data 613 Figure 5: DTLS Session Resumption. 615 Clients MUST implement session resumption to improve the performance 616 of the handshake (in terms of reduced number of message exchanges, 617 lower computational overhead, and less bandwidth conserved). 619 Since the communication model described in Section 3 does not assume 620 that the server is constrained. RFC 5077 [RFC5077] describing TLS 621 session resumption without server-side state is not utilized by this 622 profile. 624 10. Compression 626 [I-D.ietf-uta-tls-bcp] recommends to always disable DTLS-level 627 compression due to attacks. For IoT applications compression at the 628 DTLS is not needed since application layer protocols are highly 629 optimized and the compression algorithms at the DTLS layer increase 630 code size and complexity. 632 This DTLS client profile does not include DTLS layer compression. 634 11. Perfect Forward Secrecy 636 Perfect forward secrecy (PFS) is designed to prevent the compromise 637 of a long-term secret key from affecting the confidentiality of past 638 conversations. The PSK ciphersuite recommended in the CoAP 639 specification [RFC7252] does not offer this property since it does 640 not utilize a Diffie-Hellman exchange. [I-D.ietf-uta-tls-bcp] on the 641 other hand recommends using ciphersuites offering this security 642 property and so do the public key-based ciphersuites recommended by 643 the CoAP specification. 645 The use of PFS is certainly a trade-off decision since on one hand 646 the compromise of long-term secrets of embedded devices is more 647 likely than with many other Internet hosts but on the other hand a 648 Diffie-Hellman exchange requires ephemeral key pairs to be generated, 649 which can be demanding from a performance point of view. Finally, 650 the impact of the disclosure of past conversations and the desire to 651 increase the cost for pervasive monitoring (see [RFC7258]) has to be 652 taken into account. 654 Our recommendation is to stick with the ciphersuite suggested in the 655 CoAP specification. New ciphersuites support PFS for pre-shared 656 secret-based authentication, such as 657 [I-D.schmertmann-dice-ccm-psk-pfs], and might be available as a 658 standardized ciphersuite in the future. 660 12. Keep-Alive 662 RFC 6520 [RFC6520] defines a heartbeat mechanism to test whether the 663 other peer is still alive. The same mechanism can also be used to 664 perform Path Maximum Transmission Unit (MTU) Discovery. 666 A recommendation about the use of RFC 6520 depends on the type of 667 message exchange an IoT device performs. There are three types of 668 exchanges that need to be analysed: 670 Client-Initiated, One-Shot Messages 672 This is a common communication pattern where IoT devices upload 673 data to a server on the Internet on an irregular basis. The 674 communication may be triggered by specific events, such as opening 675 a door. 677 Since the upload happens on an irregular and unpredictable basis 678 and due to renumbering and Network Address Translation (NAT) a new 679 DTLS session or DTLS session resumption can be used. 681 In this case there is no use for a keep-alive extension for this 682 scenario. 684 Client-Initiated, Regular Data Uploads 686 This is a variation of the previous case whereby data gets 687 uploaded on a regular basis, for example, based on frequent 688 temperature readings. With such regular exchange it can be 689 assumed that the DTLS context is still in kept at the IoT device. 690 If neither NAT bindings nor IP address changes occurred then the 691 DTLS record layer will not notice any changes. For the case where 692 IP and port changes happened it is necessary to re-create the DTLS 693 record layer using session resumption. 695 In this scenario there is no use for a keep-alive extension. It 696 is also very likely that the device will enter a sleep cycle in 697 between data transmissions to keep power consumption low. 699 Server-Initiated Messages 701 In the two previous scenarios the client initiated the protocol 702 interaction. In this case, we consider server-initiated messages. 703 Since messages to the client may get blocked by intermediaries, 704 such as NATs and stateful packet filtering firewalls, the initial 705 connection setup is triggered by the client and then kept alive. 706 Since state expires fairly quickly at middleboxes regular 707 heartbeats are necessary whereby these keep-alive messages may be 708 exchanged at the application layer or within DTLS itself. 710 For this message exchange pattern the use of DTLS heartbeat 711 messages is quite useful. The MTU discovery mechanism, on the 712 other hand, is less likely to be relevant since for many IoT 713 deployments the must constrained link is the wireless interface at 714 the IoT device itself rather than somewhere in the network. Only 715 in more complex network topologies the situation might be 716 different. 718 For server-initiated messages the heartbeat extension can be 719 recommended. 721 13. Random Number Generation 723 The DTLS protocol requires random numbers to be available during the 724 protocol run. For example, during the ClientHello and the 725 ServerHello exchange the client and the server exchange random 726 numbers. Also, the use of the Diffie-Hellman exchange requires 727 random numbers during the key pair generation. Special care has to 728 be paid when generating random numbers in embedded systems as many 729 entropy sources available on desktop operating systems or mobile 730 devices might be missing, as described in [Heninger]. Consequently, 731 if not enough time is given during system start time to fill the 732 entropy pool then the output might be predictable and repeatable, for 733 example leading to the same keys generated again and again. 735 Recommendation: IoT devices using DTLS MUST offer ways to generate 736 quality random numbers. Guidelines and requirements for random 737 number generation can be found in RFC 4086 [RFC4086]. 739 It is important to note that sources contributing to the randomness 740 pool on laptops, or desktop PCs are not available on many IoT device, 741 such as mouse movement, timing of keystrokes, air turbulence on the 742 movement of hard drive heads, etc. Other sources have to be found or 743 dedicated hardware has to be added. 745 14. Client Certificate URLs 747 This RFC 6066 [RFC6066] extension allows to avoid sending client-side 748 certificates and URLs instead. This reduces the over-the-air 749 transmission. 751 This is certainly a useful extension when a certificate-based mode 752 for DTLS is used since the TLS cached info extension does not provide 753 any help with caching information on the server side. 755 Recommendation: Add support for client certificate URLs for those 756 environments where client-side certificates are used. 758 15. Trusted CA Indication 760 This RFC 6066 extension allows clients to indicate what trust anchor 761 they support. With certificate-based authentication a DTLS server 762 conveys its end entity certificate to the client during the DTLS 763 exchange provides. Since the server does not necessarily know what 764 trust anchors the client has stored it includes intermediate CA certs 765 in the certificate payload as well to facilitate with certification 766 path construction and path validation. 768 Today, in most IoT deployments there is a fairly static relationship 769 between the IoT device (and the software running on them) and the 770 server- side infrastructure and no such dynamic indication of trust 771 anchors is needed. 773 Recommendation: For IoT deployments where clients talk to a fixed, 774 pre-configured set of servers and where a software update mechanism 775 is available this extension is not recommended. Environments where 776 the client needs to interact with dynamically discovered DTLS servers 777 this extension may be useful to reduce the communication overhead. 778 Note, however, in that case the TLS cached info extension may help to 779 reduce the communication overhead for everything but the first 780 protocol interaction. 782 16. Truncated MAC Extension 784 This RFC 6066 extension was introduced to reduces the size of the MAC 785 used at the Record Layer. This extension was developed for TLS 786 ciphersuites that used older modes of operation where the MAC and the 787 encryption operation was performed independently. 789 For CoAP, however, the recommended ciphersuites use the newer 790 Authenticated Encryption with Associated Data (AEAD) construct, 791 namely the CBC-MAC mode (CCM) with eight-octet authentication tags. 793 Recommendation: Since this profile only supports AEAD ciphersuites 794 this extension is not applicable. 796 17. Server Name Indication (SNI) 798 This RFC 6066 extension defines a mechanism for a client to tell a 799 TLS server the name of the server it wants to contact. This is a 800 useful extension for many hosting environments where multiple virtual 801 servers are run on single IP address. 803 Recommendation: Unless it is known that a DTLS client does not 804 interact with a server in a hosting environment that requires such an 805 extension we advice to offer support for the SNI extension in this 806 profile. 808 18. Maximum Fragment Length Negotiation 810 This RFC 6066 extension lowers the maximum fragment length support 811 needed for the Record Layer from 2^14 bytes to 2^9 bytes. 813 This is a very useful extension that allows the client to indicate to 814 the server how much maximum memory buffers it uses for incoming 815 messages. Ultimately, the main benefit of this extension is it to 816 allows client implementations to lower their RAM requirements since 817 the client does not need to accept packets of large size (such as 16k 818 packets as required by plain TLS/DTLS). 820 Recommendation: Client implementations must support this extension. 822 19. Negotiation and Downgrading Attacks 824 CoAP demands version 1.2 of DTLS to be used and the earlier version 825 of DTLS is not supported. As such, there is no risk of downgrading 826 to an older version of DTLS. The work described in 827 [I-D.bmoeller-tls-downgrade-scsv] is therefore also not applicable to 828 this environment since there is no legacy server infrastructure to 829 worry about. 831 To prevent the TLS renegotiation attack [RFC5746] clients MUST 832 respond to server-initiated renegotiation attempts with an Alert 833 message (no_renegotiation) and clients MUST NOT initiate them. TLS 834 and DTLS allows a client and a server who already have a TLS 835 connection to negotiate new parameters, generate new keys, etc by 836 initiating a TLS handshake using a ClientHello message. 837 Renegotiation happens in the existing TLS connection, with the new 838 handshake packets being encrypted along with application data. 840 20. Privacy Considerations 842 The DTLS handshake exchange conveys various identifiers, which can be 843 observed by an on-path eavesdropper. For example, the DTLS PSK 844 exchange reveals the PSK identity, the supported extensions, the 845 session id, algorithm parameters, etc. When session resumption is 846 used then individual TLS sessions can be correlated by an on-path 847 adversary. With many IoT deployments it is likely that keying 848 material and their identifiers are persistent over a longer period of 849 time due to the cost of updating software on these devices. 851 User participation with many IoT deployments poses a challenge since 852 many of the IoT devices operate unattended, even though they will 853 initially be enabled by a human. The ability to control data sharing 854 and to configure preference will have to be provided at a system 855 level rather than at the level of a DTLS profile, which is the scope 856 of this document. Quite naturally, the use of DTLS with mutual 857 authentication will allow a TLS server to collect authentication 858 information about the IoT device (potentially over a long period of 859 time). While this strong form of authentication will prevent mis- 860 attribution it also allows strong identification. This device- 861 related data collection (e.g., sensor recordings) will be associated 862 with other data to be truly useful and this extra data might include 863 personal data about the owner of the device or data about the 864 environment it senses. Consequently, the data stored on the server- 865 side will be vulnerable to stored data compromise. For the 866 communication between the client and the server this specification 867 prevents eavesdroppers to gain access to the communication content. 868 While the PSK-based ciphersuite does not provide PFS the asymmetric 869 version does. No explicit techniques, such as extra padding, have 870 been provided to make traffic analysis more difficult. 872 21. Security Considerations 874 This entire document is about security. 876 We would also like to point out that designing a software update 877 mechanism into an IoT system is crucial to ensure that both 878 functionality can be enhanced and that potential vulnerabilities can 879 be fixed. This software update mechanism is also useful for changing 880 configuration information, for example, trust anchors and other 881 keying related information. 883 22. IANA Considerations 885 This document includes no request to IANA. 887 23. Acknowledgements 889 Thanks to Rene Hummen, Sye Loong Keoh, Sandeep Kumar, Eric Rescorla, 890 Russ Housley, Michael Richardson, Zach Shelby, and Sean Turner for 891 their helpful comments and discussions that have shaped the document. 893 Big thanks also to Klaus Hartke, who wrote the initial version of 894 this document. 896 24. References 898 24.1. Normative References 900 [EUI64] "GUIDELINES FOR 64-BIT GLOBAL IDENTIFIER (EUI-64) 901 REGISTRATION AUTHORITY", April 2010, 902 . 905 [I-D.ietf-tls-cached-info] 906 Santesson, S. and H. Tschofenig, "Transport Layer Security 907 (TLS) Cached Information Extension", draft-ietf-tls- 908 cached-info-16 (work in progress), February 2014. 910 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 911 Requirement Levels", BCP 14, RFC 2119, March 1997. 913 [RFC4279] Eronen, P. and H. Tschofenig, "Pre-Shared Key Ciphersuites 914 for Transport Layer Security (TLS)", RFC 4279, December 915 2005. 917 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 918 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 920 [RFC5746] Rescorla, E., Ray, M., Dispensa, S., and N. Oskov, 921 "Transport Layer Security (TLS) Renegotiation Indication 922 Extension", RFC 5746, February 2010. 924 [RFC6066] Eastlake, D., "Transport Layer Security (TLS) Extensions: 925 Extension Definitions", RFC 6066, January 2011. 927 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 928 Verification of Domain-Based Application Service Identity 929 within Internet Public Key Infrastructure Using X.509 930 (PKIX) Certificates in the Context of Transport Layer 931 Security (TLS)", RFC 6125, March 2011. 933 [RFC6347] Rescorla, E. and N. Modadugu, "Datagram Transport Layer 934 Security Version 1.2", RFC 6347, January 2012. 936 [RFC6520] Seggelmann, R., Tuexen, M., and M. Williams, "Transport 937 Layer Security (TLS) and Datagram Transport Layer Security 938 (DTLS) Heartbeat Extension", RFC 6520, February 2012. 940 [RFC7250] Wouters, P., Tschofenig, H., Gilmore, J., Weiler, S., and 941 T. Kivinen, "Using Raw Public Keys in Transport Layer 942 Security (TLS) and Datagram Transport Layer Security 943 (DTLS)", RFC 7250, June 2014. 945 [RFC7251] McGrew, D., Bailey, D., Campagna, M., and R. Dugal, "AES- 946 CCM Elliptic Curve Cryptography (ECC) Cipher Suites for 947 TLS", RFC 7251, June 2014. 949 24.2. Informative References 951 [Heninger] 952 Heninger, N., Durumeric, Z., Wustrow, E., and A. 953 Halderman, "Mining Your Ps and Qs: Detection of Widespread 954 Weak Keys in Network Devices", 21st USENIX Security 955 Symposium, 956 https://www.usenix.org/conference/usenixsecurity12/ 957 technical-sessions/presentation/heninger, 2012. 959 [I-D.bmoeller-tls-downgrade-scsv] 960 Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher 961 Suite Value (SCSV) for Preventing Protocol Downgrade 962 Attacks", draft-bmoeller-tls-downgrade-scsv-02 (work in 963 progress), May 2014. 965 [I-D.cooper-ietf-privacy-requirements] 966 Cooper, A., Farrell, S., and S. Turner, "Privacy 967 Requirements for IETF Protocols", draft-cooper-ietf- 968 privacy-requirements-01 (work in progress), October 2013. 970 [I-D.ietf-lwig-tls-minimal] 971 Kumar, S., Keoh, S., and H. Tschofenig, "A Hitchhiker's 972 Guide to the (Datagram) Transport Layer Security Protocol 973 for Smart Objects and Constrained Node Networks", draft- 974 ietf-lwig-tls-minimal-01 (work in progress), March 2014. 976 [I-D.ietf-uta-tls-bcp] 977 Sheffer, Y., Holz, R., and P. Saint-Andre, 978 "Recommendations for Secure Use of TLS and DTLS", draft- 979 ietf-uta-tls-bcp-01 (work in progress), June 2014. 981 [I-D.schmertmann-dice-ccm-psk-pfs] 982 Schmertmann, L. and C. Bormann, "ECDHE-PSK AES-CCM Cipher 983 Suites with Forward Secrecy for Transport Layer Security 984 (TLS)", draft-schmertmann-dice-ccm-psk-pfs-00 (work in 985 progress), February 2014. 987 [IANA-TLS] 988 IANA, "TLS Cipher Suite Registry", 989 http://www.iana.org/assignments/tls-parameters/ 990 tls-parameters.xhtml#tls-parameters-4, 2014. 992 [RFC3552] Rescorla, E. and B. Korver, "Guidelines for Writing RFC 993 Text on Security Considerations", BCP 72, RFC 3552, July 994 2003. 996 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 997 Requirements for Security", BCP 106, RFC 4086, June 2005. 999 [RFC4492] Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C., and B. 1000 Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites 1001 for Transport Layer Security (TLS)", RFC 4492, May 2006. 1003 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 1004 "Transport Layer Security (TLS) Session Resumption without 1005 Server-Side State", RFC 5077, January 2008. 1007 [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated 1008 Encryption", RFC 5116, January 2008. 1010 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1011 Housley, R., and W. Polk, "Internet X.509 Public Key 1012 Infrastructure Certificate and Certificate Revocation List 1013 (CRL) Profile", RFC 5280, May 2008. 1015 [RFC5289] Rescorla, E., "TLS Elliptic Curve Cipher Suites with SHA- 1016 256/384 and AES Galois Counter Mode (GCM)", RFC 5289, 1017 August 2008. 1019 [RFC5934] Housley, R., Ashmore, S., and C. Wallace, "Trust Anchor 1020 Management Protocol (TAMP)", RFC 5934, August 2010. 1022 [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic 1023 Curve Cryptography Algorithms", RFC 6090, February 2011. 1025 [RFC6655] McGrew, D. and D. Bailey, "AES-CCM Cipher Suites for 1026 Transport Layer Security (TLS)", RFC 6655, July 2012. 1028 [RFC6961] Pettersen, Y., "The Transport Layer Security (TLS) 1029 Multiple Certificate Status Request Extension", RFC 6961, 1030 June 2013. 1032 [RFC6973] Cooper, A., Tschofenig, H., Aboba, B., Peterson, J., 1033 Morris, J., Hansen, M., and R. Smith, "Privacy 1034 Considerations for Internet Protocols", RFC 6973, July 1035 2013. 1037 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 1038 Application Protocol (CoAP)", RFC 7252, June 2014. 1040 [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an 1041 Attack", BCP 188, RFC 7258, May 2014. 1043 Author's Address 1045 Hannes Tschofenig (editor) 1046 ARM Ltd. 1047 110 Fulbourn Rd 1048 Cambridge CB1 9NJ 1049 Great Britain 1051 Email: Hannes.tschofenig@gmx.net 1052 URI: http://www.tschofenig.priv.at