idnits 2.17.1 draft-ietf-ipsecme-failure-detection-02.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 25, 2010) is 4931 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. 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 302, but not defined == Missing Reference: 'KEi' is mentioned on line 361, but not defined == Missing Reference: 'KEr' is mentioned on line 363, but not defined == Missing Reference: 'CERTREQ' is mentioned on line 650, but not defined ** Obsolete normative reference: RFC 5996 (Obsoleted by RFC 7296) Summary: 1 error (**), 0 flaws (~~), 5 warnings (==), 2 comments (--). 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 28, 2011 IBM 6 F. Detienne 7 P. Sethi 8 Cisco 9 October 25, 2010 11 A Quick Crash Detection Method for IKE 12 draft-ietf-ipsecme-failure-detection-02 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 28, 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 5996 Crash Recovery . . . . . . . . . . . . . . . . . . . 5 63 3. Protocol Outline . . . . . . . . . . . . . . . . . . . . . . . 6 64 4. Formats and Exchanges . . . . . . . . . . . . . . . . . . . . 7 65 4.1. Notification Format . . . . . . . . . . . . . . . . . . . 7 66 4.2. Passing a Token in the AUTH Exchange . . . . . . . . . . . 8 67 4.3. Replacing Tokens After Rekey or Resumption . . . . . . . . 9 68 4.4. Replacing the Token for an Existing SA . . . . . . . . . . 9 69 4.5. Presenting the Token in an Unprotected Message . . . . . . 10 70 5. Token Generation and Verification . . . . . . . . . . . . . . 11 71 5.1. A Stateless Method of Token Generation . . . . . . . . . . 11 72 5.2. A Stateless Method with IP addresses . . . . . . . . . . . 12 73 5.3. Token Lifetime . . . . . . . . . . . . . . . . . . . . . . 12 74 6. Backup Gateways . . . . . . . . . . . . . . . . . . . . . . . 12 75 7. Alternative Solutions . . . . . . . . . . . . . . . . . . . . 13 76 7.1. Initiating a new IKE SA . . . . . . . . . . . . . . . . . 13 77 7.2. SIR . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 78 7.3. Birth Certificates . . . . . . . . . . . . . . . . . . . . 13 79 7.4. Reducing Liveness Check Length . . . . . . . . . . . . . . 14 80 8. Interaction with Session Resumption . . . . . . . . . . . . . 14 81 9. Operational Considerations . . . . . . . . . . . . . . . . . . 16 82 9.1. Who should implement this specification . . . . . . . . . 16 83 9.2. Response to unknown child SPI . . . . . . . . . . . . . . 16 84 10. Security Considerations . . . . . . . . . . . . . . . . . . . 17 85 10.1. QCD Token Generation and Handling . . . . . . . . . . . . 17 86 10.2. QCD Token Transmission . . . . . . . . . . . . . . . . . . 18 87 10.3. QCD Token Enumeration . . . . . . . . . . . . . . . . . . 18 88 10.4. Selecting an Appropriate Token Generation Method . . . . . 19 89 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 90 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 20 91 13. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 20 92 13.1. Changes from draft-ietf-ipsecme-failure-detection-01 . . . 20 93 13.2. Changes from draft-ietf-ipsecme-failure-detection-00 . . . 20 94 13.3. Changes from draft-nir-ike-qcd-07 . . . . . . . . . . . . 21 95 13.4. Changes from draft-nir-ike-qcd-03 and -04 . . . . . . . . 21 96 13.5. Changes from draft-nir-ike-qcd-02 . . . . . . . . . . . . 21 97 13.6. Changes from draft-nir-ike-qcd-01 . . . . . . . . . . . . 21 98 13.7. Changes from draft-nir-ike-qcd-00 . . . . . . . . . . . . 21 99 13.8. Changes from draft-nir-qcr-00 . . . . . . . . . . . . . . 21 100 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 22 101 14.1. Normative References . . . . . . . . . . . . . . . . . . . 22 102 14.2. Informative References . . . . . . . . . . . . . . . . . . 22 103 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22 105 1. Introduction 107 IKEv2, as described in [RFC5996] and its predecessor RFC 4306, has a 108 method for recovering from a reboot of one peer. As long as traffic 109 flows in both directions, the rebooted peer should re-establish the 110 tunnels immediately. However, in many cases the rebooted peer is a 111 VPN gateway that protects only servers, or else the non-rebooted peer 112 has a dynamic IP address. In such cases, the rebooted peer will not 113 be able to re-establish the tunnels. Section 2 describes how 114 recovery works under RFC 5996, and explains why it may take several 115 minutes. 117 The method proposed here, is to send an octet string, called a "QCD 118 token" in the IKE_AUTH exchange that establishes the tunnel. That 119 token can be stored on the peer as part of the IKE SA. After a 120 reboot, the rebooted implementation can re-generate the token, and 121 send it to the peer, so as to delete the IKE SA. Deleting the IKE SA 122 results is a quick establishment of new IPsec tunnels. This is 123 described in Section 3. 125 1.1. Conventions Used in This Document 127 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 128 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 129 document are to be interpreted as described in [RFC2119]. 131 The term "token" refers to an octet string that an implementation can 132 generate using only the properties of a protected IKE message (such 133 as IKE SPIs) as input. A conforming implementation MUST be able to 134 generate the same token from the same input even after rebooting. 136 The term "token maker" refers to an implementation that generates a 137 token and sends it to the peer as specified in this document. 139 The term "token taker" refers to an implementation that stores such a 140 token or a digest thereof, in order to verify that a new token it 141 receives is identical to the old token it has stored. 143 The term "non-volatile storage" in this document refers to a data 144 storage module, that persists across restarts of the token maker. 145 Examples of such a storage module include an internal disk, an 146 internal flash memory module, an external disk and an external 147 database. A small non-volatile storage module is required for a 148 token maker, but a larger one can be used to enhance performance, as 149 described in Section 9.2. 151 2. RFC 5996 Crash Recovery 153 When one peer loses state or reboots, the other peer does not get any 154 notification, so unidirectional IPsec traffic can still flow. The 155 rebooted peer will not be able to decrypt it, however, and the only 156 remedy is to send an unprotected INVALID_SPI notification as 157 described in section 3.10.1 of [RFC5996]. That section also 158 describes the processing of such a notification: 160 "If this Informational Message is sent outside the 161 context of an IKE_SA, it should be used by the recipient 162 only as a "hint" that something might be wrong (because it 163 could easily be forged)." 165 Since the INVALID_SPI can only be used as a hint, the non-rebooted 166 peer has to determine whether the IPsec SA, and indeed the parent IKE 167 SA are still valid. The method of doing this is described in section 168 2.4 of [RFC5996]. This method, called "liveness check" involves 169 sending a protected empty INFORMATIONAL message, and awaiting a 170 response. This procedure is sometimes referred to as "Dead Peer 171 Detection" or DPD. 173 Section 2.4 does not mandate how many times the liveness check 174 message should be retransmitted, or for how long, but does recommend 175 the following: 177 "It is 178 suggested that messages be retransmitted at least a dozen times over 179 a period of at least several minutes before giving up on an SA..." 181 Those "at least several minutes" are a time during part of which both 182 peers are active, but IPsec cannot be used. 184 Especially in the case of a reboot (rather than fail-over or 185 administrative clearing of state), the peer does not recover 186 immediately. Reboot, depending on the system may take from a few 187 seconds to a few minutes. This means that at first the peer just 188 goes silent, i.e. does not send or respond to any messages. IKEv2 189 implementation can detect this situation and follow the rules given 190 in the section 2.4: 192 If there has only been outgoing traffic on all of 193 the SAs associated with an IKE SA, it is essential to confirm 194 liveness of the other endpoint to avoid black holes. If no 195 cryptographically protected messages have been received on an IKE 196 SA or any of its Child SAs recently, the system needs to perform a 197 liveness check in order to prevent sending messages to a dead peer. 199 [RFC5996] does not mandate any time limits, but it is possible that 200 the peer will start liveness checks even before the other end is 201 sending INVALID_SPI notification, as it detected that the other end 202 is not sending any packets anymore while it is still rebooting or 203 recovering from the situation. 205 This means that the several minutes recovery period is overlaping the 206 actual recover time of the other peer, i.e. if the security gateway 207 requires several minutes to boot up from the crash then the other 208 peers have already finished their liveness checks before the crashing 209 peer even has change to send INVALID_SPI notifications. 211 There are cases where the peer looses state and is able to recover 212 immediately, in those cases it might take several minutes to recover. 214 Note, that IKEv2 specification specifically leaves number of retries 215 and lengths of timeouts out from the specification, as they do not 216 affect interoperability. This means that implementations are allowed 217 to use the hints provided by the INVALID_SPI messages as hints that 218 will shorten those timeouts (i.e. different environment and situation 219 requiring different rules). 221 Good existing IKEv2 implementations already do that (i.e. both 222 shorten timeouts or limit number of retries) based on that kind of 223 hints and also start liveness checks quickly after the other end goes 224 silent. 226 3. Protocol Outline 228 Supporting implementations will send a notification, called a "QCD 229 token", as described in Section 4.1 in the first IKE_AUTH exchange 230 messages. These are the first IKE_AUTH request and final IKE_AUTH 231 response that contain the AUTH payloads. The generation of these 232 tokens is a local matter for implementations, but considerations are 233 described in Section 5. Implementations that send such a token will 234 be called "token makers". 236 A supporting implementation receiving such a token MUST store it (or 237 a digest thereof) along with the IKE SA. Implementations that 238 support this part of the protocol will be called "token takers". 239 Section 9.1 has considerations for which implementations need to be 240 token takers, and which should be token makers. Implementation that 241 are not token takers will silently ignore QCD tokens. 243 When a token maker receives a protected IKE request message with 244 unknown IKE SPIs, it SHOULD generate a new token that is identical to 245 the previous token, and send it to the requesting peer in an 246 unprotected IKE message as described in Section 4.5. 248 When a token taker receives the QCD token in an unprotected 249 notification, it MUST verify that the TOKEN_SECRET_DATA matches the 250 token stored with the matching IKE SA. If the verification fails, or 251 if the IKE SPIs in the message do not match any existing IKE SA, it 252 SHOULD log the event. If it succeeds, it MUST silently delete the 253 IKE SA associated with the IKE_SPI fields, and all dependent child 254 SAs. This event MAY also be logged. The token taker MUST accept 255 such tokens from any IP address and port combination, so as to allow 256 different kinds of high-availability configurations of the token 257 maker. 259 A supporting token taker MAY immediately create new SAs using an 260 Initial exchange, or it may wait for subsequent traffic to trigger 261 the creation of new SAs. 263 See Section 8 for a short discussion about this extensions's 264 interaction with IKEv2 Session Resumption ([RFC5723]). 266 4. Formats and Exchanges 268 4.1. Notification Format 270 The notification payload called "QCD token" is formatted as follows: 272 1 2 3 273 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 274 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 275 ! Next Payload !C! RESERVED ! Payload Length ! 276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 277 ! Protocol ID ! SPI Size ! QCD Token Notify Message Type ! 278 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 279 ! ! 280 ~ TOKEN_SECRET_DATA ~ 281 ! ! 282 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 284 o Protocol ID (1 octet) MUST be 1, as this message is related to an 285 IKE SA. 286 o SPI Size (1 octet) MUST be zero, in conformance with section 3.10 287 of [RFC5996]. 288 o QCD Token Notify Message Type (2 octets) - MUST be xxxxx, the 289 value assigned for QCD token notifications. TBA by IANA. 290 o TOKEN_SECRET_DATA (16-128 octets) contains a generated token as 291 described in Section 5. 293 4.2. Passing a Token in the AUTH Exchange 295 For brevity, only the EAP version of an AUTH exchange will be 296 presented here. The non-EAP version is very similar. The figures 297 below are based on appendix C.3 of [RFC5996]. 299 first request --> IDi, 300 [N(INITIAL_CONTACT)], 301 [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+], 302 [IDr], 303 [N(QCD_TOKEN)] 304 [CP(CFG_REQUEST)], 305 [N(IPCOMP_SUPPORTED)+], 306 [N(USE_TRANSPORT_MODE)], 307 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 308 [N(NON_FIRST_FRAGMENTS_ALSO)], 309 SA, TSi, TSr, 310 [V+] 312 first response <-- IDr, [CERT+], AUTH, 313 EAP, 314 [V+] 316 / --> EAP 317 repeat 1..N times | 318 \ <-- EAP 320 last request --> AUTH 322 last response <-- AUTH, 323 [N(QCD_TOKEN)] 324 [CP(CFG_REPLY)], 325 [N(IPCOMP_SUPPORTED)], 326 [N(USE_TRANSPORT_MODE)], 327 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 328 [N(NON_FIRST_FRAGMENTS_ALSO)], 329 SA, TSi, TSr, 330 [N(ADDITIONAL_TS_POSSIBLE)], 331 [V+] 333 Note that the QCD_TOKEN notification is marked as optional because it 334 is not required by this specification that every implementation be 335 both token maker and token taker. If only one peer sends the QCD 336 token, then a reboot of the other peer will not be recoverable by 337 this method. This may be acceptable if traffic typically originates 338 from the other peer. 340 In any case, the lack of a QCD_TOKEN notification MUST NOT be taken 341 as an indication that the peer does not support this standard. 342 Conversely, if a peer does not understand this notification, it will 343 simply ignore it. Therefore a peer may send this notification 344 freely, even if it does not know whether the other side supports it. 346 The QCD_TOKEN notification is related to the IKE SA and MUST follow 347 the AUTH payload and precede the Configuration payload and all 348 payloads related to the child SA. 350 4.3. Replacing Tokens After Rekey or Resumption 352 After rekeying an IKE SA, the IKE SPIs are replaced, so the new SA 353 also needs to have a token. If only the responder in the rekey 354 exchange is the token maker, this can be done within the 355 CREATE_CHILD_SA exchange. If the initiator is a token maker, then we 356 need an extra informational exchange. 358 The following figure shows the CREATE_CHILD_SA exchange for rekeying 359 the IKE SA. Only the responder sends a QCD token. 361 request --> SA, Ni, [KEi] 363 response <-- SA, Nr, [KEr], N(QCD_TOKEN) 365 If the initiator is also a token maker, it SHOULD soon initiate an 366 INFORMATIONAL exchange as follows: 368 request --> N(QCD_TOKEN) 370 response <-- 372 For session resumption, as specified in [RFC5723], the situation is 373 similar. The responder, which is necessarily the peer that has 374 crashed, SHOULD send a new ticket within the protected payload of the 375 IKE_SESSION_RESUME exchange. If the Initiator is also a token maker, 376 it needs to send a QCD_TOKEN in a separate INFORMATIONAL exchange. 378 The INFORMATIONAL exchange described in this section can also be used 379 if QCD tokens need to be replaced due to a key rollover. However, 380 since token takers are required to verify at least 4 QCD tokens, this 381 is only necessary if secret QCD keys are rolled over more than four 382 times as often as IKE SAs are rekeyed. 384 4.4. Replacing the Token for an Existing SA 386 With some token generation methods, such as that described in 387 Section 5.2, a QCD token may sometimes become invalid, although the 388 IKE SA is still perfectly valid. 390 In such a case, the token maker MUST send the new token in a 391 protected message under that IKE SA. That exchange could be a simple 392 INFORMATIONAL, such as in the last figure in the previous section, or 393 else it can be part of a MOBIKE INFORMATIONAL exchange such as in the 394 following figure taken from section 2.2 of [RFC4555] and modified by 395 adding a QCD_TOKEN notification: 397 (IP_I2:4500 -> IP_R1:4500) 398 HDR, SK { N(UPDATE_SA_ADDRESSES), 399 N(NAT_DETECTION_SOURCE_IP), 400 N(NAT_DETECTION_DESTINATION_IP) } --> 402 <-- (IP_R1:4500 -> IP_I2:4500) 403 HDR, SK { N(NAT_DETECTION_SOURCE_IP), 404 N(NAT_DETECTION_DESTINATION_IP) } 406 <-- (IP_R1:4500 -> IP_I2:4500) 407 HDR, SK { N(COOKIE2), [N(QCD_TOKEN)] } 409 (IP_I2:4500 -> IP_R1:4500) 410 HDR, SK { N(COOKIE2), [N(QCD_TOKEN)] } --> 412 A token taker MUST accept such gratuitous QCD_TOKEN notifications as 413 long as they are carried in protected exchanges. A token maker 414 SHOULD NOT generate them unless it is no longer able to generate the 415 old QCD_TOKEN. 417 4.5. Presenting the Token in an Unprotected Message 419 This QCD_TOKEN notification is unprotected, and is sent as a response 420 to a protected IKE request, which uses an IKE SA that is unknown. 422 request --> N(INVALID_IKE_SPI), N(QCD_TOKEN)+ 424 If child SPIs are persistently mapped to IKE SPIs as described in 425 Section 9.2, a token taker may get the following unprotected message 426 in response to an ESP or AH packet. 428 request --> N(INVALID_SPI), N(QCD_TOKEN)+ 430 The QCD_TOKEN and INVALID_IKE_SPI notifications are sent together to 431 support both implementations that conform to this specification and 432 implementations that don't. Similar to the description in section 433 2.21 of [RFC5996], the IKE SPI and message ID fields in the packet 434 headers are taken from the protected IKE request. 436 To support a periodic rollover of the secret used for token 437 generation, the token taker MUST support at least four QCD_TOKEN 438 notifications in a single packet. The token is considered verified 439 if any of the QCD_TOKEN notifications matches. The token maker MAY 440 generate up to four QCD_TOKEN notifications, based on several 441 generations of keys. 443 If the QCD_TOKEN verifies OK, the receiver MUST silently discard the 444 IKE SA and all associated child SAs. If the QCD_TOKEN cannot be 445 validated, a response MUST NOT be sent, and the event may be logged. 446 Section 5 defines token verification. 448 5. Token Generation and Verification 450 No token generation method is mandated by this document. Two methods 451 are documented in the following sub-sections, but they only serve as 452 examples. 454 The following lists the requirements for a token generation 455 mechanism: 456 o Tokens MUST be at least 16 octets long, and no more than 128 457 octets long, to facilitate storage and transmission. Tokens 458 SHOULD be indistinguishable from random data. 459 o It should not be possible for an external attacker to guess the 460 QCD token generated by an implementation. Cryptographic 461 mechanisms such as PRNG and hash functions are RECOMMENDED. 462 o The token maker MUST be able to re-generate or retrieve the token 463 based on the IKE SPIs even after it reboots. 464 o The method of token generation MUST be such that a collision of 465 QCD tokens between different pairs of IKE SPI will be highly 466 unlikely. 468 5.1. A Stateless Method of Token Generation 470 This describes a stateless method of generating a token: 471 o At installation or immediately after the first boot of the token 472 maker, 32 random octets are generated using a secure random number 473 generator or a PRNG. 474 o Those 32 bytes, called the "QCD_SECRET", are stored in non- 475 volatile storage on the machine, and kept indefinitely. 476 o If key rollover is required by policy, the implementation MAY 477 periodically generate a new QCD_SECRET and keep up to 3 previous 478 generations. When sending an unprotected QCD_TOKEN, as many as 4 479 notification payloads may be sent, each from a different 480 QCD_SECRET. 481 o The TOKEN_SECRET_DATA is calculated as follows: 483 TOKEN_SECRET_DATA = HASH(QCD_SECRET | SPI-I | SPI-R) 485 5.2. A Stateless Method with IP addresses 487 This method is similar to the one in the previous section, except 488 that the IP address of the token taker is also added to the block 489 being hashed. This has the disadvantage that the token needs to be 490 replaced (as described in Section 4.4) whenever the token taker 491 changes its address. 493 The reason to use this method is described in Section 10.4. When 494 using this method, the TOKEN_SECRET_DATA field is calculated as 495 follows: 497 TOKEN_SECRET_DATA = HASH(QCD_SECRET | SPI-I | SPI-R | IPaddr-T) 499 The IPaddr-T field specifies the IP address of the token taker. 500 Secret rollover considerations are similar to those in the previous 501 section. 503 5.3. Token Lifetime 505 The token is associated with a single IKE SA, and SHOULD be deleted 506 by the token taker when the SA is deleted or expires. More formally, 507 the token is associated with the pair (SPI-I, SPI-R). 509 6. Backup Gateways 511 Making crash detection and recovery quick is a worthy goal, but since 512 rebooting a gateway takes a non-zero amount of time, many 513 implementations choose to have a stand-by gateway ready to take over 514 as soon as the primary gateway fails for any reason. [cluster] 515 describes considerations for such clusters of gateways with 516 synchronized state, but the rest of this section is relevant even 517 when there is no synchronized state. 519 If such a configuration is available, it is RECOMMENDED that the 520 stand-by gateway be able to generate the same token as the active 521 gateway. if the method described in Section 5.1 is used, this means 522 that the QCD_SECRET field is identical in both gateways. This has 523 the effect of having the crash recovery available immediately. 525 Note that this refers to "high availability" configurations, where 526 only one gateway is active at any given moment. This is different 527 from "load sharing" configurations where more than one gateway is 528 active at the same time. For load sharing configurations, please see 529 Section 10.2 for security considerations. 531 7. Alternative Solutions 533 7.1. Initiating a new IKE SA 535 Instead of sending a QCD token, we could have the rebooted 536 implementation start an Initial exchange with the peer, including the 537 INITIAL_CONTACT notification. This would have the same effect, 538 instructing the peer to erase the old IKE SA, as well as establishing 539 a new IKE SA with fewer rounds. 541 The disadvantage here, is that in IKEv2 an authentication exchange 542 MUST have a piggy-backed Child SA set up. Since our use case is such 543 that the rebooted implementation does not have traffic flowing to the 544 peer, there are no good selectors for such a Child SA. 546 Additionally, when authentication is asymmetric, such as when EAP is 547 used, it is not possible for the rebooted implementation to initiate 548 IKE. 550 7.2. SIR 552 Another proposal that was considered for this work item is the SIR 553 extension, which is described in [recovery]. Under that proposal, 554 the non-rebooted peer sends a non-protected query to the possibly 555 rebooted peer, asking whether the IKE SA exists. The peer replies 556 with either a positive or negative response, and the absence of a 557 positive response, along with the existence of a negative response is 558 taken as proof that the IKE SA has really been lost. 560 The working group preferred the QCD proposal to this one. 562 7.3. Birth Certificates 564 Birth Certificates is a method of crash detection that has never been 565 formally defined. Bill Sommerfeld suggested this idea in a mail to 566 the IPsec mailing list on August 7, 2000, in a thread discussing 567 methods of crash detection: 569 If we have the system sign a "birth certificate" when it 570 reboots (including a reboot time or boot sequence number), 571 we could include that with a "bad spi" ICMP error and in 572 the negotiation of the IKE SA. 574 We believe that this method would have some problems. First, it 575 requires Alice to store the certificate, so as to be able to compare 576 the public keys. That requires more storage than does a QCD token. 577 Additionally, the public-key operations needed to verify the self- 578 signed certificates are more expensive for Alice. 580 We believe that a symmetric-key operation such as proposed here is 581 more light-weight and simple than that implied by the Birth 582 Certificate idea. 584 7.4. Reducing Liveness Check Length 586 Some have suggested that the RFC 5996 procedure described in 587 Section 2 can be tweaked by requiring fewer retransmissions over a 588 shorter period of time for cases of liveness check started because of 589 an INVALID_SPI or INVALID_IKE_SPI notification. 591 We believe that the default retransmission policy should represent a 592 good balance between the need for a timely discovery of a dead peer, 593 and a low probability of false detection. We expect the policy to be 594 set to take the shortest time such that this probability achieves a 595 certain target. Therefore, reducing elapsed time and retransmission 596 count will create an unacceptably high probability of false 597 detection, and this can be triggered by a single INVALID_IKE_SPI 598 notification. 600 Additionally, even if the retransmission policy is reduced to, say, 601 one minute, it is still a very noticeable delay from a human 602 perspective, from the time that the gateway has come up until the 603 tunnels are active, or from the time the backup gateway has taken 604 over until the tunnels are active. 606 8. Interaction with Session Resumption 608 Session Resumption, specified in [RFC5723] proposes to make setting 609 up a new IKE SA consume less computing resources. This is 610 particularly useful in the case of a remote access gateway that has 611 many tunnels. A failure of such a gateway would require all these 612 many remote access clients to establish an IKE SA either with the 613 rebooted gateway or with a backup gateway. This tunnel re- 614 establishment should occur within a short period of time, creating a 615 burden on the remote access gateway. Session Resumption addresses 616 this problem by having the clients store an encrypted derivative of 617 the IKE SA for quick re-establishment. 619 What Session Resumption does not help is the problem of detecting 620 that the peer gateway has failed. A failed gateway may go undetected 621 for as long as the lifetime of a child SA, because IPsec does not 622 have packet acknowledgement, and applications cannot signal the IPsec 623 layer that the tunnel "does not work". Before establishing a new IKE 624 SA using Session Resumption, a client should ascertain that the 625 gateway has indeed failed. This could be done using either a 626 liveness check (as in RFC 5996) or using the QCD tokens described in 627 this document. 629 A remote access client conforming to both specifications will store 630 QCD tokens, as well as the Session Resumption ticket, if provided by 631 the gateway. A remote access gateway conforming to both 632 specifications will generate a QCD token for the client. When the 633 gateway reboots, the client will discover this in either of two ways: 634 1. The client does regular liveness checks, or else the time for 635 some other IKE exchange has come. Since the gateway is still 636 down, the IKE exchange times out after several minutes. In this 637 case QCD does not help. 638 2. Either the primary gateway or a backup gateway (see Section 6) is 639 ready and sends a QCD token to the client. In that case the 640 client will quickly re-establish the IPsec tunnel, either with 641 the rebooted primary gateway or the backup gateway as described 642 in this document. 644 The full combined protocol looks like this: 646 Initiator Responder 647 ----------- ----------- 648 HDR, SAi1, KEi, Ni --> 650 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 652 HDR, SK {IDi, [CERT,] 653 [CERTREQ,] [IDr,] 654 AUTH, N(QCD_TOKEN) 655 SAi2, TSi, TSr, 656 N(TICKET_REQUEST)} --> 657 <-- HDR, SK {IDr, [CERT,] AUTH, 658 N(QCD_TOKEN), SAr2, TSi, TSr, 659 N(TICKET_LT_OPAQUE) } 661 ---- Reboot ----- 663 HDR, {} --> 664 <-- HDR, N(QCD_TOKEN) 666 HDR, [N(COOKIE),] 667 Ni, N(TICKET_OPAQUE) 668 [,N+] --> 669 <-- HDR, Nr [,N+] 671 9. Operational Considerations 673 9.1. Who should implement this specification 675 Throughout this document, we have referred to reboot time 676 alternatingly as the time that the implementation crashes and the 677 time when it is ready to process IPsec packets and IKE exchanges. 678 Depending on the hardware and software platforms and the cause of the 679 reboot, rebooting may take anywhere from a few seconds to several 680 minutes. If the implementation is down for a long time, the benefit 681 of this protocol extension is reduced. For this reason critical 682 systems should implement backup gateways as described in Section 6. 684 Implementing the "token maker" side of QCD makes sense for IKE 685 implementation where protected connections originate from the peer, 686 such as inter-domain VPNs and remote access gateways. Implementing 687 the "token taker" side of QCD makes sense for IKE implementations 688 where protected connections originate, such as inter-domain VPNs and 689 remote access clients. 691 To clarify the this discussion: 692 o For remote-access clients it makes sense to implement the token 693 taker role. 694 o For remote-access gateways it makes sense to implement the token 695 maker role. 696 o For inter-domain VPN gateway it makes sense to implement both 697 roles, because it can't be known in advance where the traffic 698 originates. 699 o It is perfectly valid to implement both roles in any case, for 700 example when using a single library or a single gateway to perform 701 several roles. 703 In order to limit the effects of DoS attacks, a token taker SHOULD 704 limit the rate of QCD_TOKENs verified from a particular source. 706 If excessive amounts of IKE requests protected with unknown IKE SPIs 707 arrive at a token maker, the IKE module SHOULD revert to the behavior 708 described in section 2.21 of [RFC5996] and either send an 709 INVALID_IKE_SPI notification, or ignore it entirely. 711 9.2. Response to unknown child SPI 713 After a reboot, it is more likely that an implementation receives 714 IPsec packets than IKE packets. In that case, the rebooted 715 implementation will send an INVALID_SPI notification, triggering a 716 liveness check. The token will only be sent in a response to the 717 liveness check, thus requiring an extra round-trip. 719 To avoid this, an implementation that has access to enough non- 720 volatile storage MAY store a mapping of child SPIs to owning IKE 721 SPIs, or to generated tokens. If such a mapping is available and 722 persistent across reboots, the rebooted implementation SHOULD respond 723 to the IPsec packet with an INVALID_SPI notification, along with the 724 appropriate QCD_Token notifications. A token taker SHOULD verify the 725 QCD token that arrives with an INVALID_SPI notification the same as 726 if it arrived with the IKE SPIs of the parent IKE SA. 728 However, a persistent storage module might not be updated in a timely 729 manner, and could be populated with tokens relating to IKE SPIs that 730 have already been rekeyed. A token taker MUST NOT take an invalid 731 QCD Token sent along with an INVALID_SPI notification as evidence 732 that the peer is either malfunctioning or attacking, but it SHOULD 733 limit the rate at which such notifications are processed. 735 10. Security Considerations 737 The extension described in this document must not reduce the security 738 of IKEv2 or IPsec. Specifically, an eavesdropper must not learn any 739 non-public information about the peers. 741 The proposed mechanism should be secure against attacks by a passive 742 MITM (eavesdropper). Such an attacker must not be able to disrupt an 743 existing IKE session, either by resetting the session or by 744 introducing significant delays. This requirement is especially 745 significant, because this document introduces a new way to reset an 746 IKE SA. 748 The mechanism need not be similarly secure against an active MITM, 749 since this type of attacker is already able to disrupt IKE sessions. 751 10.1. QCD Token Generation and Handling 753 Tokens MUST be hard to guess. This is critical, because if an 754 attacker can guess the token associated with an IKE SA, she can tear 755 down the IKE SA and associated tunnels at will. When the token is 756 delivered in the IKE_AUTH exchange, it is encrypted. When it is sent 757 again in an unprotected notification, it is not, but that is the last 758 time this token is ever used. 760 An aggregation of some tokens generated by one maker together with 761 the related IKE SPIs MUST NOT give an attacker the ability to guess 762 other tokens. Specifically, if one taker does not properly secure 763 the QCD tokens and an attacker gains access to them, this attacker 764 MUST NOT be able to guess other tokens generated by the same maker. 765 This is the reason that the QCD_SECRET in Section 5.1 needs to be 766 sufficiently long. 768 The token taker MUST store the token in a secure manner. No attacker 769 should be able to gain access to a stored token. 771 The QCD_SECRET MUST be protected from access by other parties. 772 Anyone gaining access to this value will be able to delete all the 773 IKE SAs for this token maker. 775 The QCD token is sent by the rebooted peer in an unprotected message. 776 A message like that is subject to modification, deletion and replay 777 by an attacker. However, these attacks will not compromise the 778 security of either side. Modification is meaningless because a 779 modified token is simply an invalid token. Deletion will only cause 780 the protocol not to work, resulting in a delay in tunnel re- 781 establishment as described in Section 2. Replay is also meaningless, 782 because the IKE SA has been deleted after the first transmission. 784 10.2. QCD Token Transmission 786 A token maker MUST NOT send a QCD token in an unprotected message for 787 an existing IKE SA. This implies that a conforming QCD token maker 788 MUST be able to tell whether a particular pair of IKE SPIs represent 789 a valid IKE SA. 791 This requirement is obvious and easy in the case of a single gateway. 792 However, some implementations use a load balancer to divide the load 793 between several physical gateways. It MUST NOT be possible even in 794 such a configuration to trick one gateway into sending a QCD token 795 for an IKE SA which is valid on another gateway. 797 This document does not specify how a load sharing configuration of 798 IPsec gateways would work, but in order to support this 799 specification, all members MUST be able to tell whether a particular 800 IKE SA is active anywhere in the cluster. One way to do it is to 801 synchronize a list of active IKE SPIs among all the cluster members. 803 10.3. QCD Token Enumeration 805 An attacker may try to attack QCD if the generation algorithm 806 described in Section 5.1 is used. The attacker will send several 807 fake IKE requests to the gateway under attack, receiving and 808 recording the QCD Tokens in the responses. This will allow the 809 attacker to create a dictionary of IKE SPIs to QCD Tokens, which can 810 later be used to tear down any IKE SA. 812 Three factors mitigate this threat: 814 o The space of all possible IKE SPI pairs is huge: 2^128, so making 815 such a dictionary is impractical. Even if we assume that one 816 implementation always generates predictable IKE SPIs, the space is 817 still at least 2^64 entries, so making the dictionary is extremely 818 hard. To ensure this, token makers MUST generate unpredictable 819 IKE SPIs by using a cryptographically strong pseudo-random number 820 generator. 821 o Throttling the amount of QCD_TOKEN notifications sent out, as 822 discussed in Section 9.1, especially when not soon after a crash 823 will limit the attacker's ability to construct a dictionary. 824 o The methods in Section 5.1 and Section 5.2 allow for a periodic 825 change of the QCD_SECRET. Any such change invalidates the entire 826 dictionary. 828 10.4. Selecting an Appropriate Token Generation Method 830 This section describes the rationale for token generation methods 831 such as the one described in Section 5.2. Note that this section 832 merely provides a possible rationale, and does not specify or 833 recommend any kind of configuration. 835 Some configurations of security gateway use a load-sharing cluster of 836 hosts, all sharing the same IP addresses, where the SAs (IKE and 837 child) are not synchronized between the cluster members. In such a 838 configuration, a single member does not know about all the IKE SAs 839 that are active for the configuration. A load balancer (usually a 840 networking switch) sends IKE and IPsec packets to the several members 841 based on source IP address. 843 In such a configuration, an attacker can send a forged protected IKE 844 packet with the IKE SPIs of an existing IKE SA, but from a different 845 IP address. This packet will likely be processed by a different 846 cluster member from the one that owns the IKE SA. Since no IKE SA 847 state is stored on this member, it will send a QCD token to the 848 attacker. If the QCD token does not depend on IP address, this token 849 can immediately be used to tell the token taker to tear down the IKE 850 SA using an unprotected QCD_TOKEN notification. 852 To thwart this possible attack, such configurations should use a 853 method that considers the taker's IP address, such as the method 854 described in Section 5.2. 856 On the other hand, when using this method a change of address 857 invalidates the tokens, so this method is only recommended when the 858 configuration involves gateways generating the same tokens without 859 access to all the IKE SAs. 861 11. IANA Considerations 863 IANA is requested to assign a notify message type from the status 864 types range (16406-40959) of the "IKEv2 Notify Message Types" 865 registry with name "QUICK_CRASH_DETECTION". 867 12. Acknowledgements 869 We would like to thank Hannes Tschofenig and Yaron Sheffer for their 870 comments about Session Resumption. 872 Others who have contrinuted valuable comments are, in alphabetical 873 order, Lakshminath Dondeti, Tero Kivinen, and Scott C Moonen. 875 13. Change Log 877 This section lists all changes in this document 879 NOTE TO RFC EDITOR : Please remove this section in the final RFC 881 13.1. Changes from draft-ietf-ipsecme-failure-detection-01 883 o Fixed the language requiring random IKE SPIs. 884 o Some better explanation of the reasons to choose the methods in 885 Section 5.2 and the method in Section 5.1, to close issue #193. 886 o Added text to the beginning of Section 10 to accomodate issue 887 #194. 889 13.2. Changes from draft-ietf-ipsecme-failure-detection-00 891 o Nits pointed out by Scott and Yaron. 892 o Pratima and Frederic are back on board. 893 o Changed IKEv2bis draft reference to RFC 5996. 894 o Resolved issues #189, #190, #191, and #192: 895 * Renamed section 4.5 and removed the requirement to send an 896 acknowledgement for the unprotected message. 897 * Moved the QCD token from the last to the first IKE_AUTH 898 request. 899 * Added a MUST to Section 10.3 to require that IKE SPIs be 900 randomly generated. 901 * Changed the language in Section 9.1, to not use RFC 2119 902 terminology. 903 * Moved the section describing why one would want the method 904 dependant on IP addresses (in Section 5.2 from operational 905 considerations to security considerations. 907 13.3. Changes from draft-nir-ike-qcd-07 909 o First WG version. 910 o Addressed Scott C Moonen's concern about collisions of QCD tokens. 911 o Updated references to point to IKEv2bis instead of RFC 4306 and 912 4718. Also converted draft reference for resumption to RFC 5723. 913 o Added Dave Wiebrowski as author, and removed Pratima and Frederic. 915 13.4. Changes from draft-nir-ike-qcd-03 and -04 917 Mostly editorial changes and cleaning up. 919 13.5. Changes from draft-nir-ike-qcd-02 921 o Described QCD token enumeration, following a question by 922 Lakshminath Dondeti. 923 o Added the ability to replace the QCD token for an existing IKE SA. 924 o Added tokens dependent on peer IP address and their interaction 925 with MOBIKE. 927 13.6. Changes from draft-nir-ike-qcd-01 929 o Removed stateless method. 930 o Added discussion of rekeying and resumption. 931 o Added discussion of non-synchronized load-balanced clusters of 932 gateways in the security considerations. 933 o Other wording fixes. 935 13.7. Changes from draft-nir-ike-qcd-00 937 o Merged proposal with draft-detienne-ikev2-recovery 938 o Changed the protocol so that the rebooted peer generates the 939 token. This has the effect, that the need for persistent storage 940 is eliminated. 941 o Added discussion of birth certificates. 943 13.8. Changes from draft-nir-qcr-00 945 o Changed name to reflect that this relates to IKE. Also changed 946 from quick crash recovery to quick crash detection to avoid 947 confusion with IFARE. 948 o Added more operational considerations. 949 o Added interaction with IFARE. 950 o Added discussion of backup gateways. 952 14. References 953 14.1. Normative References 955 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 956 Requirement Levels", BCP 14, RFC 2119, March 1997. 958 [RFC4555] Eronen, P., "IKEv2 Mobility and Multihoming Protocol 959 (MOBIKE)", RFC 4555, June 2006. 961 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 962 "Internet Key Exchange Protocol: IKEv2", RFC 5996, 963 September 2010. 965 14.2. Informative References 967 [RFC5723] Sheffer, Y. and H. Tschofenig, "IKEv2 Session Resumption", 968 RFC 5723, January 2010. 970 [cluster] Nir, Y., Ed., "IPsec Cluster Problem Statement", 971 draft-ietf-ipsecme-ipsec-ha (work in progress), July 2010. 973 [recovery] 974 Detienne, F., Sethi, P., and Y. Nir, "Safe IKE Recovery", 975 draft-detienne-ikev2-recovery (work in progress), 976 January 2010. 978 Authors' Addresses 980 Yoav Nir (editor) 981 Check Point Software Technologies Ltd. 982 5 Hasolelim st. 983 Tel Aviv 67897 984 Israel 986 Email: ynir@checkpoint.com 988 David Wierbowski 989 International Business Machines 990 1701 North Street 991 Endicott, New York 13760 992 United States 994 Email: wierbows@us.ibm.com 995 Frederic Detienne 996 Cisco Systems, Inc. 997 De Kleetlaan, 7 998 Diegem B-1831 999 Belgium 1001 Phone: +32 2 704 5681 1002 Email: fd@cisco.com 1004 Pratima Sethi 1005 Cisco Systems, Inc. 1006 O'Shaugnessy Road, 11 1007 Bangalore, Karnataka 560027 1008 India 1010 Phone: +91 80 4154 1654 1011 Email: psethi@cisco.com