--- 1/draft-ietf-dnsop-server-cookies-01.txt 2019-11-18 08:13:11.981705359 -0800 +++ 2/draft-ietf-dnsop-server-cookies-02.txt 2019-11-18 08:13:12.013706273 -0800 @@ -1,23 +1,23 @@ DNSOP Working Group O. Sury Internet-Draft Internet Systems Consortium Updates: 7873 (if approved) W. Toorop Intended status: Standards Track NLnet Labs -Expires: May 7, 2020 D. Eastlake 3rd +Expires: May 21, 2020 D. Eastlake 3rd Futurewei Technologies M. Andrews Internet Systems Consortium - November 4, 2019 + November 18, 2019 Interoperable Domain Name System (DNS) Server Cookies - draft-ietf-dnsop-server-cookies-01 + draft-ietf-dnsop-server-cookies-02 Abstract DNS cookies, as specified in RFC 7873, are a lightweight DNS transaction security mechanism that provides limited protection to DNS servers and clients against a variety of denial-of-service and amplification, forgery, or cache poisoning attacks by off-path attackers. This document provides precise directions for creating Server Cookies @@ -34,21 +34,21 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on May 7, 2020. + This Internet-Draft will expire on May 21, 2020. Copyright Notice Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents @@ -66,30 +66,31 @@ 2. Changes to [RFC7873] . . . . . . . . . . . . . . . . . . . . 4 3. Constructing a Client Cookie . . . . . . . . . . . . . . . . 4 4. Constructing a Server Cookie . . . . . . . . . . . . . . . . 5 4.1. The Version Sub-Field . . . . . . . . . . . . . . . . . . 6 4.2. The Reserved Sub-Field . . . . . . . . . . . . . . . . . 6 4.3. The Timestamp Sub-Field . . . . . . . . . . . . . . . . . 6 4.4. The Hash Sub-Field . . . . . . . . . . . . . . . . . . . 6 5. Updating the Server Secret . . . . . . . . . . . . . . . . . 7 6. Cookie Algorithms . . . . . . . . . . . . . . . . . . . . . . 8 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 - 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 8.1. Normative References . . . . . . . . . . . . . . . . . . 9 - 8.2. Informative References . . . . . . . . . . . . . . . . . 9 - Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 10 - Appendix B. Test vectors . . . . . . . . . . . . . . . . . . . . 10 - B.1. Learning a new Server Cookie . . . . . . . . . . . . . . 10 - B.2. The same client learning a renewed (fresh) Server Cookie 11 - B.3. Another client learning a renewed Server Cookie . . . . . 12 - B.4. IPv6 query with rolled over secret . . . . . . . . . . . 13 - Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 14 + 8. Security and Privacy Considerations . . . . . . . . . . . . . 9 + 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 + 9.1. Normative References . . . . . . . . . . . . . . . . . . 10 + 9.2. Informative References . . . . . . . . . . . . . . . . . 10 + Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 11 + Appendix B. Test vectors . . . . . . . . . . . . . . . . . . . . 11 + B.1. Learning a new Server Cookie . . . . . . . . . . . . . . 11 + B.2. The same client learning a renewed (fresh) Server Cookie 12 + B.3. Another client learning a renewed Server Cookie . . . . . 13 + B.4. IPv6 query with rolled over secret . . . . . . . . . . . 14 + Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15 1. Introduction DNS cookies, as specified in [RFC7873], are a lightweight DNS transaction security mechanism that provides limited protection to DNS servers and clients against a variety of denial-of-service and amplification, forgery, or cache poisoning attacks by off-path attackers. This document specifies a means of producing interoperable strong cookies so that an anycast server set including diverse implementations can be easily configured to interoperate with @@ -129,20 +130,22 @@ In Section Section 5 instructions on updating Server Secrets are given. In Section Section 6 the different hash functions usable for DNS Cookie construction are listed. [FNV] and HMAC-SHA-256-64 [RFC6234] are deprecated and [SipHash-2.4] is introduced as a REQUIRED hash function for server side DNS Cookie implementations. IANA considerations are in Section 7. + Privacy and Security Considerations in Section 8. + Acknowledgements are in Appendix A. Test vectors are in Appendix B. 1.2. Definitions The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "*NOT RECOMMENDED*", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all @@ -163,56 +166,60 @@ specification in Section 4 of this document, which MUST be used by Server Cookie implementations. This document has suggestions on Client Cookie construction in Section 3. The previous example in Appendix A.2 of [RFC7873] is NOT RECOMMENDED. 3. Constructing a Client Cookie The Client Cookie is a cryptographic nonce and should be treated as - such. For simplicity, it can be calculated from Server IP Address, - and a Client Secret known only to the Client that is changed whenever - an IP address previously used by the Client is no longer available. - The Client Cookie SHOULD have at least 64-bits of entropy. + such. It is RECOMMENDED to create a new Client Cookie for each new + upstream server a Client connects to. The Client Cookie SHOULD have + at least 64-bits of entropy. - Except for when the Client IP address changes, there is no need to - change the Client Secret often if a secure pseudorandom function - (like [SipHash-2.4]) is used. It is reasonable to change the Client - secret then only if it has been compromised or after a relatively - long period of time such as no longer than a year. + When a Server does not support DNS Cookies, the Client MUST NOT send + the same Client Cookie to that same Server again. Instead, it is + recommended that the Client does not send a Client Cookie to that + Server for a certain period, like for example five minutes, before it + retries with a new Client Cookie. - It is RECOMMENDED but not required that the following pseudorandom - function be used to construct the Client Cookie: + When a Server does support DNS Cookies, the Client should store the + Client Cookie alongside the Server Cookie it registered for that + Server. - Client-Cookie = MAC_Algorithm( - Server IP Address, Client Secret ) + Except for when the Client IP address changes, there is no need to + change the Client Cookie often. It is reasonable to change the + Client Cookie then only if it has been compromised or after a + relatively long period of time such as no longer than a year. Client + Cookies are not expected to survive a program restart. + + Client-Cookie = 64 bits of entropy Previously, the recommended algorithm to compute the Client Cookie - included Client IP Address as an input to the MAC_Algorithm. + included Client IP Address as an input to a hashing function. However, when implementing the DNS Cookies, several DNS vendors found impractical to include the Client IP as the Client Cookie is typically computed before the Client IP address is known. Therefore, the requirement to put Client IP address as input was removed. However, for privacy reasons, in order to prevent tracking of devices across links and to not circumvent IPv6 Privacy Extensions [RFC4941], Clients MUST NOT re-use a Client or Server Cookie after the Client IP address has changed. - The Client IP address is available on the UDP socket when it receives - the Server Cookie and should be registered alongside the Server + One way to track Client IP addresses, is to register the Client IP + address alongside the Server Cookie when it receives the Server Cookie. In subsequent queries to the Server with that Server Cookie, - the socket MUST be bound to the Client IP address that was also used + the socket MAY be bound to the Client IP address that was also used (and registered) when it received the Server Cookie. Failure to bind - must result in a new Client Cookie, which, for the method described - in this section means a new Client Secret. + MUST then result in a new Client Cookie. 4. Constructing a Server Cookie The Server Cookie is effectively a Message Authentication Code (MAC) and should be treated as such. The Server Cookie is calculated from the Client Cookie, a series of Sub-Fields specified below, the Client IP address, and a Server Secret known only to the servers responding on the same address in an anycast set. Changing the Server Secret regularly is RECOMMENDED but, when a @@ -377,23 +384,72 @@ +---------+-------+---------------------------------------+ | 0 | 8-32 | reserved | | 1 | 8-15 | unassiged | | 1 | 16 | SipHash-2.4 [this document] Section 4 | | 1 | 17-32 | unassigned | | 2-239 | 8-32 | unassigned | | 240-254 | 8-32 | private use | | 255 | 8-32 | reserved | +---------+-------+---------------------------------------+ -8. References +8. Security and Privacy Considerations -8.1. Normative References + DNS Cookies provides limited protection to DNS servers and clients + against a variety of denial-of-service and amplification/forgery or + cache poisoning attacks by off-path attackers. They provide no + protection against on-path adversaries that can observe the plaintext + DNS traffic. An on-path adversary that can observe a Server Cookie + for a client and server interaction, can use that Server Cookie for + amplification and denial-of-service forgery attacks for the lifetime + of the Server Cookie. + + In [RFC7873] it was RECOMMENDED to construct a Client Cookie by using + a pseudorandom function of the Client IP Address, the Server IP + Address, and a secret quantity known only to the client. The Client + IP Address was included to ensure that a client could not be tracked + if its IP Address changes due to privacy mechanisms or otherwise. + + In this document, we changed Client Cookie construction to be just 64 + bits of entropy newly created for each new upstream server the client + connects to. As a consequence additional care needs to be taken to + prevent tracking of clients. To prevent tracking, a new Client + Cookie for a server MUST be created whenever the Client IP Address + changes. + + Unfortunately, tracking Client IP Address Changes is impractical with + servers that do not support DNS Cookies. To prevent tracking of + clients with non DNS Cookie supporting servers, a client MUST NOT + send a previously sent Client Cookie. To prevent the creation of a + new Client Cookie for each query to an non DNS Cookies supporting + server, it is RECOMMENDED to not send a Client Cookie to that server + for a certain period, like for example five minute. + + Summarizing: + + o In order to provide minimal authentication, a client MUST use a + different Client Cookie for each different Server IP Address. + + o To prevent tracking of clients, a new Client Cookie MUST be + created when the Client IP Address changes. + + o To prevent tracking of clients for a non DNS Cookie supporting + server, a client MUST NOT send a previously sent Client Cookie to + that server, unless it can track Client IP Address changes for + those servers too. + + Besides the Client Cookie construction, this update on [RFC7873] does + not introduce any new characteristics to DNS Cookies operations and + the Security Considerations section of [RFC7873] still applies. + +9. References + +9.1. Normative References [RFC1982] Elz, R. and R. Bush, "Serial Number Arithmetic", RFC 1982, DOI 10.17487/RFC1982, August 1996, . [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . @@ -402,21 +458,21 @@ . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [SipHash-2.4] Aumasson, J. and D. Bernstein, "SipHash: a fast short- input PRF", 2012, . -8.2. Informative References +9.2. Informative References [FNV] Fowler, G., Noll, L., Vo, K., Eastlake, D., and T. Hansen, "The FNV Non-Cryptographic Hash Algorithm", . [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI 10.17487/RFC6234, May 2011, .