idnits 2.17.1 draft-sheffer-tls-pinning-ticket-04.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 == Line 404 has weird spacing: '... ticket a pin...' == Line 408 has weird spacing: '... proof a dem...' == Line 413 has weird spacing: '...ifetime the d...' -- The document date (April 02, 2017) is 2580 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) == Outdated reference: A later version (-28) exists of draft-ietf-tls-tls13-14 ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Obsolete normative reference: RFC 5077 (Obsoleted by RFC 8446) -- Obsolete informational reference (is this intentional?): RFC 6962 (Obsoleted by RFC 9162) -- Obsolete informational reference (is this intentional?): RFC 7507 (Obsoleted by RFC 8996) Summary: 2 errors (**), 0 flaws (~~), 5 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Y. Sheffer 3 Internet-Draft Intuit 4 Intended status: Standards Track D. Migault 5 Expires: October 4, 2017 Ericsson 6 April 02, 2017 8 TLS Server Identity Pinning with Tickets 9 draft-sheffer-tls-pinning-ticket-04 11 Abstract 13 Misissued public-key certificates can prevent TLS clients from 14 appropriately authenticating the TLS server. Several alternatives 15 have been proposed to detect this situation and prevent a client from 16 establishing a TLS session with a TLS end point authenticated with an 17 illegitimate public-key certificate, but none is currently in wide 18 use. 20 This document proposes to extend TLS with opaque pinning tickets as a 21 way to pin the server's identity. During an initial TLS session, the 22 server provides an original encrypted pinning ticket. In subsequent 23 TLS session establishment, upon receipt of the pinning ticket, the 24 server proves its ability to decrypt the pinning ticket and thus the 25 ownership if the pinning protection key. The client can now safely 26 conclude that the TLS session is established with the same TLS server 27 as the original TLS session. One of the important properties of this 28 proposal is that no manual management actions are required. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at http://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on October 4, 2017. 47 Copyright Notice 49 Copyright (c) 2017 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (http://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 65 1.1. Conventions used in this document . . . . . . . . . . . . 5 66 2. Protocol Overview . . . . . . . . . . . . . . . . . . . . . . 5 67 2.1. Initial Connection . . . . . . . . . . . . . . . . . . . 6 68 2.2. Subsequent Connections . . . . . . . . . . . . . . . . . 8 69 2.3. Indexing the Pins . . . . . . . . . . . . . . . . . . . . 9 70 3. Message Definitions . . . . . . . . . . . . . . . . . . . . . 9 71 4. Cryptographic Operations . . . . . . . . . . . . . . . . . . 10 72 4.1. Pinning Secret . . . . . . . . . . . . . . . . . . . . . 10 73 4.2. Pinning Ticket . . . . . . . . . . . . . . . . . . . . . 10 74 4.3. Pinning Protection Key . . . . . . . . . . . . . . . . . 11 75 4.4. Pinning Proof . . . . . . . . . . . . . . . . . . . . . . 11 76 5. Operational Considerations . . . . . . . . . . . . . . . . . 12 77 5.1. Protection Key Synchronization . . . . . . . . . . . . . 12 78 5.2. Ticket Lifetime . . . . . . . . . . . . . . . . . . . . . 12 79 5.3. Certificate Renewal . . . . . . . . . . . . . . . . . . . 12 80 5.4. Certificate Revocation . . . . . . . . . . . . . . . . . 13 81 5.5. Disabling Pinning . . . . . . . . . . . . . . . . . . . . 13 82 5.6. Server Compromise . . . . . . . . . . . . . . . . . . . . 13 83 5.7. Disaster Recovery . . . . . . . . . . . . . . . . . . . . 13 84 6. Previous Work . . . . . . . . . . . . . . . . . . . . . . . . 14 85 6.1. Comparison: HPKP Deployment . . . . . . . . . . . . . . . 14 86 6.2. Comparison: TACK . . . . . . . . . . . . . . . . . . . . 15 87 7. Implementation Status . . . . . . . . . . . . . . . . . . . . 16 88 7.1. Mint Fork . . . . . . . . . . . . . . . . . . . . . . . . 17 89 7.1.1. Overview . . . . . . . . . . . . . . . . . . . . . . 17 90 7.1.2. Description . . . . . . . . . . . . . . . . . . . . . 17 91 7.1.3. Level of Maturity . . . . . . . . . . . . . . . . . . 17 92 7.1.4. Coverage . . . . . . . . . . . . . . . . . . . . . . 17 93 7.1.5. Version Compatibility . . . . . . . . . . . . . . . . 17 94 7.1.6. Licensing . . . . . . . . . . . . . . . . . . . . . . 17 95 7.1.7. Contact Information . . . . . . . . . . . . . . . . . 17 96 8. Security Considerations . . . . . . . . . . . . . . . . . . . 17 97 8.1. Trust on First Use (TOFU) and MITM Attacks . . . . . . . 18 98 8.2. Pervasive Monitoring . . . . . . . . . . . . . . . . . . 18 99 8.3. Server-Side Error Detection . . . . . . . . . . . . . . . 18 100 8.4. Client Policy and SSL Proxies . . . . . . . . . . . . . . 18 101 8.5. Client-Side Error Behavior . . . . . . . . . . . . . . . 19 102 8.6. Stolen and Forged Tickets . . . . . . . . . . . . . . . . 19 103 8.7. Client Privacy . . . . . . . . . . . . . . . . . . . . . 19 104 8.8. Ticket Protection Key Management . . . . . . . . . . . . 19 105 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 106 10. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 20 107 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 20 108 11.1. Normative References . . . . . . . . . . . . . . . . . . 20 109 11.2. Informative References . . . . . . . . . . . . . . . . . 21 110 Appendix A. Document History . . . . . . . . . . . . . . . . . . 22 111 A.1. draft-sheffer-tls-pinning-ticket-03 . . . . . . . . . . . 22 112 A.2. draft-sheffer-tls-pinning-ticket-02 . . . . . . . . . . . 22 113 A.3. draft-sheffer-tls-pinning-ticket-01 . . . . . . . . . . . 22 114 A.4. draft-sheffer-tls-pinning-ticket-00 . . . . . . . . . . . 22 115 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 117 1. Introduction 119 The weaknesses of the global PKI system are by now widely known. 120 Essentially, any valid CA may issue a certificate for any 121 organization without the organization's approval (a misissued or 122 "fake" certificate), and use the certificate to impersonate the 123 organization. There are many attempts to resolve these weaknesses, 124 including Certificate Transparency (CT) [RFC6962], HTTP Public Key 125 Pinning (HPKP) [RFC7469], and TACK [I-D.perrin-tls-tack]. CT 126 requires cooperation of a large portion of the hundreds of extant 127 certificate authorities (CAs) before it can be used "for real", in 128 enforcing mode. It is noted that the relevant industry forum (CA/ 129 Browser Forum) is indeed pushing for such extensive adoption. TACK 130 has some similarities to the current proposal, but work on it seems 131 to have stalled. Section 6.2 compares our proposal to TACK. 133 HPKP is an IETF standard, but so far has proven hard to deploy. HPKP 134 cannot be completely automated resulting in error-prone manual 135 configuration. Such errors could prevent the web server from being 136 accessed by some clients. In addition, HPKP uses a HTTP header which 137 makes this solution HTTPS specific and not generic to TLS. On the 138 other hand, the current document provides a solution that can be 139 entirely automated. Section 6.1 compares HPKP to the current draft 140 in more detail. 142 The ticket pinning proposal augments these mechanisms with a much 143 easier to implement and deploy solution for server identity pinning, 144 by reusing some of the ideas behind TLS session resumption. 146 Ticket pinning is a second factor server authentication method and is 147 not proposed as a substitute of the authentication method provided in 148 the TLS key exchange. More specifically, the client only uses the 149 pinning identity method after the TLS key exchange is successfully 150 completed. In other words, the pinning identity method is only 151 performed over an authenticated TLS session. 153 Ticket pinning is a Trust On First Use (TOFU) mechanism, in that the 154 first server authentication is only based on PKI certificate 155 validation, but for any follow-on sessions, the client is further 156 ensuring the server's identity based on the server's ability to 157 decrypt the ticket, in addition to normal PKI certificate 158 authentication. 160 During initial TLS session establishment, the client requests a 161 pinning ticket from the server. Upon receiving the request the 162 server generates a pinning secret which is expected to be 163 unpredictable for peers other than the client or the server. In our 164 case, the pinning secret is generated from parameters exchanged 165 during the TLS key exchange, so client and server can generate it 166 locally and independently. The server constructs the pinning ticket 167 with the necessary information to retrieve the pinning secret. The 168 server then encrypts the ticket and returns the pinning ticket to the 169 client with an associated pinning lifetime. 171 The pinning lifetime value indicates for how long the server promises 172 to retain the server-side ticket-encryption key, which allows it to 173 complete the protocol exchange correctly and prove its identity. The 174 committed lifetime is typically on the order of weeks or months. 176 Once the key exchange is completed and the server is deemed 177 authenticated, the client generates locally the pinning secret and 178 caches the server's identifiers to index the pinning secret as well 179 as the pinning ticket and its associated lifetime. 181 When the client re-establishes a new TLS session with the server, it 182 sends the pinning ticket to the server. Upon receiving it, the 183 server returns a proof of knowledge of the pinning secret. Once the 184 key exchange is completed and the server has been authenticated, the 185 client checks the pinning proof returned by the server using the 186 client's stored pinning secret. If the proof matches, the client can 187 conclude that the server it is currently connecting to is in fact the 188 correct server. 190 This version of the draft only applies to TLS 1.3. We believe that 191 the idea can also be back-fitted into earlier versions of the 192 protocol. 194 The main advantages of this protocol over earlier pinning solutions 195 are: 197 - The protocol is at the TLS level, and as a result is not 198 restricted to HTTP at the application level. 200 - The protocol is robust to server IP, CA, and public key changes. 201 The server is characterized by the ownership of the pinning 202 protection key, which is never provided to the client. Server 203 configuration parameters such as the CA and the public key may 204 change without affecting the pinning ticket protocol. 206 - Once a single parameter is configured (the ticket's lifetime), 207 operation is fully automated. The server administrator need not 208 bother with the management of backup certificates or explicit 209 pins. 211 - For server clusters, we reuse the existing [RFC5077] 212 infrastructure where it exists. 214 - Pinning errors, presumably resulting from MITM attacks, can be 215 detected both by the client and the server. This allows for 216 server-side detection of MITM attacks using large-scale analytics. 218 A note on terminology: unlike other solutions in this space, we do 219 not do "certificate pinning" (or "public key pinning"), since the 220 protocol is oblivious to the server's certificate. We prefer the 221 term "server identity pinning" for this new solution. 223 1.1. Conventions used in this document 225 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 226 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 227 document are to be interpreted as described in [RFC2119]. 229 2. Protocol Overview 231 The protocol consists of two phases: the first time a particular 232 client connects to a server, and subsequent connections. 234 This protocol supports full TLS handshakes, as well as 0-RTT 235 handshakes. Below we present it in the context of a full handshake, 236 but behavior in 0-RTT handshakes should be identical. 238 The document presents some similarities with the ticket resumption 239 mechanism described in [RFC5077]. However the scope of this document 240 differs from session resumption mechanisms implemented with [RFC5077] 241 or with other mechanisms. Specifically, the pinning ticket does not 242 carry any state associated with a TLS session and thus cannot be used 243 for session resumption, or to authenticate the client. 245 With TLS 1.3, session resumption is based on a preshared key (PSK). 246 This is orthogonal to this protocol. With TLS 1.3, a TLS session can 247 be established using PKI and a pinning ticket, and later resumed with 248 PSK. 250 However, the protocol described in this document addresses the 251 problem of misissued certificates. Thus, it is not expected to be 252 used outside a certificate-based TLS key exchange, such as in PSK. 253 As a result, PSK handshakes MUST NOT include the extension defined 254 here. 256 2.1. Initial Connection 258 When a client first connects to a server, it requests a pinning 259 ticket by sending an empty PinningTicket extension, and receives it 260 as part of the server's first response, in the returned PinningTicket 261 extension. 263 Client Server 265 ClientHello 266 + key_share 267 + PinningTicket --------> 268 ServerHello 269 + key_share 270 {EncryptedExtensions 271 + PinningTicket} 272 {ServerConfiguration*} 273 {Certificate*} 274 {CertificateRequest*} 275 {CertificateVerify*} 276 <-------- {Finished} 277 {Certificate*} 278 {CertificateVerify*} 279 {Finished} --------> 280 [Application Data] <-------> [Application Data] 282 * Indicates optional or situation-dependent 283 messages that are not always sent. 285 {} Indicates messages protected using keys 286 derived from the ephemeral secret. 288 [] Indicates messages protected using keys 289 derived from the master secret. 291 If a client supports the pinning ticket extension and does not have 292 any pinning ticket associated with the server, the exchange is 293 considered as an initial connection. Other reasons the client may 294 not have a pinning ticket include the client having flushed its 295 pinning ticket store, or the committed lifetime of the pinning ticket 296 having expired. 298 Upon receipt of the PinningTicket extension, the server computes a 299 pinning secret (Section 4.1), and sends the pinning ticket 300 (Section 4.2) encrypted with the pinning protection key 301 (Section 4.3). The pinning ticket is associated with a lifetime 302 value by which the server assumes the responsibility of retaining the 303 pinning protection key and being able to decrypt incoming pinning 304 tickets during the period indicated by the committed lifetime. 306 Once the pinning ticket has been generated, the server returns the 307 pinning ticket and the committed lifetime in a PinningTicket 308 extension embedded in the EncryptedExtensions message. We note that 309 a PinningTicket extension MUST NOT be sent as part of a 310 HelloRetryRequest. 312 Upon receiving the pinning ticket, the client MUST NOT accept it 313 until the key exchange is completed and the server authenticated. If 314 the key exchange is not completed successfully, the client MUST 315 ignore the received pinning ticket. Otherwise, the client computes 316 the pinning secret and SHOULD cache the pinning secret and the 317 pinning ticket for the duration indicated by the pinning ticket 318 lifetime. The client SHOULD clean up the cached values at the end of 319 the indicated lifetime. 321 2.2. Subsequent Connections 323 When the client initiates a connection to a server it has previously 324 seen (see Section 2.3 on identifying servers), it SHOULD send the 325 pinning ticket for that server. The pinning ticket, pinning secret 326 and pinning ticket lifetime computed during the establishment of the 327 previous TLS session are designated in this document as the 328 "original" ones, to distinguish them from a new ticket that may be 329 generated during the current session. 331 The server MUST extract the original pinning_secret value from the 332 ticket and MUST respond with a PinningTicket extension, which 333 includes: 335 - A proof that the server can understand the ticket that was sent by 336 the client; this proof also binds the pinning ticket to the 337 server's (current) public key. The proof is MANDATORY if a 338 pinning ticket was sent by the client. 340 - A fresh pinning ticket. The main reason for refreshing the ticket 341 on each connection is privacy: to avoid the ticket serving as a 342 fixed client identifier. It is RECOMMENDED to include a fresh 343 ticket with each response. 345 If the server cannot validate the received ticket, that might 346 indicate an earlier MITM attack on this client. The server MUST then 347 abort the connection with a handshake_failure alert, and SHOULD log 348 this failure. 350 The client MUST verify the proof, and if it fails to do so, MUST 351 issue a handshake_failure alert and abort the connection (see also 352 Section 8.5). It is important that the client does not attempt to 353 "fall back" by omitting the PinningTicket extension. 355 When the connection is successfully set up, i.e. after the Finished 356 message is verified, the client SHOULD store the new ticket along 357 with the corresponding pinning_secret, replacing the original ticket. 359 Although this is an extension, if the client already has a ticket for 360 a server, the client MUST interpret a missing PinningTicket extension 361 in the server's response as an attack, because of the server's prior 362 commitment to respect the ticket. The client MUST abort the 363 connection in this case. See also Section 5.5 on ramping down 364 support for this extension. 366 2.3. Indexing the Pins 368 Each pin is associated with a host name, protocol (TLS or DTLS) and 369 port number. In other words, the pin for port TCP/443 may be 370 different from that for DTLS or from the pin for port TCP/8443. The 371 host name MUST be the value sent inside the Server Name Indication 372 (SNI) extension. This definition is similar to a Web Origin 373 [RFC6454], but does not assume the existence of a URL. 375 The purpose of ticket pinning is to pin the server identity. As a 376 result, any information orthogonal to the server's identity MUST NOT 377 be considered in indexing. More particularly, IP addresses are 378 ephemeral and forbidden in SNI and therefore pins MUST NOT be 379 associated with IP addresses. Similarly, CA names or public keys 380 associated with server MUST NOT be used for indexing as they may 381 change over time. 383 3. Message Definitions 385 This section defines the format of the PinningTicket extension. We 386 follow the message notation of [I-D.ietf-tls-tls13]. 388 opaque pinning_ticket<0..2^16-1>; 390 opaque pinning_proof<0..2^8-1>; 392 struct { 393 select (Role) { 394 case client: 395 pinning_ticket ticket<0..2^16-1>; //omitted on 1st connection 397 case server: 398 pinning_proof proof<0..2^8-1>; //no proof on 1st connection 399 pinning_ticket ticket<0..2^16-1>; //omitted on ramp down 400 uint32 lifetime; 401 } 402 } PinningTicketExtension; 404 ticket a pinning ticket sent by the client or returned by the 405 server. The ticket is opaque to the client. The extension MUST 406 contain exactly 0 or 1 tickets. 408 proof a demonstration by the server that it understands the received 409 ticket and therefore that it is in possession of the secret that 410 was used to generate it originally. The extension MUST contain 411 exactly 0 or 1 proofs. 413 lifetime the duration (in seconds) that the server commits to accept 414 offered tickets in the future. 416 4. Cryptographic Operations 418 This section provides details on the cryptographic operations 419 performed by the protocol peers. 421 4.1. Pinning Secret 423 The pinning secret is generated locally by the client and the server 424 which means they must use the same inputs to generate it. This value 425 must be generated before the ServerHello message is sent, as the 426 server includes the corresponding pinning ticket in the ServerHello 427 message. In addition, the pinning secret must be unpredictable to 428 any party other than the client and the server. 430 The pinning secret is derived using the Derive-Secret function 431 provided by TLS 1.3, described in Section "Key Schedule" of 432 [I-D.ietf-tls-tls13]. 434 pinning secret = Derive-Secret(Handshake Secret, "pinning secret", 435 ClientHello...ServerHello) 437 4.2. Pinning Ticket 439 The pinning ticket contains the pinning secret. The pinning ticket 440 is provided by the client to the server which decrypts it in order to 441 extract the pinning secret and responds with a pinning proof. As a 442 result, the characteristics of the pinning ticket are: 444 - Pinning tickets MUST be encrypted and integrity-protected using 445 strong cryptographic algorithms. 447 - Pinning tickets MUST be protected with a long-term pinning 448 protection key. 450 - Pinning tickets MUST include a pinning protection key ID or serial 451 number as to enable the pinning protection key to be refreshed. 453 - The pinning ticket MAY include other information, in addition to 454 the pinning secret. 456 The pinning ticket's format is not specified by this document, but we 457 RECOMMEND a format similar to the one proposed by [RFC5077]. 459 4.3. Pinning Protection Key 461 The pinning protection key is only used by the server and so remains 462 server implementation specific. [RFC5077] recommends the use of two 463 keys, but when using AEAD algorithms only a single key is required. 465 When a single server terminates TLS for multiple virtual servers 466 using the Server Name Indication (SNI) mechanism, we strongly 467 RECOMMEND to use a separate protection key for each one of them, in 468 order to allow migrating virtual servers between different servers 469 while keeping pinning active. 471 As noted in Section 5.1, if the server is actually a cluster of 472 machines, the protection key MUST be synchronized between them. When 473 [RFC5077] is deployed, an easy way to do it is to derive the 474 protection key from the session-ticket protection key, which is 475 already synchronized. For example: 477 pinning_protection_key = HKDF-Expand(resumption_protection_key, 478 "pinning protection", L) 480 4.4. Pinning Proof 482 The pinning proof is sent by the server to demonstrate that it has 483 been able to decrypt the pinning ticket and retrieve the pinning 484 secret. The proof must be unpredictable and must not be replayed. 485 Similarly to the pinning secret, the pinning proof is sent by the 486 server in the ServerHello message. In addition, it must not be 487 possible for a MITM server with a fake certificate to obtain a 488 pinning proof from the original server. 490 In order to address these requirements, the pinning proof is bound to 491 the TLS session as well as the public key of the server: 493 proof = HMAC(original_pinning_secret, "pinning proof" + 494 Handshake-Secret + Hash(server_public_key)) 496 where HMAC [RFC2104] uses the Hash algorithm that was negotiated in 497 the handshake, and the same hash is also used over the server's 498 public key. The original_pinning_secret value refers to the secret 499 value extracted from the ticket sent by the client, to distinguish it 500 from a new pinning secret value that is possibly computed in the 501 current exchange. The server_public_key value is the DER 502 representation of the public key, specifically the 503 SubjectPublicKeyInfo structure as-is. 505 5. Operational Considerations 507 The main motivation behind the current protocol is to enable identity 508 pinning without the need for manual operations. To achieve this goal 509 operations described in identity pinning are only performed within 510 the current TLS session, and there is no dependence on any TLS 511 configuration parameters such as CA identity or public keys. As a 512 result, configuration changes are unlikely to lead to desynchronized 513 state between the client and the server. Manual operations are 514 susceptible to human error and in the case of public key pinning, can 515 easily result in "server bricking": the server becoming inaccessible 516 to some or all of its users. 518 5.1. Protection Key Synchronization 520 The only operational requirement when deploying this protocol is that 521 if the server is part of a cluster, protection keys (the keys used to 522 encrypt tickets) MUST be synchronized between all cluster members. 523 The protocol is designed so that if resumption ticket protection keys 524 [RFC5077] are already synchronized between cluster members, nothing 525 more needs to be done. 527 Moreover, synchronization does not need to be instantaneous, e.g. 528 protection keys can be distributed a few minutes or hours in advance 529 of their rollover. In such scenarios, each cluster member MUST be 530 able to accept tickets protected with a new version of the protection 531 key, even while it is still using an old version to generate keys. 532 This ensures that a client that receives a "new" ticket does not next 533 hit a cluster member that still rejects this ticket. 535 Misconfiguration can lead to the server's clock being off by a large 536 amount of time. Therefore we RECOMMEND never to automatically delete 537 protection keys, even when they are long expired. 539 5.2. Ticket Lifetime 541 The lifetime of the ticket is a commitment by the server to retain 542 the ticket's corresponding protection key for this duration, so that 543 the server can prove to the client that it knows the secret embedded 544 in the ticket. For production systems, the lifetime SHOULD be 545 between 7 and 30 days. 547 5.3. Certificate Renewal 549 The protocol ensures that the client will continue speaking to the 550 correct server even when the server's certificate is renewed. In 551 this sense, we are not "pinning certificates" and the protocol should 552 more precisely be called "server identity pinning". 554 Note that this property is not impacted by the use of the server's 555 public key in the pinning proof, because the scope of the public key 556 used is only the current TLS session. 558 5.4. Certificate Revocation 560 The protocol is orthogonal to certificate validation in the sense 561 that, if the server's certificate has been revoked or is invalid for 562 some other reason, the client MUST refuse to connect to it regardless 563 of any ticket-related behavior. 565 5.5. Disabling Pinning 567 A server implementing this protocol MUST have a "ramp down" mode of 568 operation where: 570 - The server continues to accept valid pinning tickets and responds 571 correctly with a proof. 573 - The server does not send back a new pinning ticket. 575 After a while no clients will hold valid tickets any more and the 576 feature may be disabled. 578 5.6. Server Compromise 580 If a server compromise is detected, the pinning protection key MUST 581 be rotated immediately, but the server MUST still accept valid 582 tickets that use the old, compromised key. Clients that still hold 583 old pinning tickets will remain vulnerable to MITM attacks, but those 584 that connect to the correct server will immediately receive new 585 tickets protected with the newly generated pinning protection key. 587 The same procedure applies if the pinning protection key is 588 compromised directly, e.g. if a backup copy is inadvertently made 589 public. 591 5.7. Disaster Recovery 593 All web servers in production need to be backed up, so that they can 594 be recovered if a disaster (including a malicious activity) ever 595 wipes them out. Backup typically includes the certificate and its 596 private key, which must be backed up securely. The pinning secret, 597 including earlier versions that are still being accepted, must be 598 backed up regularly. However since it is only used as an 599 authentication second factor, it does not require the same level of 600 confidentiality as the server's private key. 602 Readers should note that [RFC5077] session resumption keys are more 603 security sensitive, and should normally not be backed up but rather 604 treated as ephemeral keys. Even when servers derive pinning secrets 605 from resumption keys (Section 4.1), they MUST NOT back up resumption 606 keys. 608 6. Previous Work 610 This section compares ticket pinning to two earlier proposals, HPKP 611 and TACK. 613 6.1. Comparison: HPKP Deployment 615 The current IETF standard for pinning the identity of web servers is 616 the Public Key Pinning Extension for HTTP, or HPKP [RFC7469]. 617 Unfortunately HPKP has not seen wide deployment yet. As of March 618 2016, the number of servers using HPKP was less than 3000 [Netcraft]. 619 This may simply be due to inertia, but we believe the main reason is 620 the onerous manual certificate management which is needed to 621 implement HPKP for enterprise servers. The penalty for making 622 mistakes (e.g. being too early or too late to deploy new pins) is 623 having the server become unusable for some of the clients. 625 To demonstrate this point, we present a list of the steps involved in 626 deploying HPKP on a security-sensitive Web server. 628 1. Generate two public/private key-pairs on a computer that is not 629 the Live server. The second one is the "backup1" key-pair. 631 "openssl genrsa -out "example.com.key" 2048;" 633 "openssl genrsa -out "example.com.backup1.key" 2048;" 635 2. Generate hashes for both of the public keys. These will be used 636 in the HPKP header: 638 "openssl rsa -in "example.com.key" -outform der -pubout | 639 openssl dgst -sha256 -binary | openssl enc -base64" 641 "openssl rsa -in "example.com.backup1.key" -outform der 642 -pubout | openssl dgst -sha256 -binary | openssl enc -base64" 644 3. Generate a single CSR (Certificate Signing Request) for the 645 first key-pair, where you include the domain name in the CN 646 (Common Name) field: 648 "openssl req -new -subj "/C=GB/ST=Area/L=Town/O=Company/ 649 CN=example.com" -key "example.com.key" -out "example.com.csr";" 651 4. Send this CSR to the CA (Certificate Authority), and go though 652 the dance to prove you own the domain. The CA will give you 653 back a single certificate that will typically expire within a 654 year or two. 656 5. On the Live server, upload and setup the first key-pair (and its 657 certificate). At this point you can add the "Public-Key-Pins" 658 header, using the two hashes you created in step 2. 660 Note that only the first key-pair has been uploaded to the 661 server so far. 663 6. Store the second (backup1) key-pair somewhere safe, probably 664 somewhere encrypted like a password manager. It won't expire, 665 as it's just a key-pair, it just needs to be ready for when you 666 need to get your next certificate. 668 7. Time passes... probably just under a year (if waiting for a 669 certificate to expire), or maybe sooner if you find that your 670 server has been compromised and you need to replace the key-pair 671 and certificate. 673 8. Create a new CSR (Certificate Signing Request) using the 674 "backup1" key-pair, and get a new certificate from your CA. 676 9. Generate a new backup key-pair (backup2), get its hash, and 677 store it in a safe place (again, not on the Live server). 679 10. Replace your old certificate and old key-pair, and update the 680 "Public-Key-Pins" header to remove the old hash, and add the new 681 "backup2" key-pair. 683 Note that in the above steps, both the certificate issuance as well 684 as the storage of the backup key pair involve manual steps. Even 685 with an automated CA that runs the ACME protocol, key backup would be 686 a challenge to automate. 688 6.2. Comparison: TACK 690 Compared with HPKP, TACK [I-D.perrin-tls-tack] is a lot more similar 691 to the current draft. It can even be argued that this document is a 692 symmetric-cryptography variant of TACK. That said, there are still a 693 few significant differences: 695 - Probably the most important difference is that with TACK, 696 validation of the server certificate is no longer required, and in 697 fact TACK specifies it as a "MAY" requirement (Sec. 5.3). With 698 ticket pinning, certificate validation by the client remains a 699 MUST requirement, and the ticket acts only as a second factor. If 700 the pinning secret is compromised, the server's security is not 701 immediately at risk. 703 - Both TACK and the current draft are mostly orthogonal to the 704 server certificate as far as their life cycle, and so both can be 705 deployed with no manual steps. 707 - TACK uses ECDSA to sign the server's public key. This allows 708 cooperating clients to share server assertions between themselves. 709 This is an optional TACK feature, and one that cannot be done with 710 pinning tickets. 712 - TACK allows multiple servers to share its public keys. Such 713 sharing is disallowed by the current document. 715 - TACK does not allow the server to track a particular client, and 716 so has better privacy properties than the current draft. 718 - TACK has an interesting way to determine the pin's lifetime, 719 setting it to the time period since the pin was first observed, 720 with a hard upper bound of 30 days. The current draft makes the 721 lifetime explicit, which may be more flexible to deploy. For 722 example, Web sites which are only visited rarely by users may opt 723 for a longer period than other sites that expect users to visit on 724 a daily basis. 726 7. Implementation Status 728 Note to RFC Editor: please remove this section before publication, 729 including the reference to [RFC7942]. 731 This section records the status of known implementations of the 732 protocol defined by this specification at the time of posting of this 733 Internet-Draft, and is based on a proposal described in [RFC7942]. 734 The description of implementations in this section is intended to 735 assist the IETF in its decision processes in progressing drafts to 736 RFCs. Please note that the listing of any individual implementation 737 here does not imply endorsement by the IETF. Furthermore, no effort 738 has been spent to verify the information presented here that was 739 supplied by IETF contributors. This is not intended as, and must not 740 be construed to be, a catalog of available implementations or their 741 features. Readers are advised to note that other implementations may 742 exist. 744 According to RFC 7942, "this will allow reviewers and working groups 745 to assign due consideration to documents that have the benefit of 746 running code, which may serve as evidence of valuable experimentation 747 and feedback that have made the implemented protocols more mature. 748 It is up to the individual working groups to use this information as 749 they see fit". 751 7.1. Mint Fork 753 7.1.1. Overview 755 A fork of the Mint TLS 1.3 implementation, developed by Yaron Sheffer 756 and available at https://github.com/yaronf/mint. 758 7.1.2. Description 760 This is a fork of the TLS 1.3 implementation, and includes client and 761 server code. In addition to the actual protocol, several utilities 762 are provided allowing to manage pinning protection keys on the server 763 side, and pinning tickets on the client side. 765 7.1.3. Level of Maturity 767 This is a prototype. 769 7.1.4. Coverage 771 The entire protocol is implemented. 773 7.1.5. Version Compatibility 775 The implementation is compatible with draft-sheffer-tls-pinning- 776 ticket-02. 778 7.1.6. Licensing 780 Mint itself and this fork are available under an MIT license. 782 7.1.7. Contact Information 784 See author details below. 786 8. Security Considerations 788 This section reviews several security aspects related to the proposed 789 extension. 791 8.1. Trust on First Use (TOFU) and MITM Attacks 793 This protocol is a "trust on first use" protocol. If a client 794 initially connects to the "right" server, it will be protected 795 against MITM attackers for the lifetime of each received ticket. If 796 it connects regularly (depending of course on the server-selected 797 lifetime), it will stay constantly protected against fake 798 certificates. 800 However if it initially connects to an attacker, subsequent 801 connections to the "right" server will fail. Server operators might 802 want to advise clients on how to remove corrupted pins, once such 803 large scale attacks are detected and remediated. 805 The protocol is designed so that it is not vulnerable to an active 806 MITM attacker who has real-time access to the original server. The 807 pinning proof includes a hash of the server's public key, to ensure 808 the client that the proof was in fact generated by the server with 809 which it is initiating the connection. 811 8.2. Pervasive Monitoring 813 Some organizations, and even some countries perform pervasive 814 monitoring on their constituents [RFC7258]. This often takes the 815 form of always-active SSL proxies. Because of the TOFU property, 816 this protocol does not provide any security in such cases. 818 8.3. Server-Side Error Detection 820 Uniquely, this protocol allows the server to detect clients that 821 present incorrect tickets and therefore can be assumed to be victims 822 of a MITM attack. Server operators can use such cases as indications 823 of ongoing attacks, similarly to fake certificate attacks that took 824 place in a few countries in the past. 826 8.4. Client Policy and SSL Proxies 828 Like it or not, some clients are normally deployed behind an SSL 829 proxy. Similarly to [RFC7469], it is acceptable to allow pinning to 830 be disabled for some hosts according to local policy. For example, a 831 UA MAY disable pinning for hosts whose validated certificate chain 832 terminates at a user-defined trust anchor, rather than a trust anchor 833 built-in to the UA (or underlying platform). Moreover, a client MAY 834 accept an empty PinningTicket extension from such hosts as a valid 835 response. 837 8.5. Client-Side Error Behavior 839 When a client receives a malformed or empty PinningTicket extension 840 from a pinned server, it MUST abort the handshake and MUST NOT retry 841 with no PinningTicket in the request. Doing otherwise would expose 842 the client to trivial fallback attacks, similar to those described in 843 [RFC7507]. 845 This rule can however have negative affects on clients that move from 846 behind SSL proxies into the open Internet and vice versa, if the 847 advice in Section 8.4 is not followed. Therefore, we RECOMMEND that 848 browser and library vendors provide a documented way to remove stored 849 pins. 851 8.6. Stolen and Forged Tickets 853 Stealing pinning tickets even in conjunction with other pinning 854 parameters, such as the associated pinning secret, provides no 855 benefit to the attacker since pinning tickets are used to secure the 856 client rather than the server. Similarly, it is useless to forge a 857 ticket for a particular sever. 859 8.7. Client Privacy 861 This protocol is designed so that an external attacker cannot 862 correlate between different requests of a single client, provided the 863 client requests and receives a fresh ticket upon each connection. 865 On the other hand, the server to which the client is connecting can 866 easily track the client. This may be an issue when the client 867 expects to connect to the server (e.g., a mail server) with multiple 868 identities. Implementations SHOULD allow the user to opt out of 869 pinning, either in general or for particular servers. 871 8.8. Ticket Protection Key Management 873 While the ticket format is not mandated by this document, we 874 RECOMMEND using authenticated encryption to protect it. Some of the 875 algorithms commonly used for authenticated encryption, e.g. GCM, are 876 highly vulnerable to nonce reuse, and this problem is magnified in a 877 cluster setting. Therefore implementations that choose AES-128-GCM 878 MUST adopt one of these two alternatives: 880 - Partition the nonce namespace between cluster members and use 881 monotonic counters on each member, e.g. by setting the nonce to 882 the concatenation of the cluster member ID and an incremental 883 counter. 885 - Generate random nonces but avoid the so-called birthday bound, 886 i.e. never generate more than 2**64 encrypted tickets for the same 887 ticket pinning protection Key. 889 9. IANA Considerations 891 IANA is requested to allocate a TicketPinning extension value in the 892 TLS ExtensionType Registry. 894 No registries are defined by this document. 896 10. Acknowledgements 898 The original idea behind this proposal was published in [Oreo] by 899 Moty Yung, Benny Pinkas and Omer Berkman. The current protocol is 900 but a distant relative of the original Oreo protocol, and any errors 901 are the draft authors' alone. 903 We would like to thank Dave Garrett, Daniel Kahn Gillmor and Yoav Nir 904 for their comments on this draft. Special thanks to Craig Francis 905 for contributing the HPKP deployment script, and to Ralph Holz for 906 several fruitful discussions. 908 11. References 910 11.1. Normative References 912 [I-D.ietf-tls-tls13] 913 Rescorla, E., "The Transport Layer Security (TLS) Protocol 914 Version 1.3", draft-ietf-tls-tls13-14 (work in progress), 915 July 2016. 917 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 918 Hashing for Message Authentication", RFC 2104, 919 DOI 10.17487/RFC2104, February 1997, 920 . 922 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 923 Requirement Levels", BCP 14, RFC 2119, 924 DOI 10.17487/RFC2119, March 1997, 925 . 927 [RFC5077] Salowey, J., Zhou, H., Eronen, P., and H. Tschofenig, 928 "Transport Layer Security (TLS) Session Resumption without 929 Server-Side State", RFC 5077, DOI 10.17487/RFC5077, 930 January 2008, . 932 11.2. Informative References 934 [I-D.perrin-tls-tack] 935 Marlinspike, M., "Trust Assertions for Certificate Keys", 936 draft-perrin-tls-tack-02 (work in progress), January 2013. 938 [Netcraft] 939 Mutton, P., "HTTP Public Key Pinning: You're doing it 940 wrong!", March 2016, 941 . 944 [Oreo] Berkman, O., Pinkas, B., and M. Yung, "Firm Grip 945 Handshakes: A Tool for Bidirectional Vouching", Cryptology 946 and Network Security, pp. 142-157 , 2012. 948 [RFC6454] Barth, A., "The Web Origin Concept", RFC 6454, 949 DOI 10.17487/RFC6454, December 2011, 950 . 952 [RFC6962] Laurie, B., Langley, A., and E. Kasper, "Certificate 953 Transparency", RFC 6962, DOI 10.17487/RFC6962, June 2013, 954 . 956 [RFC7258] Farrell, S. and H. Tschofenig, "Pervasive Monitoring Is an 957 Attack", BCP 188, RFC 7258, DOI 10.17487/RFC7258, May 958 2014, . 960 [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning 961 Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 962 2015, . 964 [RFC7507] Moeller, B. and A. Langley, "TLS Fallback Signaling Cipher 965 Suite Value (SCSV) for Preventing Protocol Downgrade 966 Attacks", RFC 7507, DOI 10.17487/RFC7507, April 2015, 967 . 969 [RFC7942] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 970 Code: The Implementation Status Section", BCP 205, 971 RFC 7942, DOI 10.17487/RFC7942, July 2016, 972 . 974 Appendix A. Document History 976 A.1. draft-sheffer-tls-pinning-ticket-03 978 - Deleted redundant length fields in the extension's formal 979 definition. 981 - Modified cryptographic operations to align with the current state 982 of TLS 1.3. 984 - Numerous textual improvements. 986 A.2. draft-sheffer-tls-pinning-ticket-02 988 - Added an Implementation Status section. 990 - Added lengths into the extension structure. 992 - Changed the computation of the pinning proof to be more robust. 994 - Clarified requirements on the length of the pinning_secret. 996 - Revamped the HPKP section to be more in line with current 997 practices, and added recent statistics on HPKP deployment. 999 A.3. draft-sheffer-tls-pinning-ticket-01 1001 - Corrected the notation for variable-sized vectors. 1003 - Added a section on disaster recovery and backup. 1005 - Added a section on privacy. 1007 - Clarified the assumptions behind the HPKP procedure in the 1008 comparison section. 1010 - Added a definition of pin indexing (origin). 1012 - Adjusted to the latest TLS 1.3 notation. 1014 A.4. draft-sheffer-tls-pinning-ticket-00 1016 Initial version. 1018 Authors' Addresses 1020 Yaron Sheffer 1021 Intuit 1023 EMail: yaronf.ietf@gmail.com 1025 Daniel Migault 1026 Ericsson 1028 EMail: daniel.migault@ericsson.com