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