idnits 2.17.1 draft-ietf-ipsecme-failure-detection-01.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 date (October 10, 2010) is 4940 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: 'IDr' is mentioned on line 260, but not defined == Missing Reference: 'KEi' is mentioned on line 319, but not defined == Missing Reference: 'KEr' is mentioned on line 321, but not defined == Missing Reference: 'CERTREQ' is mentioned on line 609, but not defined ** Obsolete normative reference: RFC 5996 (Obsoleted by RFC 7296) Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IPsecME Working Group Y. Nir, Ed. 3 Internet-Draft Check Point 4 Intended status: Standards Track D. Wierbowski 5 Expires: April 13, 2011 IBM 6 F. Detienne 7 P. Sethi 8 Cisco 9 October 10, 2010 11 A Quick Crash Detection Method for IKE 12 draft-ietf-ipsecme-failure-detection-01 14 Abstract 16 This document describes an extension to the IKEv2 protocol that 17 allows for faster detection of SA desynchronization using a saved 18 token. 20 When an IPsec tunnel between two IKEv2 peers is disconnected due to a 21 restart of one peer, it can take as much as several minutes for the 22 other peer to discover that the reboot has occurred, thus delaying 23 recovery. In this text we propose an extension to the protocol, that 24 allows for recovery immediately following the restart. 26 Status of this Memo 28 This Internet-Draft is submitted in full conformance with the 29 provisions of BCP 78 and BCP 79. 31 Internet-Drafts are working documents of the Internet Engineering 32 Task Force (IETF). Note that other groups may also distribute 33 working documents as Internet-Drafts. The list of current Internet- 34 Drafts is at http://datatracker.ietf.org/drafts/current/. 36 Internet-Drafts are draft documents valid for a maximum of six months 37 and may be updated, replaced, or obsoleted by other documents at any 38 time. It is inappropriate to use Internet-Drafts as reference 39 material or to cite them other than as "work in progress." 41 This Internet-Draft will expire on April 13, 2011. 43 Copyright Notice 45 Copyright (c) 2010 IETF Trust and the persons identified as the 46 document authors. All rights reserved. 48 This document is subject to BCP 78 and the IETF Trust's Legal 49 Provisions Relating to IETF Documents 50 (http://trustee.ietf.org/license-info) in effect on the date of 51 publication of this document. Please review these documents 52 carefully, as they describe your rights and restrictions with respect 53 to this document. Code Components extracted from this document must 54 include Simplified BSD License text as described in Section 4.e of 55 the Trust Legal Provisions and are provided without warranty as 56 described in the Simplified BSD License. 58 Table of Contents 60 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 61 1.1. Conventions Used in This Document . . . . . . . . . . . . 4 62 2. RFC 4306 Crash Recovery . . . . . . . . . . . . . . . . . . . 5 63 3. Protocol Outline . . . . . . . . . . . . . . . . . . . . . . . 5 64 4. Formats and Exchanges . . . . . . . . . . . . . . . . . . . . 6 65 4.1. Notification Format . . . . . . . . . . . . . . . . . . . 6 66 4.2. Passing a Token in the AUTH Exchange . . . . . . . . . . . 7 67 4.3. Replacing Tokens After Rekey or Resumption . . . . . . . . 8 68 4.4. Replacing the Token for an Existing SA . . . . . . . . . . 9 69 4.5. Presenting the Token in an Unprotected Message . . . . . . 9 70 5. Token Generation and Verification . . . . . . . . . . . . . . 10 71 5.1. A Stateless Method of Token Generation . . . . . . . . . . 10 72 5.2. A Stateless Method with IP addresses . . . . . . . . . . . 11 73 5.3. Token Lifetime . . . . . . . . . . . . . . . . . . . . . . 11 74 6. Backup Gateways . . . . . . . . . . . . . . . . . . . . . . . 11 75 7. Alternative Solutions . . . . . . . . . . . . . . . . . . . . 12 76 7.1. Initiating a new IKE SA . . . . . . . . . . . . . . . . . 12 77 7.2. SIR . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 78 7.3. Birth Certificates . . . . . . . . . . . . . . . . . . . . 12 79 7.4. Reducing Liveness Check Length . . . . . . . . . . . . . . 13 80 8. Interaction with Session Resumption . . . . . . . . . . . . . 13 81 9. Operational Considerations . . . . . . . . . . . . . . . . . . 15 82 9.1. Who should implement this specification . . . . . . . . . 15 83 9.2. Response to unknown child SPI . . . . . . . . . . . . . . 16 84 10. Security Considerations . . . . . . . . . . . . . . . . . . . 16 85 10.1. QCD Token Generation and Handling . . . . . . . . . . . . 17 86 10.2. QCD Token Transmission . . . . . . . . . . . . . . . . . . 17 87 10.3. QCD Token Enumeration . . . . . . . . . . . . . . . . . . 18 88 10.4. Selecting an Appropriate Token Generation Method . . . . . 18 89 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 90 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 19 91 13. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 19 92 13.1. Changes from draft-ietf-ipsecme-failure-detection-00 . . . 19 93 13.2. Changes from draft-nir-ike-qcd-07 . . . . . . . . . . . . 20 94 13.3. Changes from draft-nir-ike-qcd-03 and -04 . . . . . . . . 20 95 13.4. Changes from draft-nir-ike-qcd-02 . . . . . . . . . . . . 20 96 13.5. Changes from draft-nir-ike-qcd-01 . . . . . . . . . . . . 20 97 13.6. Changes from draft-nir-ike-qcd-00 . . . . . . . . . . . . 20 98 13.7. Changes from draft-nir-qcr-00 . . . . . . . . . . . . . . 20 99 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21 100 14.1. Normative References . . . . . . . . . . . . . . . . . . . 21 101 14.2. Informative References . . . . . . . . . . . . . . . . . . 21 102 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 21 104 1. Introduction 106 IKEv2, as described in [RFC5996] and its predecessor RFC 4306, has a 107 method for recovering from a reboot of one peer. As long as traffic 108 flows in both directions, the rebooted peer should re-establish the 109 tunnels immediately. However, in many cases the rebooted peer is a 110 VPN gateway that protects only servers, or else the non-rebooted peer 111 has a dynamic IP address. In such cases, the rebooted peer will not 112 be able to re-establish the tunnels. Section 2 describes how 113 recovery works under RFC 4306, and explains why it may take several 114 minutes. 116 The method proposed here, is to send an octet string, called a "QCD 117 token" in the IKE_AUTH exchange that establishes the tunnel. That 118 token can be stored on the peer as part of the IKE SA. After a 119 reboot, the rebooted implementation can re-generate the token, and 120 send it to the peer, so as to delete the IKE SA. Deleting the IKE SA 121 results is a quick establishment of new IPsec tunnels. This is 122 described in Section 3. 124 1.1. Conventions Used in This Document 126 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 127 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 128 document are to be interpreted as described in [RFC2119]. 130 The term "token" refers to an octet string that an implementation can 131 generate using only the properties of a protected IKE message (such 132 as IKE SPIs) as input. A conforming implementation MUST be able to 133 generate the same token from the same input even after rebooting. 135 The term "token maker" refers to an implementation that generates a 136 token and sends it to the peer as specified in this document. 138 The term "token taker" refers to an implementation that stores such a 139 token or a digest thereof, in order to verify that a new token it 140 receives is identical to the old token it has stored. 142 The term "non-volatile storage" in this document refers to a data 143 storage module, that persists across restarts of the token maker. 144 Examples of such a storage module include an internal disk, an 145 internal flash memory module, an external disk and an external 146 database. A small non-volatile storage module is required for a 147 token maker, but a larger one can be used to enhance performance, as 148 described in Section 9.2. 150 2. RFC 4306 Crash Recovery 152 When one peer loses state or reboots, the other peer does not get any 153 notification, so unidirectional IPsec traffic can still flow. The 154 rebooted peer will not be able to decrypt it, however, and the only 155 remedy is to send an unprotected INVALID_SPI notification as 156 described in section 3.10.1 of [RFC5996]. That section also 157 describes the processing of such a notification: 159 "If this Informational Message is sent outside the 160 context of an IKE_SA, it should be used by the recipient 161 only as a "hint" that something might be wrong (because it 162 could easily be forged)." 164 Since the INVALID_SPI can only be used as a hint, the non-rebooted 165 peer has to determine whether the IPsec SA, and indeed the parent IKE 166 SA are still valid. The method of doing this is described in section 167 2.4 of [RFC5996]. This method, called "liveness check" involves 168 sending a protected empty INFORMATIONAL message, and awaiting a 169 response. This procedure is sometimes referred to as "Dead Peer 170 Detection" or DPD. 172 Section 2.4 does not mandate how many times the liveness check 173 message should be retransmitted, or for how long, but does recommend 174 the following: 176 "It is 177 suggested that messages be retransmitted at least a dozen times over 178 a period of at least several minutes before giving up on an SA..." 180 Those "at least several minutes" are a time during which both peers 181 are active, but IPsec cannot be used. 183 3. Protocol Outline 185 Supporting implementations will send a notification, called a "QCD 186 token", as described in Section 4.1 in the first IKE_AUTH exchange 187 messages. These are the final IKE_AUTH request and final IKE_AUTH 188 response that contain the AUTH payloads. The generation of these 189 tokens is a local matter for implementations, but considerations are 190 described in Section 5. Implementations that send such a token will 191 be called "token makers". 193 A supporting implementation receiving such a token MUST store it (or 194 a digest thereof) along with the IKE SA. Implementations that 195 support this part of the protocol will be called "token takers". 196 Section 9.1 has considerations for which implementations need to be 197 token takers, and which should be token makers. Implementation that 198 are not token takers will silently ignore QCD tokens. 200 When a token maker receives a protected IKE request message with 201 unknown IKE SPIs, it SHOULD generate a new token that is identical to 202 the previous token, and send it to the requesting peer in an 203 unprotected IKE message as described in Section 4.5. 205 When a token taker receives the QCD token in an unprotected 206 notification, it MUST verify that the TOKEN_SECRET_DATA matches the 207 token stored with the matching IKE SA. If the verification fails, or 208 if the IKE SPIs in the message do not match any existing IKE SA, it 209 SHOULD log the event. If it succeeds, it MUST silently delete the 210 IKE SA associated with the IKE_SPI fields, and all dependent child 211 SAs. This event MAY also be logged. The token taker MUST accept 212 such tokens from any IP address and port combination, so as to allow 213 different kinds of high-availability configurations of the token 214 maker. 216 A supporting token taker MAY immediately create new SAs using an 217 Initial exchange, or it may wait for subsequent traffic to trigger 218 the creation of new SAs. 220 See Section 8 for a short discussion about this extensions's 221 interaction with IKEv2 Session Resumption ([RFC5723]). 223 4. Formats and Exchanges 225 4.1. Notification Format 227 The notification payload called "QCD token" is formatted as follows: 229 1 2 3 230 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 231 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 232 ! Next Payload !C! RESERVED ! Payload Length ! 233 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 234 ! Protocol ID ! SPI Size ! QCD Token Notify Message Type ! 235 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 236 ! ! 237 ~ TOKEN_SECRET_DATA ~ 238 ! ! 239 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 241 o Protocol ID (1 octet) MUST be 1, as this message is related to an 242 IKE SA. 244 o SPI Size (1 octet) MUST be zero, in conformance with section 3.10 245 of [RFC5996]. 246 o QCD Token Notify Message Type (2 octets) - MUST be xxxxx, the 247 value assigned for QCD token notifications. TBA by IANA. 248 o TOKEN_SECRET_DATA (16-128 octets) contains a generated token as 249 described in Section 5. 251 4.2. Passing a Token in the AUTH Exchange 253 For brevity, only the EAP version of an AUTH exchange will be 254 presented here. The non-EAP version is very similar. The figures 255 below are based on appendix C.3 of [RFC5996]. 257 first request --> IDi, 258 [N(INITIAL_CONTACT)], 259 [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+], 260 [IDr], 261 [N(QCD_TOKEN)] 262 [CP(CFG_REQUEST)], 263 [N(IPCOMP_SUPPORTED)+], 264 [N(USE_TRANSPORT_MODE)], 265 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 266 [N(NON_FIRST_FRAGMENTS_ALSO)], 267 SA, TSi, TSr, 268 [V+] 270 first response <-- IDr, [CERT+], AUTH, 271 EAP, 272 [V+] 274 / --> EAP 275 repeat 1..N times | 276 \ <-- EAP 278 last request --> AUTH 280 last response <-- AUTH, 281 [N(QCD_TOKEN)] 282 [CP(CFG_REPLY)], 283 [N(IPCOMP_SUPPORTED)], 284 [N(USE_TRANSPORT_MODE)], 285 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 286 [N(NON_FIRST_FRAGMENTS_ALSO)], 287 SA, TSi, TSr, 288 [N(ADDITIONAL_TS_POSSIBLE)], 289 [V+] 291 Note that the QCD_TOKEN notification is marked as optional because it 292 is not required by this specification that every implementation be 293 both token maker and token taker. If only one peer sends the QCD 294 token, then a reboot of the other peer will not be recoverable by 295 this method. This may be acceptable if traffic typically originates 296 from the other peer. 298 In any case, the lack of a QCD_TOKEN notification MUST NOT be taken 299 as an indication that the peer does not support this standard. 300 Conversely, if a peer does not understand this notification, it will 301 simply ignore it. Therefore a peer may send this notification 302 freely, even if it does not know whether the other side supports it. 304 The QCD_TOKEN notification is related to the IKE SA and MUST follow 305 the AUTH payload and precede the Configuration payload and all 306 payloads related to the child SA. 308 4.3. Replacing Tokens After Rekey or Resumption 310 After rekeying an IKE SA, the IKE SPIs are replaced, so the new SA 311 also needs to have a token. If only the responder in the rekey 312 exchange is the token maker, this can be done within the 313 CREATE_CHILD_SA exchange. If the initiator is a token maker, then we 314 need an extra informational exchange. 316 The following figure shows the CREATE_CHILD_SA exchange for rekeying 317 the IKE SA. Only the responder sends a QCD token. 319 request --> SA, Ni, [KEi] 321 response <-- SA, Nr, [KEr], N(QCD_TOKEN) 323 If the initiator is also a token maker, it SHOULD soon initiate an 324 INFORMATIONAL exchange as follows: 326 request --> N(QCD_TOKEN) 328 response <-- 330 For session resumption, as specified in [RFC5723], the situation is 331 similar. The responder, which is necessarily the peer that has 332 crashed, SHOULD send a new ticket within the protected payload of the 333 IKE_SESSION_RESUME exchange. If the Initiator is also a token maker, 334 it needs to send a QCD_TOKEN in a separate INFORMATIONAL exchange. 336 The INFORMATIONAL exchange described in this section can also be used 337 if QCD tokens need to be replaced due to a key rollover. However, 338 since token takers are required to verify at least 4 QCD tokens, this 339 is only necessary if secret QCD keys are rolled over more than four 340 times as often as IKE SAs are rekeyed. 342 4.4. Replacing the Token for an Existing SA 344 With some token generation methods, such as that described in 345 Section 5.2, a QCD token may sometimes become invalid, although the 346 IKE SA is still perfectly valid. 348 In such a case, the token maker MUST send the new token in a 349 protected message under that IKE SA. That exchange could be a simple 350 INFORMATIONAL, such as in the last figure in the previous section, or 351 else it can be part of a MOBIKE INFORMATIONAL exchange such as in the 352 following figure taken from section 2.2 of [RFC4555] and modified by 353 adding a QCD_TOKEN notification: 355 (IP_I2:4500 -> IP_R1:4500) 356 HDR, SK { N(UPDATE_SA_ADDRESSES), 357 N(NAT_DETECTION_SOURCE_IP), 358 N(NAT_DETECTION_DESTINATION_IP) } --> 360 <-- (IP_R1:4500 -> IP_I2:4500) 361 HDR, SK { N(NAT_DETECTION_SOURCE_IP), 362 N(NAT_DETECTION_DESTINATION_IP) } 364 <-- (IP_R1:4500 -> IP_I2:4500) 365 HDR, SK { N(COOKIE2), [N(QCD_TOKEN)] } 367 (IP_I2:4500 -> IP_R1:4500) 368 HDR, SK { N(COOKIE2), [N(QCD_TOKEN)] } --> 370 A token taker MUST accept such gratuitous QCD_TOKEN notifications as 371 long as they are carried in protected exchanges. A token maker 372 SHOULD NOT generate them unless it is no longer able to generate the 373 old QCD_TOKEN. 375 4.5. Presenting the Token in an Unprotected Message 377 This QCD_TOKEN notification is unprotected, and is sent as a response 378 to a protected IKE request, which uses an IKE SA that is unknown. 380 request --> N(INVALID_IKE_SPI), N(QCD_TOKEN)+ 382 If child SPIs are persistently mapped to IKE SPIs as described in 383 Section 9.2, a token taker may get the following unprotected message 384 in response to an ESP or AH packet. 386 request --> N(INVALID_SPI), N(QCD_TOKEN)+ 388 The QCD_TOKEN and INVALID_IKE_SPI notifications are sent together to 389 support both implementations that conform to this specification and 390 implementations that don't. Similar to the description in section 391 2.21 of [RFC5996], the IKE SPI and message ID fields in the packet 392 headers are taken from the protected IKE request. 394 To support a periodic rollover of the secret used for token 395 generation, the token taker MUST support at least four QCD_TOKEN 396 notifications in a single packet. The token is considered verified 397 if any of the QCD_TOKEN notifications matches. The token maker MAY 398 generate up to four QCD_TOKEN notifications, based on several 399 generations of keys. 401 If the QCD_TOKEN verifies OK, the receiver MUST silently discard the 402 IKE SA and all associated child SAs. If the QCD_TOKEN cannot be 403 validated, a response MUST NOT be sent, and the event may be logged. 404 Section 5 defines token verification. 406 5. Token Generation and Verification 408 No token generation method is mandated by this document. Two methods 409 are documented in the following sub-sections, but they only serve as 410 examples. 412 The following lists the requirements for a token generation 413 mechanism: 414 o Tokens MUST be at least 16 octets long, and no more than 128 415 octets long, to facilitate storage and transmission. Tokens 416 SHOULD be indistinguishable from random data. 417 o It should not be possible for an external attacker to guess the 418 QCD token generated by an implementation. Cryptographic 419 mechanisms such as PRNG and hash functions are RECOMMENDED. 420 o The token maker MUST be able to re-generate or retrieve the token 421 based on the IKE SPIs even after it reboots. 422 o The method of token generation MUST be such that a collision of 423 QCD tokens between different pairs of IKE SPI will be highly 424 unlikely. 426 5.1. A Stateless Method of Token Generation 428 This describes a stateless method of generating a token: 429 o At installation or immediately after the first boot of the token 430 maker, 32 random octets are generated using a secure random number 431 generator or a PRNG. 432 o Those 32 bytes, called the "QCD_SECRET", are stored in non- 433 volatile storage on the machine, and kept indefinitely. 435 o If key rollover is required by policy, the implementation MAY 436 periodically generate a new QCD_SECRET and keep up to 3 previous 437 generations. When sending an unprotected QCD_TOKEN, as many as 4 438 notification payloads may be sent, each from a different 439 QCD_SECRET. 440 o The TOKEN_SECRET_DATA is calculated as follows: 442 TOKEN_SECRET_DATA = HASH(QCD_SECRET | SPI-I | SPI-R) 444 5.2. A Stateless Method with IP addresses 446 This method is similar to the one in the previous section, except 447 that the IP address of the token taker is also added to the block 448 being hashed. This has the disadvantage that the token needs to be 449 replaced (as described in Section 4.4) whenever the token taker 450 changes its address. 452 The reason to use this method is described in Section 10.4. When 453 using this method, the TOKEN_SECRET_DATA field is calculated as 454 follows: 456 TOKEN_SECRET_DATA = HASH(QCD_SECRET | SPI-I | SPI-R | IPaddr-T) 458 The IPaddr-T field specifies the IP address of the token taker. 459 Secret rollover considerations are similar to those in the previous 460 section. 462 5.3. Token Lifetime 464 The token is associated with a single IKE SA, and SHOULD be deleted 465 by the token taker when the SA is deleted or expires. More formally, 466 the token is associated with the pair (SPI-I, SPI-R). 468 6. Backup Gateways 470 Making crash detection and recovery quick is a worthy goal, but since 471 rebooting a gateway takes a non-zero amount of time, many 472 implementations choose to have a stand-by gateway ready to take over 473 as soon as the primary gateway fails for any reason. [cluster] 474 describes considerations for such clusters of gateways with 475 synchronized state, but the rest of this section is relevant even 476 when there is no synchronized state. 478 If such a configuration is available, it is RECOMMENDED that the 479 stand-by gateway be able to generate the same token as the active 480 gateway. if the method described in Section 5.1 is used, this means 481 that the QCD_SECRET field is identical in both gateways. This has 482 the effect of having the crash recovery available immediately. 484 Note that this refers to "high availability" configurations, where 485 only one gateway is active at any given moment. This is different 486 from "load sharing" configurations where more than one gateway is 487 active at the same time. For load sharing configurations, please see 488 Section 10.2 for security considerations. 490 7. Alternative Solutions 492 7.1. Initiating a new IKE SA 494 Instead of sending a QCD token, we could have the rebooted 495 implementation start an Initial exchange with the peer, including the 496 INITIAL_CONTACT notification. This would have the same effect, 497 instructing the peer to erase the old IKE SA, as well as establishing 498 a new IKE SA with fewer rounds. 500 The disadvantage here, is that in IKEv2 an authentication exchange 501 MUST have a piggy-backed Child SA set up. Since our use case is such 502 that the rebooted implementation does not have traffic flowing to the 503 peer, there are no good selectors for such a Child SA. 505 Additionally, when authentication is asymmetric, such as when EAP is 506 used, it is not possible for the rebooted implementation to initiate 507 IKE. 509 7.2. SIR 511 Another proposal that was considered for this work item is the SIR 512 extension, which is described in [recovery]. Under that proposal, 513 the non-rebooted peer sends a non-protected query to the possibly 514 rebooted peer, asking whether the IKE SA exists. The peer replies 515 with either a positive or negative response, and the absence of a 516 positive response, along with the existence of a negative response is 517 taken as proof that the IKE SA has really been lost. 519 The working group preferred the QCD proposal to this one. 521 7.3. Birth Certificates 523 Birth Certificates is a method of crash detection that has never been 524 formally defined. Bill Sommerfeld suggested this idea in a mail to 525 the IPsec mailing list on August 7, 2000, in a thread discussing 526 methods of crash detection: 528 If we have the system sign a "birth certificate" when it 529 reboots (including a reboot time or boot sequence number), 530 we could include that with a "bad spi" ICMP error and in 531 the negotiation of the IKE SA. 533 We believe that this method would have some problems. First, it 534 requires Alice to store the certificate, so as to be able to compare 535 the public keys. That requires more storage than does a QCD token. 536 Additionally, the public-key operations needed to verify the self- 537 signed certificates are more expensive for Alice. 539 We believe that a symmetric-key operation such as proposed here is 540 more light-weight and simple than that implied by the Birth 541 Certificate idea. 543 7.4. Reducing Liveness Check Length 545 Some have suggested that the RFC 4306 procedure described in 546 Section 2 can be tweaked by requiring fewer retransmissions over a 547 shorter period of time for cases of liveness check started because of 548 an INVALID_SPI or INVALID_IKE_SPI notification. 550 We believe that the default retransmission policy should represent a 551 good balance between the need for a timely discovery of a dead peer, 552 and a low probability of false detection. We expect the policy to be 553 set to take the shortest time such that this probability achieves a 554 certain target. Therefore, reducing elapsed time and retransmission 555 count will create an unacceptably high probability of false 556 detection, and this can be triggered by a single INVALID_IKE_SPI 557 notification. 559 Additionally, even if the retransmission policy is reduced to, say, 560 one minute, it is still a very noticeable delay from a human 561 perspective, from the time that the gateway has come up until the 562 tunnels are active, or from the time the backup gateway has taken 563 over until the tunnels are active. 565 8. Interaction with Session Resumption 567 Session Resumption, specified in [RFC5723] proposes to make setting 568 up a new IKE SA consume less computing resources. This is 569 particularly useful in the case of a remote access gateway that has 570 many tunnels. A failure of such a gateway would require all these 571 many remote access clients to establish an IKE SA either with the 572 rebooted gateway or with a backup gateway. This tunnel re- 573 establishment should occur within a short period of time, creating a 574 burden on the remote access gateway. Session Resumption addresses 575 this problem by having the clients store an encrypted derivative of 576 the IKE SA for quick re-establishment. 578 What Session Resumption does not help is the problem of detecting 579 that the peer gateway has failed. A failed gateway may go undetected 580 for as long as the lifetime of a child SA, because IPsec does not 581 have packet acknowledgement, and applications cannot signal the IPsec 582 layer that the tunnel "does not work". Before establishing a new IKE 583 SA using Session Resumption, a client should ascertain that the 584 gateway has indeed failed. This could be done using either a 585 liveness check (as in RFC 4306) or using the QCD tokens described in 586 this document. 588 A remote access client conforming to both specifications will store 589 QCD tokens, as well as the Session Resumption ticket, if provided by 590 the gateway. A remote access gateway conforming to both 591 specifications will generate a QCD token for the client. When the 592 gateway reboots, the client will discover this in either of two ways: 593 1. The client does regular liveness checks, or else the time for 594 some other IKE exchange has come. Since the gateway is still 595 down, the IKE exchange times out after several minutes. In this 596 case QCD does not help. 597 2. Either the primary gateway or a backup gateway (see Section 6) is 598 ready and sends a QCD token to the client. In that case the 599 client will quickly re-establish the IPsec tunnel, either with 600 the rebooted primary gateway or the backup gateway as described 601 in this document. 603 The full combined protocol looks like this: 605 Initiator Responder 606 ----------- ----------- 607 HDR, SAi1, KEi, Ni --> 609 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 611 HDR, SK {IDi, [CERT,] 612 [CERTREQ,] [IDr,] 613 AUTH, N(QCD_TOKEN) 614 SAi2, TSi, TSr, 615 N(TICKET_REQUEST)} --> 616 <-- HDR, SK {IDr, [CERT,] AUTH, 617 N(QCD_TOKEN), SAr2, TSi, TSr, 618 N(TICKET_LT_OPAQUE) } 620 ---- Reboot ----- 622 HDR, {} --> 623 <-- HDR, N(QCD_TOKEN) 625 HDR, [N(COOKIE),] 626 Ni, N(TICKET_OPAQUE) 627 [,N+] --> 628 <-- HDR, Nr [,N+] 630 9. Operational Considerations 632 9.1. Who should implement this specification 634 Throughout this document, we have referred to reboot time 635 alternatingly as the time that the implementation crashes and the 636 time when it is ready to process IPsec packets and IKE exchanges. 637 Depending on the hardware and software platforms and the cause of the 638 reboot, rebooting may take anywhere from a few seconds to several 639 minutes. If the implementation is down for a long time, the benefit 640 of this protocol extension is reduced. For this reason critical 641 systems should implement backup gateways as described in Section 6. 643 Implementing the "token maker" side of QCD makes sense for IKE 644 implementation where protected connections originate from the peer, 645 such as inter-domain VPNs and remote access gateways. Implementing 646 the "token taker" side of QCD makes sense for IKE implementations 647 where protected connections originate, such as inter-domain VPNs and 648 remote access clients. 650 To clarify the this discussion: 652 o For remote-access clients it makes sense to implement the token 653 taker role. 654 o For remote-access gateways it makes sense to implement the token 655 maker role. 656 o For inter-domain VPN gateway it makes sense to implement both 657 roles, because it can't be known in advance where the traffic 658 originates. 659 o It is perfectly valid to implement both roles in any case, for 660 example when using a single library or a single gateway to perform 661 several roles. 663 In order to limit the effects of DoS attacks, a token taker SHOULD 664 limit the rate of QCD_TOKENs verified from a particular source. 666 If excessive amounts of IKE requests protected with unknown IKE SPIs 667 arrive at a token maker, the IKE module SHOULD revert to the behavior 668 described in section 2.21 of [RFC5996] and either send an 669 INVALID_IKE_SPI notification, or ignore it entirely. 671 9.2. Response to unknown child SPI 673 After a reboot, it is more likely that an implementation receives 674 IPsec packets than IKE packets. In that case, the rebooted 675 implementation will send an INVALID_SPI notification, triggering a 676 liveness check. The token will only be sent in a response to the 677 liveness check, thus requiring an extra round-trip. 679 To avoid this, an implementation that has access to enough non- 680 volatile storage MAY store a mapping of child SPIs to owning IKE 681 SPIs, or to generated tokens. If such a mapping is available and 682 persistent across reboots, the rebooted implementation SHOULD respond 683 to the IPsec packet with an INVALID_SPI notification, along with the 684 appropriate QCD_Token notifications. A token taker SHOULD verify the 685 QCD token that arrives with an INVALID_SPI notification the same as 686 if it arrived with the IKE SPIs of the parent IKE SA. 688 However, a persistent storage module might not be updated in a timely 689 manner, and could be populated with tokens relating to IKE SPIs that 690 have already been rekeyed. A token taker MUST NOT take an invalid 691 QCD Token sent along with an INVALID_SPI notification as evidence 692 that the peer is either malfunctioning or attacking, but it SHOULD 693 limit the rate at which such notifications are processed. 695 10. Security Considerations 696 10.1. QCD Token Generation and Handling 698 Tokens MUST be hard to guess. This is critical, because if an 699 attacker can guess the token associated with an IKE SA, she can tear 700 down the IKE SA and associated tunnels at will. When the token is 701 delivered in the IKE_AUTH exchange, it is encrypted. When it is sent 702 again in an unprotected notification, it is not, but that is the last 703 time this token is ever used. 705 An aggregation of some tokens generated by one maker together with 706 the related IKE SPIs MUST NOT give an attacker the ability to guess 707 other tokens. Specifically, if one taker does not properly secure 708 the QCD tokens and an attacker gains access to them, this attacker 709 MUST NOT be able to guess other tokens generated by the same maker. 710 This is the reason that the QCD_SECRET in Section 5.1 needs to be 711 sufficiently long. 713 The token taker MUST store the token in a secure manner. No attacker 714 should be able to gain access to a stored token. 716 The QCD_SECRET MUST be protected from access by other parties. 717 Anyone gaining access to this value will be able to delete all the 718 IKE SAs for this token maker. 720 The QCD token is sent by the rebooted peer in an unprotected message. 721 A message like that is subject to modification, deletion and replay 722 by an attacker. However, these attacks will not compromise the 723 security of either side. Modification is meaningless because a 724 modified token is simply an invalid token. Deletion will only cause 725 the protocol not to work, resulting in a delay in tunnel re- 726 establishment as described in Section 2. Replay is also meaningless, 727 because the IKE SA has been deleted after the first transmission. 729 10.2. QCD Token Transmission 731 A token maker MUST NOT send a QCD token in an unprotected message for 732 an existing IKE SA. This implies that a conforming QCD token maker 733 MUST be able to tell whether a particular pair of IKE SPIs represent 734 a valid IKE SA. 736 This requirement is obvious and easy in the case of a single gateway. 737 However, some implementations use a load balancer to divide the load 738 between several physical gateways. It MUST NOT be possible even in 739 such a configuration to trick one gateway into sending a QCD token 740 for an IKE SA which is valid on another gateway. 742 This document does not specify how a load sharing configuration of 743 IPsec gateways would work, but in order to support this 744 specification, all members MUST be able to tell whether a particular 745 IKE SA is active anywhere in the cluster. One way to do it is to 746 synchronize a list of active IKE SPIs among all the cluster members. 748 10.3. QCD Token Enumeration 750 An attacker may try to attack QCD if the generation algorithm 751 described in Section 5.1 is used. The attacker will send several 752 fake IKE requests to the gateway under attack, receiving and 753 recording the QCD Tokens in the responses. This will allow the 754 attacker to create a dictionary of IKE SPIs to QCD Tokens, which can 755 later be used to tear down any IKE SA. 757 Three factors mitigate this threat: 758 o The space of all possible IKE SPI pairs is huge: 2^128, so making 759 such a dictionary is impractical. Even if we assume that one 760 implementation always generates predictable IKE SPIs, the space is 761 still at least 2^64 entries, so making the dictionary is extremely 762 hard. To ensure this, token makers MUST use a good pseudo-random 763 number generator to generate the IKE SPIs. 764 o Throttling the amount of QCD_TOKEN notifications sent out, as 765 discussed in Section 9.1, especially when not soon after a crash 766 will limit the attacker's ability to construct a dictionary. 767 o The methods in Section 5.1 and Section 5.2 allow for a periodic 768 change of the QCD_SECRET. Any such change invalidates the entire 769 dictionary. 771 10.4. Selecting an Appropriate Token Generation Method 773 This section describes the rationale for token generation methods 774 such as the one described in Section 5.2. Note that this section 775 merely provides a possible rationale, and does not specify or 776 recommend any kind of configuration. 778 Some configurations of security gateway use a load-sharing cluster of 779 hosts, all sharing the same IP addresses, where the SAs (IKE and 780 child) are not synchronized between the cluster members. In such a 781 configuration, a single member does not know about all the IKE SAs 782 that are active for the configuration. A load balancer (usually a 783 networking switch) sends IKE and IPsec packets to the several members 784 based on source IP address. 786 In such a configuration, an attacker can send a forged protected IKE 787 packet with the IKE SPIs of an existing IKE SA, but from a different 788 IP address. This packet will likely be processed by a different 789 cluster member from the one that owns the IKE SA. Since no IKE SA 790 state is stored on this member, it will send a QCD token to the 791 attacker. If the QCD token does not depend on IP address, this token 792 can immediately be used to tell the token taker to tear down the IKE 793 SA using an unprotected QCD_TOKEN notification. 795 To thwart this possible attack, such configurations should use a 796 method that considers the taker's IP address, such as the method 797 described in Section 5.2. 799 On the other hand, when using this method a change of address 800 invalidates the tokens, so this method has both advantages and 801 disadvantages. 803 11. IANA Considerations 805 IANA is requested to assign a notify message type from the status 806 types range (16406-40959) of the "IKEv2 Notify Message Types" 807 registry with name "QUICK_CRASH_DETECTION". 809 12. Acknowledgements 811 We would like to thank Hannes Tschofenig and Yaron Sheffer for their 812 comments about Session Resumption. 814 Frederic D'etienne and Pratima Sethi contributed the ideas in 815 Section 10.4 and Section 5.2. 817 Others who have contrinuted valuable comments are, in alphabetical 818 order, Lakshminath Dondeti and Scott C Moonen. 820 13. Change Log 822 This section lists all changes in this document 824 NOTE TO RFC EDITOR : Please remove this section in the final RFC 826 13.1. Changes from draft-ietf-ipsecme-failure-detection-00 828 o Nits pointed out by Scott and Yaron. 829 o Pratima and Frederic are back on board. 830 o Changed IKEv2bis draft reference to RFC 5996. 831 o Resolved issues #189, #190, #191, and #192: 832 * Renamed section 4.5 and removed the requirement to send an 833 acknowledgement for the unprotected message. 834 * Moved the QCD token from the last to the first IKE_AUTH 835 request. 837 * Added a MUST to Section 10.3 to require that IKE SPIs be 838 randomly generated. 839 * Changed the language in Section 9.1, to not use RFC 2119 840 terminology. 841 * Moved the section describing why one would want the method 842 dependant on IP addresses (in Section 5.2 from operational 843 considerations to security considerations. 845 13.2. Changes from draft-nir-ike-qcd-07 847 o First WG version. 848 o Addressed Scott C Moonen's concern about collisions of QCD tokens. 849 o Updated references to point to IKEv2bis instead of RFC 4306 and 850 4718. Also converted draft reference for resumption to RFC 5723. 851 o Added Dave Wiebrowski as author, and removed Pratima and Frederic. 853 13.3. Changes from draft-nir-ike-qcd-03 and -04 855 Mostly editorial changes and cleaning up. 857 13.4. Changes from draft-nir-ike-qcd-02 859 o Described QCD token enumeration, following a question by 860 Lakshminath Dondeti. 861 o Added the ability to replace the QCD token for an existing IKE SA. 862 o Added tokens dependent on peer IP address and their interaction 863 with MOBIKE. 865 13.5. Changes from draft-nir-ike-qcd-01 867 o Removed stateless method. 868 o Added discussion of rekeying and resumption. 869 o Added discussion of non-synchronized load-balanced clusters of 870 gateways in the security considerations. 871 o Other wording fixes. 873 13.6. Changes from draft-nir-ike-qcd-00 875 o Merged proposal with draft-detienne-ikev2-recovery 876 o Changed the protocol so that the rebooted peer generates the 877 token. This has the effect, that the need for persistent storage 878 is eliminated. 879 o Added discussion of birth certificates. 881 13.7. Changes from draft-nir-qcr-00 882 o Changed name to reflect that this relates to IKE. Also changed 883 from quick crash recovery to quick crash detection to avoid 884 confusion with IFARE. 885 o Added more operational considerations. 886 o Added interaction with IFARE. 887 o Added discussion of backup gateways. 889 14. References 891 14.1. Normative References 893 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 894 Requirement Levels", BCP 14, RFC 2119, March 1997. 896 [RFC4555] Eronen, P., "IKEv2 Mobility and Multihoming Protocol 897 (MOBIKE)", RFC 4555, June 2006. 899 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 900 "Internet Key Exchange Protocol: IKEv2", RFC 5996, 901 September 2010. 903 14.2. Informative References 905 [RFC5723] Sheffer, Y. and H. Tschofenig, "IKEv2 Session Resumption", 906 RFC 5723, January 2010. 908 [cluster] Nir, Y., Ed., "IPsec Cluster Problem Statement", 909 draft-ietf-ipsecme-ipsec-ha (work in progress), July 2010. 911 [recovery] 912 Detienne, F., Sethi, P., and Y. Nir, "Safe IKE Recovery", 913 draft-detienne-ikev2-recovery (work in progress), 914 January 2010. 916 Authors' Addresses 918 Yoav Nir (editor) 919 Check Point Software Technologies Ltd. 920 5 Hasolelim st. 921 Tel Aviv 67897 922 Israel 924 Email: ynir@checkpoint.com 925 David Wierbowski 926 International Business Machines 927 1701 North Street 928 Endicott, New York 13760 929 United States 931 Email: wierbows@us.ibm.com 933 Frederic Detienne 934 Cisco Systems, Inc. 935 De Kleetlaan, 7 936 Diegem B-1831 937 Belgium 939 Phone: +32 2 704 5681 940 Email: fd@cisco.com 942 Pratima Sethi 943 Cisco Systems, Inc. 944 O'Shaugnessy Road, 11 945 Bangalore, Karnataka 560027 946 India 948 Phone: +91 80 4154 1654 949 Email: psethi@cisco.com