idnits 2.17.1 draft-ietf-dnsop-server-cookies-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 : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** The abstract seems to contain references ([RFC7873]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (19 November 2020) is 1248 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) -- Obsolete informational reference (is this intentional?): RFC 4941 (Obsoleted by RFC 8981) Summary: 2 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 DNSOP Working Group O. Sury 3 Internet-Draft Internet Systems Consortium 4 Updates: 7873 (if approved) W. Toorop 5 Intended status: Standards Track NLnet Labs 6 Expires: 23 May 2021 D. Eastlake 3rd 7 Futurewei Technologies 8 M. Andrews 9 Internet Systems Consortium 10 19 November 2020 12 Interoperable Domain Name System (DNS) Server Cookies 13 draft-ietf-dnsop-server-cookies-04 15 Abstract 17 DNS Cookies, as specified in [RFC7873], are a lightweight DNS 18 transaction security mechanism that provide limited protection to DNS 19 servers and clients against a variety of denial-of-service and 20 amplification, forgery, or cache poisoning attacks by off-path 21 attackers. 23 This document provides precise directions for creating Server Cookies 24 so that an anycast server set including diverse implementations will 25 interoperate with standard clients. 27 This document updates [RFC7873] with 29 * suggestions for constructing Client Cookies in a privacy 30 preserving fashion, 32 * precise instructions for constructing Server Cookies deprecating 33 the methods described in [RFC7873], and 35 * suggestions on how to update a server secret. 37 An IANA registry listing the methods and associated pseudo random 38 function suitable for creating DNS Server cookies is created, with 39 the method described in this document as the first and as of yet only 40 entry. 42 Status of This Memo 44 This Internet-Draft is submitted in full conformance with the 45 provisions of BCP 78 and BCP 79. 47 Internet-Drafts are working documents of the Internet Engineering 48 Task Force (IETF). Note that other groups may also distribute 49 working documents as Internet-Drafts. The list of current Internet- 50 Drafts is at https://datatracker.ietf.org/drafts/current/. 52 Internet-Drafts are draft documents valid for a maximum of six months 53 and may be updated, replaced, or obsoleted by other documents at any 54 time. It is inappropriate to use Internet-Drafts as reference 55 material or to cite them other than as "work in progress." 57 This Internet-Draft will expire on 23 May 2021. 59 Copyright Notice 61 Copyright (c) 2020 IETF Trust and the persons identified as the 62 document authors. All rights reserved. 64 This document is subject to BCP 78 and the IETF Trust's Legal 65 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 66 license-info) in effect on the date of publication of this document. 67 Please review these documents carefully, as they describe your rights 68 and restrictions with respect to this document. Code Components 69 extracted from this document must include Simplified BSD License text 70 as described in Section 4.e of the Trust Legal Provisions and are 71 provided without warranty as described in the Simplified BSD License. 73 Table of Contents 75 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 76 1.1. Contents of this document . . . . . . . . . . . . . . . . 3 77 1.2. Terminology and Definitions . . . . . . . . . . . . . . . 4 78 2. Changes to [RFC7873] . . . . . . . . . . . . . . . . . . . . 4 79 3. Constructing a Client Cookie . . . . . . . . . . . . . . . . 4 80 4. Constructing a Server Cookie . . . . . . . . . . . . . . . . 5 81 4.1. The Version Sub-Field . . . . . . . . . . . . . . . . . . 6 82 4.2. The Reserved Sub-Field . . . . . . . . . . . . . . . . . 6 83 4.3. The Timestamp Sub-Field . . . . . . . . . . . . . . . . . 6 84 4.4. The Hash Sub-Field . . . . . . . . . . . . . . . . . . . 7 85 5. Updating the Server Secret . . . . . . . . . . . . . . . . . 7 86 6. Cookie Algorithms . . . . . . . . . . . . . . . . . . . . . . 8 87 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 88 8. Security and Privacy Considerations . . . . . . . . . . . . . 9 89 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 10 90 10. Normative References . . . . . . . . . . . . . . . . . . . . 10 91 11. Informative References . . . . . . . . . . . . . . . . . . . 11 92 Appendix A. Test vectors . . . . . . . . . . . . . . . . . . . . 11 93 A.1. Learning a new Server Cookie . . . . . . . . . . . . . . 11 94 A.2. The same client learning a renewed (fresh) Server 95 Cookie . . . . . . . . . . . . . . . . . . . . . . . . . 12 96 A.3. Another client learning a renewed Server Cookie . . . . . 13 97 A.4. IPv6 query with rolled over secret . . . . . . . . . . . 14 98 Appendix B. Implementation status . . . . . . . . . . . . . . . 15 99 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15 101 1. Introduction 103 DNS Cookies, as specified in [RFC7873], are a lightweight DNS 104 transaction security mechanism that provide limited protection to DNS 105 servers and clients against a variety of denial-of-service and 106 amplification, forgery, or cache poisoning attacks by off-path 107 attackers. This document specifies a means of producing 108 interoperable strong cookies so that an anycast server set including 109 diverse implementations can be easily configured to interoperate with 110 standard clients. 112 The threats considered for DNS Cookies and the properties of the DNS 113 Security features other than DNS Cookies are discussed in [RFC7873]. 115 In [RFC7873] in Section 6 it is "RECOMMENDED for simplicity that the 116 same Server Secret be used by each DNS server in a set of anycast 117 servers." However, how precisely a Server Cookie is calculated from 118 this Server Secret, is left to the implementation. 120 This guidance has led to a gallimaufry of DNS Cookie implementations, 121 calculating the Server Cookie in different ways. As a result, DNS 122 Cookies are impractical to deploy on multi-vendor anycast networks, 123 because even when all DNS Software share the same secret, as 124 RECOMMENDED in Section 6 of [RFC7873], the Server Cookie constructed 125 by one implementation cannot generally be validated by another. 127 There is no need for DNS client (resolver) Cookies to be 128 interoperable across different implementations. Each client need 129 only be able to recognize its own cookies. However, this document 130 does contain recommendations for constructing Client Cookies in a 131 Client protecting fashion. 133 1.1. Contents of this document 135 Section 2 summarises the changes to [RFC7873]. 137 In Section 3 suggestions for constructing a Client Cookie are given. 139 In Section 4 instructions for constructing a Server Cookie are given. 141 In Section 5 instructions on updating Server Secrets are given. 143 In Section 6 the different hash functions usable for DNS Cookie 144 construction are listed. [FNV] and HMAC-SHA-256-64 [RFC6234] are 145 deprecated and [SipHash-2.4] is introduced as a REQUIRED hash 146 function for server side DNS Cookie implementations. 148 IANA considerations are in Section 7. 150 Privacy and Security Considerations in Section 8. 152 Acknowledgements are in Section 9. 154 Test vectors are in Appendix A. 156 1.2. Terminology and Definitions 158 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 159 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 160 "OPTIONAL" in this document are to be interpreted as described in BCP 161 14 [RFC2119] [RFC8174] when, and only when, they appear in all 162 capitals, as shown here. 164 * "IP Address" is used herein as a length independent term covering 165 both IPv4 and IPv6 addresses. 167 2. Changes to [RFC7873] 169 In its Appendices A.1 and B.1, [RFC7873] provides example "simple" 170 algorithms for computing Client and Server Cookies, respectively. 171 These algorithms MUST NOT be used as the resulting cookies are too 172 weak when evaluated against modern security standards. 174 In its Appendix B.2, [RFC7873] provides an example "more complex" 175 server algorithm. This algorithm is replaced by the interoperable 176 specification in Section 4 of this document, which MUST be used by 177 Server Cookie implementations. 179 This document has suggestions on Client Cookie construction in 180 Section 3. The previous example in Appendix A.2 of [RFC7873] is NOT 181 RECOMMENDED. 183 3. Constructing a Client Cookie 185 The Client Cookie is a cryptographic nonce and should be treated as 186 such. It is RECOMMENDED to create a new Client Cookie for each new 187 upstream server a Client connects to. The Client Cookie SHOULD have 188 64-bits of entropy. 190 When a Server does not support DNS Cookies, the Client MUST NOT send 191 the same Client Cookie to that same Server again. Instead, it is 192 recommended that the Client does not send a Client Cookie to that 193 Server for a certain period, for example five minutes, before it 194 retries with a new Client Cookie. 196 When a Server does support DNS Cookies, the Client should store the 197 Client Cookie alongside the Server Cookie it registered for that 198 Server. 200 Except for when the Client IP address changes, there is no need to 201 change the Client Cookie often. It is reasonable to change the 202 Client Cookie then only if it has been compromised or after a 203 relatively long period of time such as no longer than a year. Client 204 Cookies are not expected to survive a program restart. 206 Client-Cookie = 64 bits of entropy 208 Previously, the recommended algorithm to compute the Client Cookie 209 included Client IP Address as an input to a hashing function. 210 However, when implementing the DNS Cookies, several DNS vendors found 211 impractical to include the Client IP as the Client Cookie is 212 typically computed before the Client IP address is known. Therefore, 213 the requirement to put Client IP address as input was removed. 215 However, for privacy reasons, in order to prevent tracking of devices 216 across links and to not circumvent IPv6 Privacy Extensions [RFC4941], 217 Clients MUST NOT re-use a Client or Server Cookie after the Client IP 218 address has changed. 220 One way to track Client IP addresses, is to register the Client IP 221 address alongside the Server Cookie when it receives the Server 222 Cookie. In subsequent queries to the Server with that Server Cookie, 223 the socket MAY be bound to the Client IP address that was also used 224 (and registered) when it received the Server Cookie. Failure to bind 225 MUST then result in a new Client Cookie. 227 4. Constructing a Server Cookie 229 The Server Cookie is effectively a Message Authentication Code (MAC) 230 and should be treated as such. The Server Cookie is calculated from 231 the Client Cookie, a series of Sub-Fields specified below, the Client 232 IP address, and a Server Secret known only to the servers responding 233 on the same address in an anycast set. 235 Changing the Server Secret regularly is RECOMMENDED but, when a 236 secure pseudorandom function is used, it need not be changed too 237 frequently. For example once a month would be adequate. See 238 Section 5 on operator and implementation guidelines for updating a 239 Server Secret. 241 The 128-bit Server Cookie consists of Sub-Fields: a 1 octet Version 242 Sub-Field, a 3 octet Reserved Sub-Field, a 4 octet Timestamp Sub- 243 Field and an 8 octet Hash Sub-Field. 245 0 1 2 3 246 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 247 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 248 | Version | Reserved | 249 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 250 | Timestamp | 251 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 252 | Hash | 253 | | 254 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 256 4.1. The Version Sub-Field 258 The Version Sub-Field prescribes the structure and Hash calculation 259 formula. This document defines Version 1 to be the structure and way 260 to calculate the Hash Sub-Field as defined in this Section. 262 4.2. The Reserved Sub-Field 264 The value of the Reserved Sub-Field is reserved for future versions 265 of Server Side Cookie construction. On construction it SHOULD be set 266 to zero octets. On Server Cookie verification the server MUST NOT 267 enforce those fields to be zero and the Hash should be computed with 268 the received value as described in Section 4.4. 270 4.3. The Timestamp Sub-Field 272 The Timestamp value prevents Replay Attacks and MUST be checked by 273 the server to be within a defined period of time. The DNS Server 274 SHOULD allow Cookies within 1 hour period in the past and 5 minutes 275 into the future to allow operation of low volume clients and some 276 limited time skew between the DNS servers in the anycast set. 278 The Timestamp value specifies a date and time in the form of a 32-bit 279 unsigned number of seconds elapsed since 1 January 1970 00:00:00 UTC, 280 ignoring leap seconds, in network byte order. All comparisons 281 involving these fields MUST use "Serial number arithmetic", as 282 defined in [RFC1982] 283 The DNS Server SHOULD generate a new Server Cookie at least if the 284 received Server Cookie from the Client is more than half an hour old. 286 4.4. The Hash Sub-Field 288 It's important that all the DNS servers use the same algorithm for 289 computing the Server Cookie. This document defines the Version 1 of 290 the Server Side algorithm to be: 292 Hash = SipHash2.4( 293 Client Cookie | Version | Reserved | Timestamp | Client-IP, 294 Server Secret ) 296 where "|" indicates concatenation. 298 Notice that Client-IP is used for hash generation even though it's 299 not included in the cookie value itself. Client-IP can be either 4 300 bytes for IPv4 or 16 bytes for IPv6. 302 The Server Secret MUST be configurable to make sure that servers in 303 an anycast network return consistent results. 305 5. Updating the Server Secret 307 All servers in an anycast set must be able to verify the Server 308 Cookies constructed by all other servers in that anycast set at all 309 times. Therefore it is vital that the Server Secret is shared among 310 all servers before it is used to generate Server Cookies. 312 Also, to maximize maintaining established relationships between 313 clients and servers, an old Server Secret should be valid for 314 verification purposes for a specific period. 316 To facilitate this, deployment of a new Server Secret MUST be done in 317 three stages: 319 Stage 1 The new Server Secret is deployed on all the servers in an 320 anycast set by the operator. 322 | Each server learns the new Server Secret, but keeps using the 323 | previous Server Secret to generate Server Cookies. 324 | 325 | Server Cookies constructed with the both the new Server Secret and 326 | with the previous Server Secret are considered valid when 327 | verifying. 328 | 329 | After stage 1 completed, all the servers in the anycast set have 330 | learned the new Server Secret, and can verify Server Cookies 331 | constructed with it, but keep generating Server Cookies with the 332 | old Server Secret. 334 Stage 2 This stage is initiated by the operator after the Server 335 Cookie is present on all members in the anycast set. 337 | When entering Stage 2, servers start generating Server Cookies 338 | with the new Server Secret. The previous Server Secret is not yet 339 | removed/forgotten about. 340 | 341 | Server Cookies constructed with the both the new Server Secret and 342 | with the previous Server Secret are considered valid when 343 | verifying. 345 Stage 3 This stage is initiated by the operator when it can be 346 assumed that most clients have learned the new Server Secret. 348 | With this stage, the previous Server Secret can be removed and 349 | MUST NOT be used anymore for verifying. 350 | 351 | We RECOMMEND the operator to wait at least a period to be the 352 | longest TTL in the zones served by the server plus half an hour 353 | after it initiated Stage 2, before initiating Stage 3. 354 | 355 | The operator SHOULD wait at least longer than the period clients 356 | are allowed to use the same Server Cookie, which SHOULD be half an 357 | hour, see Section 4.3. 359 6. Cookie Algorithms 361 [SipHash-2.4] is a pseudorandom function suitable as Message 362 Authentication Code. This document REQUIRES compliant DNS Server to 363 use SipHash-2.4 as a mandatory and default algorithm for DNS Cookies 364 to ensure interoperability between the DNS Implementations. 366 The construction method and pseudorandom function used in calculating 367 and verifying the Server Cookies are determined by the initial 368 version byte and by the length of the Server Cookie. Additional 369 pseudorandom or construction algorithms for Server Cookies might be 370 added in the future. 372 7. IANA Considerations 374 IANA is requested to create a registry on the "Domain Name System 375 (DNS) Parameters" IANA web page as follows: 377 Registry Name: DNS Server Cookie Methods\ Assignment Policy: Expert 378 Review\ Reference: [this document], [RFC7873]\ Note: Server Cookie 379 method (construction and pseudorandom algorithm) are determined by 380 the Version in the first byte of the Cookie and by the Cookie size. 381 Server Cookie size is limited to the inclusive range of 8 to 32 382 bytes. 384 +=========+=======+=======================================+ 385 | Version | Size | Method | 386 +=========+=======+=======================================+ 387 | 0 | 8-32 | reserved | 388 +---------+-------+---------------------------------------+ 389 | 1 | 8-15 | unassigned | 390 +---------+-------+---------------------------------------+ 391 | 1 | 16 | SipHash-2.4 [this document] Section 4 | 392 +---------+-------+---------------------------------------+ 393 | 1 | 17-32 | unassigned | 394 +---------+-------+---------------------------------------+ 395 | 2-239 | 8-32 | unassigned | 396 +---------+-------+---------------------------------------+ 397 | 240-254 | 8-32 | private use | 398 +---------+-------+---------------------------------------+ 399 | 255 | 8-32 | reserved | 400 +---------+-------+---------------------------------------+ 402 Table 1 404 8. Security and Privacy Considerations 406 DNS Cookies provide limited protection to DNS servers and clients 407 against a variety of denial-of-service and amplification/forgery or 408 cache poisoning attacks by off-path attackers. They provide no 409 protection against on-path adversaries that can observe the plaintext 410 DNS traffic. An on-path adversary that can observe a Server Cookie 411 for a client and server interaction, can use that Server Cookie for 412 amplification and denial-of-service forgery attacks for the lifetime 413 of the Server Cookie. 415 In [RFC7873] it was RECOMMENDED to construct a Client Cookie by using 416 a pseudorandom function of the Client IP Address, the Server IP 417 Address, and a secret quantity known only to the client. The Client 418 IP Address was included to ensure that a client could not be tracked 419 if its IP Address changes due to privacy mechanisms or otherwise. 421 In this document, we changed Client Cookie construction to be just 64 422 bits of entropy newly created for each new upstream server the client 423 connects to. As a consequence additional care needs to be taken to 424 prevent tracking of clients. To prevent tracking, a new Client 425 Cookie for a server MUST be created whenever the Client IP Address 426 changes. 428 Unfortunately, tracking Client IP Address Changes is impractical with 429 servers that do not support DNS Cookies. To prevent tracking of 430 clients with non DNS Cookie supporting servers, a client MUST NOT 431 send a previously sent Client Cookie. To prevent the creation of a 432 new Client Cookie for each query to an non DNS Cookies supporting 433 server, it is RECOMMENDED to not send a Client Cookie to that server 434 for a certain period, for example five minute. 436 Summarizing: 438 * In order to provide minimal authentication, a client MUST use a 439 different Client Cookie for each different Server IP Address. 441 * To prevent tracking of clients, a new Client Cookie MUST be 442 created when the Client IP Address changes. 444 * To prevent tracking of clients for a non DNS Cookie supporting 445 server, a client MUST NOT send a previously sent Client Cookie to 446 that server, unless it can track Client IP Address changes for 447 those servers too. 449 Besides the Client Cookie construction, this update on [RFC7873] does 450 not introduce any new characteristics to DNS Cookies operations and 451 the Security Considerations section of [RFC7873] still applies. 453 9. Acknowledgements 455 Thanks to Witold Krecicki and Pieter Lexis for valuable input, 456 suggestions and text and above all for implementing a prototype of an 457 interoperable DNS Cookie in Bind9, Knot and PowerDNS during the 458 hackathon of IETF104 in Prague. Thanks for valuable input and 459 suggestions go to Ralph Dolmans, Bob Harold, Daniel Salzman, Martin 460 Hoffmann, Mukund Sivaraman, Petr Spacek, Loganaden Velvindron, Bob 461 Harold, Philip Homburg, Tim Wicinski and Brian Dickson. 463 10. Normative References 465 [RFC1982] Elz, R. and R. Bush, "Serial Number Arithmetic", RFC 1982, 466 DOI 10.17487/RFC1982, August 1996, 467 . 469 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 470 Requirement Levels", BCP 14, RFC 2119, 471 DOI 10.17487/RFC2119, March 1997, 472 . 474 [RFC7873] Eastlake 3rd, D. and M. Andrews, "Domain Name System (DNS) 475 Cookies", RFC 7873, DOI 10.17487/RFC7873, May 2016, 476 . 478 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 479 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 480 May 2017, . 482 [SipHash-2.4] 483 Aumasson, J. and D. J. Bernstein, "SipHash: a fast short- 484 input PRF", 2012, . 486 11. Informative References 488 [FNV] Fowler, G., Noll, L., Vo, K., Eastlake, D., and T. Hansen, 489 "The FNV Non-Cryptographic Hash Algorithm", 490 . 492 [RFC4941] Narten, T., Draves, R., and S. Krishnan, "Privacy 493 Extensions for Stateless Address Autoconfiguration in 494 IPv6", RFC 4941, DOI 10.17487/RFC4941, September 2007, 495 . 497 [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms 498 (SHA and SHA-based HMAC and HKDF)", RFC 6234, 499 DOI 10.17487/RFC6234, May 2011, 500 . 502 Appendix A. Test vectors 504 A.1. Learning a new Server Cookie 506 A resolver (client) sending from IPv4 address 198.51.100.100, sends a 507 query for "example.com" to an authoritative server listening on 508 192.0.2.53 from which it has not yet learned the server cookie. 510 The DNS requests and replies shown in this Appendix, are in a "dig" 511 like format. The content of the DNS COOKIE Option is shown in 512 hexadecimal format after "; COOKIE:". 514 ;; Sending: 515 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57406 516 ;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 518 ;; OPT PSEUDOSECTION: 519 ; EDNS: version: 0, flags:; udp: 4096 520 ; COOKIE: 2464c4abcf10c957 521 ;; QUESTION SECTION: 522 ;example.com. IN A 524 ;; QUERY SIZE: 52 526 The authoritative nameserver (server) is configured with the 527 following secret: e5e973e5a6b2a43f48e7dc849e37bfcf (as hex data). 529 It receives the query at Wed Jun 5 10:53:05 UTC 2019. 531 The content of the DNS COOKIE Option that the server will return is 532 shown below in hexadecimal format after "; COOKIE:" 534 ;; Got answer: 535 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57406 536 ;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 538 ;; OPT PSEUDOSECTION: 539 ; EDNS: version: 0, flags:; udp: 4096 540 ; COOKIE: 2464c4abcf10c957010000005cf79f111f8130c3eee29480 (good) 541 ;; QUESTION SECTION: 542 ;example.com. IN A 544 ;; ANSWER SECTION: 545 example.com. 86400 IN A 192.0.2.34 547 ;; Query time: 6 msec 548 ;; SERVER: 192.0.2.53#53(192.0.2.53) 549 ;; WHEN: Wed Jun 5 10:53:05 UTC 2019 550 ;; MSD SIZE rcvd: 84 552 A.2. The same client learning a renewed (fresh) Server Cookie 554 40 minutes later, the same resolver (client) queries the same server 555 for for "example.org" : 557 ;; Sending: 558 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50939 559 ;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 561 ;; OPT PSEUDOSECTION: 562 ; EDNS: version: 0, flags:; udp: 4096 563 ; COOKIE: 2464c4abcf10c957010000005cf79f111f8130c3eee29480 564 ;; QUESTION SECTION: 565 ;example.org. IN A 567 ;; QUERY SIZE: 52 569 The authoritative nameserver (server) now generates a new Server 570 Cookie. The server SHOULD do this because it can see the Server 571 Cookie send by the client is older than half an hour Section 4.3, but 572 it is also fine for a server to generate a new Server Cookie sooner, 573 or even for every answer. 575 ;; Got answer: 576 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50939 577 ;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 579 ;; OPT PSEUDOSECTION: 580 ; EDNS: version: 0, flags:; udp: 4096 581 ; COOKIE: 2464c4abcf10c957010000005cf7a871d4a564a1442aca77 (good) 582 ;; QUESTION SECTION: 583 ;example.org. IN A 585 ;; ANSWER SECTION: 586 example.org. 86400 IN A 192.0.2.34 588 ;; Query time: 6 msec 589 ;; SERVER: 192.0.2.53#53(192.0.2.53) 590 ;; WHEN: Wed Jun 5 11:33:05 UTC 2019 591 ;; MSD SIZE rcvd: 84 593 A.3. Another client learning a renewed Server Cookie 595 Another resolver (client) with IPv4 address 203.0.113.203 sends a 596 request to the same server with a valid Server Cookie that it learned 597 before (at Wed Jun 5 09:46:25 UTC 2019). Note that the Server Cookie 598 has Reserved bytes set, but is still valid with the configured 599 secret; the Hash part is calculated taking along the Reserved bytes. 601 ;; Sending: 602 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34736 603 ;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 605 ;; OPT PSEUDOSECTION: 606 ; EDNS: version: 0, flags:; udp: 4096 607 ; COOKIE: fc93fc62807ddb8601abcdef5cf78f71a314227b6679ebf5 608 ;; QUESTION SECTION: 609 ;example.com. IN A 611 ;; QUERY SIZE: 52 613 The authoritative nameserver (server) replies with a freshly 614 generated Server Cookie for this client conformant with this 615 specification; so with the Reserved bits set to zero. 617 ;; Got answer: 618 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 34736 619 ;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 621 ;; OPT PSEUDOSECTION: 622 ; EDNS: version: 0, flags:; udp: 4096 623 ; COOKIE: fc93fc62807ddb86010000005cf7a9acf73a7810aca2381e (good) 624 ;; QUESTION SECTION: 625 ;example.com. IN A 627 ;; ANSWER SECTION: 628 example.com. 86400 IN A 192.0.2.34 630 ;; Query time: 6 msec 631 ;; SERVER: 192.0.2.53#53(192.0.2.53) 632 ;; WHEN: Wed Jun 5 11:38:20 UTC 2019 633 ;; MSD SIZE rcvd: 84 635 A.4. IPv6 query with rolled over secret 637 The query below is from a client with IPv6 address 638 2001:db8:220:1:59de:d0f4:8769:82b8 to a server with IPv6 address 639 2001:db8:8f::53. The client has learned a valid Server Cookie before 640 when the Server had the secret: dd3bdf9344b678b185a6f5cb60fca715. 641 The server now uses a new secret, but it can still validate the 642 Server Cookie provided by the client as the old secret has not 643 expired yet. 645 ;; Sending: 646 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6774 647 ;; flags:; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 649 ;; OPT PSEUDOSECTION: 650 ; EDNS: version: 0, flags:; udp: 4096 651 ; COOKIE: 22681ab97d52c298010000005cf7c57926556bd0934c72f8 652 ;; QUESTION SECTION: 653 ;example.net. IN A 655 ;; QUERY SIZE: 52 657 The authoritative nameserver (server) replies with a freshly 658 generated server cookie for this client with its new secret: 659 445536bcd2513298075a5d379663c962 661 ;; Got answer: 662 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6774 663 ;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 665 ;; OPT PSEUDOSECTION: 666 ; EDNS: version: 0, flags:; udp: 4096 667 ; COOKIE: 22681ab97d52c298010000005cf7c609a6bb79d16625507a (good) 668 ;; QUESTION SECTION: 669 ;example.net. IN A 671 ;; ANSWER SECTION: 672 example.net. 86400 IN A 192.0.2.34 674 ;; Query time: 6 msec 675 ;; SERVER: 2001:db8:8f::53#53(2001:db8:8f::53) 676 ;; WHEN: Wed Jun 5 13:36:57 UTC 2019 677 ;; MSD SIZE rcvd: 84 679 Appendix B. Implementation status 681 At the time of writing, BIND from version 9.16 and Knot DNS from 682 version 2.9.0 create Server Cookies according to the recipe described 683 in this draft. Unbound and NSD have an Proof of Concept 684 implementation that has been tested for interoperability during the 685 hackathon at the IETF104 in Prague. Construction of privacy 686 maintaining Client Cookies according to the directions in this draft 687 have been implemented in the getdns library and will be in the 688 upcoming getdns-1.6.1 release and in Stubby version 0.3.1. 690 Authors' Addresses 691 Ondrej Sury 692 Internet Systems Consortium 693 Czechia 695 Email: ondrej@isc.org 697 Willem Toorop 698 NLnet Labs 699 Science Park 400 700 1098 XH Amsterdam 701 Netherlands 703 Email: willem@nlnetlabs.nl 705 Donald E. Eastlake 3rd 706 Futurewei Technologies 707 1424 Pro Shop Court 708 Davenport, FL 33896 709 United States of America 711 Phone: +1-508-333-2270 712 Email: d3e3e3@gmail.com 714 Mark Andrews 715 Internet Systems Consortium 716 950 Charter Street 717 Redwood City, CA 94063 718 United States of America 720 Email: marka@isc.org