idnits 2.17.1 draft-ietf-ipsecme-failure-detection-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 -- The document date (February 11, 2011) is 4824 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 305, but not defined == Missing Reference: 'KEi' is mentioned on line 364, but not defined == Missing Reference: 'KEr' is mentioned on line 366, but not defined == Missing Reference: 'CERTREQ' is mentioned on line 585, 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: August 15, 2011 IBM 6 F. Detienne 7 P. Sethi 8 Cisco 9 February 11, 2011 11 A Quick Crash Detection Method for IKE 12 draft-ietf-ipsecme-failure-detection-04 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 August 15, 2011. 43 Copyright Notice 45 Copyright (c) 2011 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 . . . . . . . . . 10 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. Interaction with Session Resumption . . . . . . . . . . . . . 13 76 8. Operational Considerations . . . . . . . . . . . . . . . . . . 14 77 8.1. Who should implement this specification . . . . . . . . . 14 78 8.2. Response to unknown child SPI . . . . . . . . . . . . . . 15 79 9. Security Considerations . . . . . . . . . . . . . . . . . . . 16 80 9.1. QCD Token Generation and Handling . . . . . . . . . . . . 16 81 9.2. QCD Token Transmission . . . . . . . . . . . . . . . . . 17 82 9.3. QCD Token Enumeration . . . . . . . . . . . . . . . . . . 18 83 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 84 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 18 85 12. Change Log . . . . . . . . . . . . . . . . . . . . . . . . . . 18 86 12.1. Changes from draft-ietf-ipsecme-failure-detection-03 . . 19 87 12.2. Changes from draft-ietf-ipsecme-failure-detection-02 . . 19 88 12.3. Changes from draft-ietf-ipsecme-failure-detection-01 . . 19 89 12.4. Changes from draft-ietf-ipsecme-failure-detection-00 . . 19 90 12.5. Changes from draft-nir-ike-qcd-07 . . . . . . . . . . . . 19 91 12.6. Changes from draft-nir-ike-qcd-03 and -04 . . . . . . . . 20 92 12.7. Changes from draft-nir-ike-qcd-02 . . . . . . . . . . . . 20 93 12.8. Changes from draft-nir-ike-qcd-01 . . . . . . . . . . . . 20 94 12.9. Changes from draft-nir-ike-qcd-00 . . . . . . . . . . . . 20 95 12.10. Changes from draft-nir-qcr-00 . . . . . . . . . . . . . . 20 96 13. References . . . . . . . . . . . . . . . . . . . . . . . . . . 20 97 13.1. Normative References . . . . . . . . . . . . . . . . . . 20 98 13.2. Informative References . . . . . . . . . . . . . . . . . 21 99 Appendix A. The Path Not Taken . . . . . . . . . . . . . . . . . 21 100 A.1. Initiating a new IKE SA . . . . . . . . . . . . . . . . . 21 101 A.2. SIR . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 102 A.3. Birth Certificates . . . . . . . . . . . . . . . . . . . 22 103 A.4. Reducing Liveness Check Length . . . . . . . . . . . . . 22 104 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 22 106 1. Introduction 108 IKEv2, as described in [RFC5996] and its predecessor RFC 4306, has a 109 method for recovering from a reboot of one peer. As long as traffic 110 flows in both directions, the rebooted peer should re-establish the 111 tunnels immediately. However, in many cases the rebooted peer is a 112 VPN gateway that protects only servers, or else the non-rebooted peer 113 has a dynamic IP address. In such cases, the rebooted peer will not 114 be able to re-establish the tunnels. Section 2 describes how 115 recovery works under RFC 5996, and explains why it may take several 116 minutes. 118 The method proposed here, is to send an octet string, called a "QCD 119 token" in the IKE_AUTH exchange that establishes the tunnel. That 120 token can be stored on the peer as part of the IKE SA. After a 121 reboot, the rebooted implementation can re-generate the token, and 122 send it to the peer, so as to delete the IKE SA. Deleting the IKE SA 123 results is a quick establishment of new IPsec tunnels. This is 124 described in Section 3. 126 1.1. Conventions Used in This Document 128 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 129 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 130 document are to be interpreted as described in [RFC2119]. 132 The term "token" refers to an octet string that an implementation can 133 generate using only the properties of a protected IKE message (such 134 as IKE SPIs) as input. A conforming implementation MUST be able to 135 generate the same token from the same input even after rebooting. 137 The term "token maker" refers to an implementation that generates a 138 token and sends it to the peer as specified in this document. 140 The term "token taker" refers to an implementation that stores such a 141 token or a digest thereof, in order to verify that a new token it 142 receives is identical to the old token it has stored. 144 The term "non-volatile storage" in this document refers to a data 145 storage module, that persists across restarts of the token maker. 146 Examples of such a storage module include an internal disk, an 147 internal flash memory module, an external disk and an external 148 database. A small non-volatile storage module is required for a 149 token maker, but a larger one can be used to enhance performance, as 150 described in Section 8.2. 152 2. RFC 5996 Crash Recovery 154 When one peer loses state or reboots, the other peer does not get any 155 notification, so unidirectional IPsec traffic can still flow. The 156 rebooted peer will not be able to decrypt it, however, and the only 157 remedy is to send an unprotected INVALID_SPI notification as 158 described in section 3.10.1 of [RFC5996]. That section also 159 describes the processing of such a notification: 161 "If this Informational Message is sent outside the 162 context of an IKE_SA, it should be used by the recipient 163 only as a "hint" that something might be wrong (because it 164 could easily be forged)." 166 Since the INVALID_SPI can only be used as a hint, the non-rebooted 167 peer has to determine whether the IPsec SA, and indeed the parent IKE 168 SA are still valid. The method of doing this is described in section 169 2.4 of [RFC5996]. This method, called "liveness check" involves 170 sending a protected empty INFORMATIONAL message, and awaiting a 171 response. This procedure is sometimes referred to as "Dead Peer 172 Detection" or DPD. 174 Section 2.4 does not mandate how many times the liveness check 175 message should be retransmitted, or for how long, but does recommend 176 the following: 178 "It is 179 suggested that messages be retransmitted at least a dozen times over 180 a period of at least several minutes before giving up on an SA..." 182 Those "at least several minutes" are a time during part of which both 183 peers are active, but IPsec cannot be used. 185 Especially in the case of a reboot (rather than fail-over or 186 administrative clearing of state), the peer does not recover 187 immediately. Reboot, depending on the system, may take from a few 188 seconds to a few minutes. This means that at first the peer just 189 goes silent, i.e., does not send or respond to any messages. IKEv2 190 implementations can detect this situation and follow the rules given 191 in section 2.4: 193 If there has only been outgoing traffic on all of 194 the SAs associated with an IKE SA, it is essential to confirm 195 liveness of the other endpoint to avoid black holes. If no 196 cryptographically protected messages have been received on an IKE 197 SA or any of its Child SAs recently, the system needs to perform a 198 liveness check in order to prevent sending messages to a dead peer. 200 [RFC5996] does not mandate any time limits, but it is possible that 201 the peer will start liveness checks even before the other end is 202 sending INVALID_SPI notification, as it detected that the other end 203 is not sending any packets anymore while it is still rebooting or 204 recovering from the situation. 206 This means that the several minutes recovery period is overlaping the 207 actual recover time of the other peer, i.e., if the security gateway 208 requires several minutes to boot up from the crash then the other 209 peers have already finished their liveness checks before the crashing 210 peer even has a chance to send INVALID_SPI notifications. 212 There are cases where the peer loses state and is able to recover 213 immediately; in those cases it might take several minutes to recover. 215 Note that the IKEv2 specification specifically gives no guidance for 216 the number of retries or the length of timeouts, as these do not 217 affect interoperability. This means that implementations are allowed 218 to use the hints provided by the INVALID_SPI messages to shorten 219 those timeouts (i.e., different environment and situation requiring 220 different rules). 222 Some existing IKEv2 implementations already do that (i.e., both 223 shorten timeouts or limit number of retries) based on these kind of 224 hints and also start liveness checks quickly after the other end goes 225 silent. However, see Appendix A.4 for a discussion of why this may 226 not be enough. 228 3. Protocol Outline 230 Supporting implementations will send a notification, called a "QCD 231 token", as described in Section 4.1 in the first IKE_AUTH exchange 232 messages. These are the first IKE_AUTH request and final IKE_AUTH 233 response that contain the AUTH payloads. The generation of these 234 tokens is a local matter for implementations, but considerations are 235 described in Section 5. Implementations that send such a token will 236 be called "token makers". 238 A supporting implementation receiving such a token MUST store it (or 239 a digest thereof) along with the IKE SA. Implementations that 240 support this part of the protocol will be called "token takers". 241 Section 8.1 has considerations for which implementations need to be 242 token takers, and which should be token makers. Implementations that 243 are not token takers will silently ignore QCD tokens. 245 When a token maker receives a protected IKE request message with 246 unknown IKE SPIs, it SHOULD generate a new token that is identical to 247 the previous token, and send it to the requesting peer in an 248 unprotected IKE message as described in Section 4.5. 250 When a token taker receives the QCD token in an unprotected 251 notification, it MUST verify that the TOKEN_SECRET_DATA matches the 252 token stored with the matching IKE SA. If the verification fails, or 253 if the IKE SPIs in the message do not match any existing IKE SA, it 254 SHOULD log the event. If it succeeds, it MUST silently delete the 255 IKE SA associated with the IKE_SPI fields, and all dependent child 256 SAs. This event MAY also be logged. The token taker MUST accept 257 such tokens from any IP address and port combination, so as to allow 258 different kinds of high-availability configurations of the token 259 maker. 261 A supporting token taker MAY immediately create new SAs using an 262 Initial exchange, or it may wait for subsequent traffic to trigger 263 the creation of new SAs. 265 See Section 7 for a short discussion about this extensions's 266 interaction with IKEv2 Session Resumption ([RFC5723]). 268 4. Formats and Exchanges 270 4.1. Notification Format 272 The notification payload called "QCD token" is formatted as follows: 274 1 2 3 275 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 276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 277 ! Next Payload !C! RESERVED ! Payload Length ! 278 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 279 ! Protocol ID ! SPI Size ! QCD Token Notify Message Type ! 280 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 281 ! ! 282 ~ TOKEN_SECRET_DATA ~ 283 ! ! 284 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 286 o Protocol ID (1 octet) MUST be 1, as this message is related to an 287 IKE SA. 288 o SPI Size (1 octet) MUST be zero, in conformance with section 3.10 289 of [RFC5996]. 290 o QCD Token Notify Message Type (2 octets) - MUST be xxxxx, the 291 value assigned for QCD token notifications. TBA by IANA. 293 o TOKEN_SECRET_DATA (variable) contains a generated token as 294 described in Section 5. 296 4.2. Passing a Token in the AUTH Exchange 298 For brevity, only the EAP version of an AUTH exchange will be 299 presented here. The non-EAP version is very similar. The figures 300 below are based on appendix C.3 of [RFC5996]. 302 first request --> IDi, 303 [N(INITIAL_CONTACT)], 304 [[N(HTTP_CERT_LOOKUP_SUPPORTED)], CERTREQ+], 305 [IDr], 306 [N(QCD_TOKEN)] 307 [CP(CFG_REQUEST)], 308 [N(IPCOMP_SUPPORTED)+], 309 [N(USE_TRANSPORT_MODE)], 310 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 311 [N(NON_FIRST_FRAGMENTS_ALSO)], 312 SA, TSi, TSr, 313 [V+] 315 first response <-- IDr, [CERT+], AUTH, 316 EAP, 317 [V+] 319 / --> EAP 320 repeat 1..N times | 321 \ <-- EAP 323 last request --> AUTH 325 last response <-- AUTH, 326 [N(QCD_TOKEN)] 327 [CP(CFG_REPLY)], 328 [N(IPCOMP_SUPPORTED)], 329 [N(USE_TRANSPORT_MODE)], 330 [N(ESP_TFC_PADDING_NOT_SUPPORTED)], 331 [N(NON_FIRST_FRAGMENTS_ALSO)], 332 SA, TSi, TSr, 333 [N(ADDITIONAL_TS_POSSIBLE)], 334 [V+] 336 Note that the QCD_TOKEN notification is marked as optional because it 337 is not required by this specification that every implementation be 338 both token maker and token taker. If only one peer sends the QCD 339 token, then a reboot of the other peer will not be recoverable by 340 this method. This may be acceptable if traffic typically originates 341 from the other peer. 343 In any case, the lack of a QCD_TOKEN notification MUST NOT be taken 344 as an indication that the peer does not support this standard. 345 Conversely, if a peer does not understand this notification, it will 346 simply ignore it. Therefore a peer may send this notification 347 freely, even if it does not know whether the other side supports it. 349 The QCD_TOKEN notification is related to the IKE SA and should follow 350 the AUTH payload and precede the Configuration payload and all 351 payloads related to the child SA. 353 4.3. Replacing Tokens After Rekey or Resumption 355 After rekeying an IKE SA, the IKE SPIs are replaced, so the new SA 356 also needs to have a token. If only the responder in the rekey 357 exchange is the token maker, this can be done within the 358 CREATE_CHILD_SA exchange. If the initiator is a token maker, then we 359 need an extra informational exchange. 361 The following figure shows the CREATE_CHILD_SA exchange for rekeying 362 the IKE SA. Only the responder sends a QCD token. 364 request --> SA, Ni, [KEi] 366 response <-- SA, Nr, [KEr], N(QCD_TOKEN) 368 If the initiator is also a token maker, it SHOULD initiate an 369 INFORMATIONAL exchange immediately after the CREATE_CHILD_SA exchange 370 as follows: 372 request --> N(QCD_TOKEN) 374 response <-- 376 For session resumption, as specified in [RFC5723], the situation is 377 similar. The responder, which is necessarily the peer that has 378 crashed, SHOULD send a new ticket within the protected payload of the 379 IKE_SESSION_RESUME exchange. If the Initiator is also a token maker, 380 it needs to send a QCD_TOKEN in a separate INFORMATIONAL exchange. 382 The INFORMATIONAL exchange described in this section can also be used 383 if QCD tokens need to be replaced due to a key rollover. However, 384 since token takers are required to verify at least 4 QCD tokens, this 385 is only necessary if secret QCD keys are rolled over more than four 386 times as often as IKE SAs are rekeyed. See Section 5.1 for an 387 example method that uses secret keys which may require rollover. 389 4.4. Replacing the Token for an Existing SA 391 With some token generation methods, such as that described in 392 Section 5.2, a QCD token may sometimes become invalid, although the 393 IKE SA is still perfectly valid. 395 In such a case, the token maker MUST send the new token in a 396 protected message under that IKE SA. That exchange could be a simple 397 INFORMATIONAL, such as in the last figure in the previous section, or 398 else it can be part of a MOBIKE INFORMATIONAL exchange such as in the 399 following figure taken from section 2.2 of [RFC4555] and modified by 400 adding a QCD_TOKEN notification: 402 (IP_I2:4500 -> IP_R1:4500) 403 HDR, SK { N(UPDATE_SA_ADDRESSES), 404 N(NAT_DETECTION_SOURCE_IP), 405 N(NAT_DETECTION_DESTINATION_IP) } --> 407 <-- (IP_R1:4500 -> IP_I2:4500) 408 HDR, SK { N(NAT_DETECTION_SOURCE_IP), 409 N(NAT_DETECTION_DESTINATION_IP) } 411 <-- (IP_R1:4500 -> IP_I2:4500) 412 HDR, SK { N(COOKIE2), [N(QCD_TOKEN)] } 414 (IP_I2:4500 -> IP_R1:4500) 415 HDR, SK { N(COOKIE2), [N(QCD_TOKEN)] } --> 417 A token taker MUST accept such gratuitous QCD_TOKEN notifications as 418 long as they are carried in protected exchanges. A token maker 419 SHOULD NOT generate them unless it is no longer able to generate the 420 old QCD_TOKEN. 422 4.5. Presenting the Token in an Unprotected Message 424 This QCD_TOKEN notification is unprotected, and is sent as a response 425 to a protected IKE request, which uses an IKE SA that is unknown. 427 message --> N(INVALID_IKE_SPI), N(QCD_TOKEN)+ 429 If child SPIs are persistently mapped to IKE SPIs as described in 430 Section 8.2, a token taker may get the following unprotected message 431 in response to an ESP or AH packet. 433 message --> N(INVALID_SPI), N(QCD_TOKEN)+ 435 The QCD_TOKEN and INVALID_IKE_SPI notifications are sent together to 436 support both implementations that conform to this specification and 437 implementations that don't. Similar to the description in section 438 2.21 of [RFC5996], the IKE SPI and message ID fields in the packet 439 headers are taken from the protected IKE request. 441 To support a periodic rollover of the secret used for token 442 generation, the token taker MUST support at least four QCD_TOKEN 443 notifications in a single packet. The token is considered verified 444 if any of the QCD_TOKEN notifications matches. The token maker MAY 445 generate up to four QCD_TOKEN notifications, based on several 446 generations of keys. 448 If the QCD_TOKEN verifies OK, the receiver MUST silently discard the 449 IKE SA and all associated child SAs. If the QCD_TOKEN cannot be 450 validated, a response MUST NOT be sent, and the event may be logged. 451 Section 5 defines token verification. 453 5. Token Generation and Verification 455 No token generation method is mandated by this document. Two methods 456 are documented in the following sub-sections, but they only serve as 457 examples. 459 The following lists the requirements for a token generation 460 mechanism: 461 o Tokens MUST be at least 16 octets long, and no more than 128 462 octets long, to facilitate storage and transmission. Tokens 463 SHOULD be indistinguishable from random data. 464 o It should not be possible for an external attacker to guess the 465 QCD token generated by an implementation. Cryptographic 466 mechanisms such as PRNG and hash functions are RECOMMENDED. 467 o The token maker MUST be able to re-generate or retrieve the token 468 based on the IKE SPIs even after it reboots. 469 o The method of token generation MUST be such that a collision of 470 QCD tokens between different pairs of IKE SPI will be highly 471 unlikely. 473 5.1. A Stateless Method of Token Generation 475 This describes a stateless method of generating a token: 476 o At installation or immediately after the first boot of the token 477 maker, 32 random octets are generated using a secure random number 478 generator or a PRNG. 479 o Those 32 bytes, called the "QCD_SECRET", are stored in non- 480 volatile storage on the machine, and kept indefinitely. 481 o If key rollover is required by policy, the implementation MAY 482 periodically generate a new QCD_SECRET and keep up to 3 previous 483 generations. When sending an unprotected QCD_TOKEN, as many as 4 484 notification payloads may be sent, each from a different 485 QCD_SECRET. 486 o The TOKEN_SECRET_DATA is calculated as follows: 488 TOKEN_SECRET_DATA = HASH(QCD_SECRET | SPI-I | SPI-R) 490 5.2. A Stateless Method with IP addresses 492 This method is similar to the one in the previous section, except 493 that the IP address of the token taker is also added to the block 494 being hashed. This has the disadvantage that the token needs to be 495 replaced (as described in Section 4.4) whenever the token taker 496 changes its address. 498 See Section 9.2 for a discussion of a use-case for this method. When 499 using this method, the TOKEN_SECRET_DATA field is calculated as 500 follows: 502 TOKEN_SECRET_DATA = HASH(QCD_SECRET | SPI-I | SPI-R | IPaddr-T) 504 The IPaddr-T field specifies the IP address of the token taker. 505 Secret rollover considerations are similar to those in the previous 506 section. 508 5.3. Token Lifetime 510 The token is associated with a single IKE SA, and SHOULD be deleted 511 by the token taker when the SA is deleted or expires. More formally, 512 the token is associated with the pair (SPI-I, SPI-R). 514 6. Backup Gateways 516 Making crash detection and recovery quick is a worthy goal, but since 517 rebooting a gateway takes a non-zero amount of time, many 518 implementations choose to have a stand-by gateway ready to take over 519 as soon as the primary gateway fails for any reason. [cluster] 520 describes considerations for such clusters of gateways with 521 synchronized state, but the rest of this section is relevant even 522 when there is no synchronized state. 524 If such a configuration is available, it is RECOMMENDED that the 525 stand-by gateway be able to generate the same token as the active 526 gateway. if the method described in Section 5.1 is used, this means 527 that the QCD_SECRET field is identical in both gateways. This has 528 the effect of having the crash recovery available immediately. 530 Note that this refers to "high availability" configurations, where 531 only one gateway is active at any given moment. This is different 532 from "load sharing" configurations where more than one gateway is 533 active at the same time. For load sharing configurations, please see 534 Section 9.2 for security considerations. 536 7. Interaction with Session Resumption 538 Session resumption, specified in [RFC5723], allows the setting up of 539 a new IKE SA to consume less computing resources. This is 540 particularly useful in the case of a remote access gateway that has 541 many tunnels. A failure of such a gateway requires all these many 542 remote access clients to establish an IKE SA either with the rebooted 543 gateway or with a backup. This tunnel re-establishment occurs within 544 a short period of time, creating a burden on the remote access 545 gateway. Session resumption addresses this problem by having the 546 clients store an encrypted derivative of the IKE SA for quick re- 547 establishment. 549 What Session Resumption does not help is the problem of detecting 550 that the peer gateway has failed. A failed gateway may go undetected 551 for an arbitrarily long time, because IPsec does not have packet 552 acknowledgement, and applications cannot signal the IPsec layer that 553 the tunnel "does not work". Section 2.4 of RFC 5996 does not specify 554 how long an implementation needs to wait before beginning a liveness 555 check, and only says "not recently" (see full quote in Section 2). 556 In practice some mobile devices wait a very long time before 557 beginning liveness check, in order to extend battery life by allowing 558 parts of the device to remain in low-power modes. 560 QCD tokens provide a way to detect the failure of the peer in the 561 case where liveness check has not yet ended (or begun). 563 A remote access client conforming to both specifications will store 564 QCD tokens, as well as the Session Resumption ticket, if provided by 565 the gateway. A remote access gateway conforming to both 566 specifications will generate a QCD token for the client. When the 567 gateway reboots, the client will discover this in either of two ways: 568 1. The client does regular liveness checks, or else the time for 569 some other IKE exchange has come. Since the gateway is still 570 down, the IKE exchange times out after several minutes. In this 571 case QCD does not help. 573 2. Either the primary gateway or a backup gateway (see Section 6) is 574 ready and sends a QCD token to the client. In that case the 575 client will quickly re-establish the IPsec tunnel, either with 576 the rebooted primary gateway or the backup gateway as described 577 in this document. 579 The full combined protocol looks like this: 581 Initiator Responder 582 ----------- ----------- 583 HDR, SAi1, KEi, Ni --> 585 <-- HDR, SAr1, KEr, Nr, [CERTREQ] 587 HDR, SK {IDi, [CERT,] 588 [CERTREQ,] [IDr,] 589 AUTH, N(QCD_TOKEN) 590 SAi2, TSi, TSr, 591 N(TICKET_REQUEST)} --> 592 <-- HDR, SK {IDr, [CERT,] AUTH, 593 N(QCD_TOKEN), SAr2, TSi, TSr, 594 N(TICKET_LT_OPAQUE) } 596 ---- Reboot ----- 598 HDR, {} --> 599 <-- HDR, N(QCD_TOKEN) 601 HDR, [N(COOKIE),] 602 Ni, N(TICKET_OPAQUE) 603 [,N+] --> 604 <-- HDR, Nr [,N+] 606 8. Operational Considerations 608 8.1. Who should implement this specification 610 Throughout this document, we have referred to reboot time 611 alternatingly as the time that the implementation crashes and the 612 time when it is ready to process IPsec packets and IKE exchanges. 613 Depending on the hardware and software platforms and the cause of the 614 reboot, rebooting may take anywhere from a few seconds to several 615 minutes. If the implementation is down for a long time, the benefit 616 of this protocol extension is reduced. For this reason critical 617 systems should implement backup gateways as described in Section 6. 619 Implementing the "token maker" side of QCD makes sense for IKE 620 implementation where protected connections originate from the peer, 621 such as inter-domain VPNs and remote access gateways. Implementing 622 the "token taker" side of QCD makes sense for IKE implementations 623 where protected connections originate, such as inter-domain VPNs and 624 remote access clients. 626 To clarify the this discussion: 627 o For remote-access clients it makes sense to implement the token 628 taker role. 629 o For remote-access gateways it makes sense to implement the token 630 maker role. 631 o For inter-domain VPN gateways it makes sense to implement both 632 roles, because it can't be known in advance where the traffic 633 originates. 634 o It is perfectly valid to implement both roles in any case, for 635 example when using a single library or a single gateway to perform 636 several roles. 638 In order to limit the effects of DoS attacks, a token taker SHOULD 639 limit the rate of QCD_TOKENs verified from a particular source. 641 If excessive amounts of IKE requests protected with unknown IKE SPIs 642 arrive at a token maker, the IKE module SHOULD revert to the behavior 643 described in section 2.21 of [RFC5996] and either send an 644 INVALID_IKE_SPI notification, or ignore it entirely. 646 8.2. Response to unknown child SPI 648 After a reboot, it is more likely that an implementation receives 649 IPsec packets than IKE packets. In that case, the rebooted 650 implementation will send an INVALID_SPI notification, triggering a 651 liveness check. The token will only be sent in a response to the 652 liveness check, thus requiring an extra round-trip. 654 To avoid this, an implementation that has access to enough non- 655 volatile storage MAY store a mapping of child SPIs to owning IKE 656 SPIs, or to generated tokens. If such a mapping is available and 657 persistent across reboots, the rebooted implementation SHOULD respond 658 to the IPsec packet with an INVALID_SPI notification, along with the 659 appropriate QCD_Token notifications. A token taker SHOULD verify the 660 QCD token that arrives with an INVALID_SPI notification the same as 661 if it arrived with the IKE SPIs of the parent IKE SA. 663 However, a persistent storage module might not be updated in a timely 664 manner, and could be populated with tokens relating to IKE SPIs that 665 have already been rekeyed. A token taker MUST NOT take an invalid 666 QCD Token sent along with an INVALID_SPI notification as evidence 667 that the peer is either malfunctioning or attacking, but it SHOULD 668 limit the rate at which such notifications are processed. 670 9. Security Considerations 672 The extension described in this document must not reduce the security 673 of IKEv2 or IPsec. Specifically, an eavesdropper must not learn any 674 non-public information about the peers. 676 The proposed mechanism should be secure against attacks by a passive 677 MITM (eavesdropper). Such an attacker must not be able to disrupt an 678 existing IKE session, either by resetting the session or by 679 introducing significant delays. This requirement is especially 680 significant, because this document introduces a new way to reset an 681 IKE SA. 683 The mechanism need not be similarly secure against an active MITM, 684 since this type of attacker is already able to disrupt IKE sessions. 686 9.1. QCD Token Generation and Handling 688 Tokens MUST be hard to guess. This is critical, because if an 689 attacker can guess the token associated with an IKE SA, she can tear 690 down the IKE SA and associated tunnels at will. When the token is 691 delivered in the IKE_AUTH exchange, it is encrypted. When it is sent 692 again in an unprotected notification, it is not, but that is the last 693 time this token is ever used. 695 An aggregation of some tokens generated by one maker together with 696 the related IKE SPIs MUST NOT give an attacker the ability to guess 697 other tokens. Specifically, if one taker does not properly secure 698 the QCD tokens and an attacker gains access to them, this attacker 699 MUST NOT be able to guess other tokens generated by the same maker. 700 This is the reason that the QCD_SECRET in Section 5.1 needs to be 701 sufficiently long. 703 The token taker MUST store the token in a secure manner. No attacker 704 should be able to gain access to a stored token. 706 The QCD_SECRET MUST be protected from access by other parties. 707 Anyone gaining access to this value will be able to delete all the 708 IKE SAs for this token maker. 710 The QCD token is sent by the rebooted peer in an unprotected message. 711 A message like that is subject to modification, deletion and replay 712 by an attacker. However, these attacks will not compromise the 713 security of either side. Modification is meaningless because a 714 modified token is simply an invalid token. Deletion will only cause 715 the protocol not to work, resulting in a delay in tunnel re- 716 establishment as described in Section 2. Replay is also meaningless, 717 because the IKE SA has been deleted after the first transmission. 719 9.2. QCD Token Transmission 721 A token maker MUST NOT send a valid QCD token in an 722 unprotectedmessage for an existing IKE SA. 724 This requirement is obvious and easy in the case of a single gateway. 725 However, some implementations use a load balancer to divide the load 726 between several physical gateways. It MUST NOT be possible even in 727 such a configuration to trick one gateway into sending a valid QCD 728 token for an IKE SA which is valid on another gateway. This is true 729 whether the attempt to trick the gateway uses the token taker's IP 730 address or a different IP address. 732 Because it includes the token taker's IP address in the token 733 generation, the method in Section 5.2 prevents revealing the QCD 734 token for an existing pair of IKE SPIs to an attacker who is using a 735 different IP address. Note that the use of this method causes the 736 tokens to be invalidated whenever the token taker's address changes. 737 It is also important to note that this method does not prevent 738 revealing the QCD token to a man-in-the-middle attacker who is 739 spoofing the token taker's IP address, if that attacker is able to 740 direct messages to a cluster member other than the member responsible 741 for the IKE SA. 743 This document does not specify how a load-sharing configuration of 744 IPsec gateways would work, but in order to support this 745 specification, all members MUST be able to tell whether a particular 746 IKE SA is active anywhere in the cluster. One way to do it is to 747 synchronize a list of active IKE SPIs among all the cluster members. 749 If an attacker can somehow access a QCD token while the SA's are 750 still active, this attacker will be able to tear down the sessions at 751 will. In particular, avoiding false positives is critical to the 752 security of the proposal and a token maker MUST NOT send a QCD token 753 in an unprotected message for an existing IKE SA. IPsec Failure 754 Detection is thus not applicable to deployments where the QCD token 755 is shared by multiple gateways and the gateways can not assess 756 whether the token can be legitimately sent in the clear while another 757 gateway may actually still own the SA's. Load balancer designs 758 typically fall in this category. 760 9.3. QCD Token Enumeration 762 An attacker may try to attack QCD if the generation algorithm 763 described in Section 5.1 is used. The attacker will send several 764 fake IKE requests to the gateway under attack, receiving and 765 recording the QCD Tokens in the responses. This will allow the 766 attacker to create a dictionary of IKE SPIs to QCD Tokens, which can 767 later be used to tear down any IKE SA. 769 Three factors mitigate this threat: 770 o The space of all possible IKE SPI pairs is huge: 2^128, so making 771 such a dictionary is impractical. Even if we assume that one 772 implementation always generates predictable IKE SPIs, the space is 773 still at least 2^64 entries, so making the dictionary is extremely 774 hard. To ensure this, token makers MUST generate unpredictable 775 IKE SPIs by using a cryptographically strong pseudo-random number 776 generator. 777 o Throttling the amount of QCD_TOKEN notifications sent out, as 778 discussed in Section 8.1, especially when not soon after a crash 779 will limit the attacker's ability to construct a dictionary. 780 o The methods in Section 5.1 and Section 5.2 allow for a periodic 781 change of the QCD_SECRET. Any such change invalidates the entire 782 dictionary. 784 10. IANA Considerations 786 IANA is requested to assign a notify message type from the status 787 types range (16406-40959) of the "IKEv2 Notify Message Types" 788 registry with name "QUICK_CRASH_DETECTION". 790 11. Acknowledgements 792 We would like to thank Hannes Tschofenig and Yaron Sheffer for their 793 comments about Session Resumption. 795 Others who have contributed valuable comments are, in alphabetical 796 order, Lakshminath Dondeti, Paul Hoffman, Tero Kivinen, Scott C 797 Moonen, and Keith Welter. 799 12. Change Log 801 This section lists all changes in this document 803 NOTE TO RFC EDITOR : Please remove this section in the final RFC 805 12.1. Changes from draft-ietf-ipsecme-failure-detection-03 807 o Merged section 9.4 into section 9.2. 808 o Multiple typos discovered by Scott Moonen, Keith Welter and Yaron. 810 12.2. Changes from draft-ietf-ipsecme-failure-detection-02 812 o Moved section 7 to Appendix A. Also changed some wording. 813 o Fixed some language in the "interaction with session resumption" 814 section to say that although liveness check MUST be done, there 815 are no time limits to how long an implementation takes before 816 starting liveness check, or ending it. 818 12.3. Changes from draft-ietf-ipsecme-failure-detection-01 820 o Fixed the language requiring random IKE SPIs. 821 o Some better explanation of the reasons to choose the methods in 822 Section 5.2 and the method in Section 5.1, to close issue #193. 823 o Added text to the beginning of Section 9 to accomodate issue #194. 825 12.4. Changes from draft-ietf-ipsecme-failure-detection-00 827 o Nits pointed out by Scott and Yaron. 828 o Pratima and Frederic are back on board. 829 o Changed IKEv2bis draft reference to RFC 5996. 830 o Resolved issues #189, #190, #191, and #192: 831 * Renamed section 4.5 and removed the requirement to send an 832 acknowledgement for the unprotected message. 833 * Moved the QCD token from the last to the first IKE_AUTH 834 request. 835 * Added a MUST to Section 9.3 to require that IKE SPIs be 836 randomly generated. 837 * Changed the language in Section 8.1, to not use RFC 2119 838 terminology. 839 * Moved the section describing why one would want the method 840 dependant on IP addresses (in Section 5.2 from operational 841 considerations to security considerations. 843 12.5. Changes from draft-nir-ike-qcd-07 845 o First WG version. 846 o Addressed Scott C Moonen's concern about collisions of QCD tokens. 847 o Updated references to point to IKEv2bis instead of RFC 4306 and 848 4718. Also converted draft reference for resumption to RFC 5723. 849 o Added Dave Wiebrowski as author, and removed Pratima and Frederic. 851 12.6. Changes from draft-nir-ike-qcd-03 and -04 853 Mostly editorial changes and cleaning up. 855 12.7. Changes from draft-nir-ike-qcd-02 857 o Described QCD token enumeration, following a question by 858 Lakshminath Dondeti. 859 o Added the ability to replace the QCD token for an existing IKE SA. 860 o Added tokens dependent on peer IP address and their interaction 861 with MOBIKE. 863 12.8. Changes from draft-nir-ike-qcd-01 865 o Removed stateless method. 866 o Added discussion of rekeying and resumption. 867 o Added discussion of non-synchronized load-balanced clusters of 868 gateways in the security considerations. 869 o Other wording fixes. 871 12.9. Changes from draft-nir-ike-qcd-00 873 o Merged proposal with draft-detienne-ikev2-recovery 874 o Changed the protocol so that the rebooted peer generates the 875 token. This has the effect, that the need for persistent storage 876 is eliminated. 877 o Added discussion of birth certificates. 879 12.10. Changes from draft-nir-qcr-00 881 o Changed name to reflect that this relates to IKE. Also changed 882 from quick crash recovery to quick crash detection to avoid 883 confusion with IFARE. 884 o Added more operational considerations. 885 o Added interaction with IFARE. 886 o Added discussion of backup gateways. 888 13. References 890 13.1. Normative References 892 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 893 Requirement Levels", BCP 14, RFC 2119, March 1997. 895 [RFC4555] Eronen, P., "IKEv2 Mobility and Multihoming Protocol 896 (MOBIKE)", RFC 4555, June 2006. 898 [RFC5996] Kaufman, C., Hoffman, P., Nir, Y., and P. Eronen, 899 "Internet Key Exchange Protocol: IKEv2", RFC 5996, 900 September 2010. 902 13.2. Informative References 904 [RFC5723] Sheffer, Y. and H. Tschofenig, "IKEv2 Session Resumption", 905 RFC 5723, January 2010. 907 [cluster] Nir, Y., Ed., "IPsec Cluster Problem Statement", 908 draft-ietf-ipsecme-ipsec-ha (work in progress), July 2010. 910 [recovery] 911 Detienne, F., Sethi, P., and Y. Nir, "Safe IKE Recovery", 912 draft-detienne-ikev2-recovery (work in progress), 913 January 2010. 915 Appendix A. The Path Not Taken 917 A.1. Initiating a new IKE SA 919 Instead of sending a QCD token, we could have the rebooted 920 implementation start an Initial exchange with the peer, including the 921 INITIAL_CONTACT notification. This would have the same effect, 922 instructing the peer to erase the old IKE SA, as well as establishing 923 a new IKE SA with fewer rounds. 925 The disadvantage here, is that in IKEv2 an authentication exchange 926 MUST have a piggy-backed Child SA set up. Since our use case is such 927 that the rebooted implementation does not have traffic flowing to the 928 peer, there are no good selectors for such a Child SA. 930 Additionally, when authentication is asymmetric, such as when EAP is 931 used, it is not possible for the rebooted implementation to initiate 932 IKE. 934 A.2. SIR 936 Another proposal that was considered for this work item is the SIR 937 extension, which is described in [recovery]. Under that proposal, 938 the non-rebooted peer sends a non-protected query to the possibly 939 rebooted peer, asking whether the IKE SA exists. The peer replies 940 with either a positive or negative response, and the absence of a 941 positive response, along with the existence of a negative response is 942 taken as proof that the IKE SA has really been lost. 944 The working group preferred the QCD proposal to this one. 946 A.3. Birth Certificates 948 Birth Certificates is a method of crash detection that has never been 949 formally defined. Bill Sommerfeld suggested this idea in a mail to 950 the IPsec mailing list on August 7, 2000, in a thread discussing 951 methods of crash detection: 953 If we have the system sign a "birth certificate" when it 954 reboots (including a reboot time or boot sequence number), 955 we could include that with a "bad spi" ICMP error and in 956 the negotiation of the IKE SA. 958 We believe that this method would have some problems. First, it 959 requires Alice to store the certificate, so as to be able to compare 960 the public keys. That requires more storage than does a QCD token. 961 Additionally, the public-key operations needed to verify the self- 962 signed certificates are more expensive for Alice. 964 We believe that a symmetric-key operation such as proposed here is 965 more light-weight and simple than that implied by the Birth 966 Certificate idea. 968 A.4. Reducing Liveness Check Length 970 Some implementations require fewer retransmissions over a shorter 971 period of time for cases of liveness check started because of an 972 INVALID_SPI or INVALID_IKE_SPI notification. 974 We believe that the default retransmission policy should represent a 975 good balance between the need for a timely discovery of a dead peer, 976 and a low probability of false detection. We expect the policy to be 977 set to take the shortest time such that this probability achieves a 978 certain target. Therefore, we believe that reducing the elapsed time 979 and retransmission count may create an unacceptably high probability 980 of false detection, and this can be triggered by a single 981 INVALID_IKE_SPI notification. 983 Additionally, even if the retransmission policy is reduced to, say, 984 one minute, it is still a very noticeable delay from a human 985 perspective, from the time that the gateway has come up (i.e., is 986 able to respond with an INVALID_SPI or INVALID_IKE_SPI notification) 987 and until the tunnels are active, or from the time the backup gateway 988 has taken over until the tunnels are active. The use of QCD tokens 989 can reduce this delay. 991 Authors' Addresses 993 Yoav Nir (editor) 994 Check Point Software Technologies Ltd. 995 5 Hasolelim st. 996 Tel Aviv 67897 997 Israel 999 Email: ynir@checkpoint.com 1001 David Wierbowski 1002 International Business Machines 1003 1701 North Street 1004 Endicott, New York 13760 1005 United States 1007 Email: wierbows@us.ibm.com 1009 Frederic Detienne 1010 Cisco Systems, Inc. 1011 De Kleetlaan, 7 1012 Diegem B-1831 1013 Belgium 1015 Phone: +32 2 704 5681 1016 Email: fd@cisco.com 1018 Pratima Sethi 1019 Cisco Systems, Inc. 1020 O'Shaugnessy Road, 11 1021 Bangalore, Karnataka 560027 1022 India 1024 Phone: +91 80 4154 1654 1025 Email: psethi@cisco.com