draft-ietf-dnsop-cookies-02.txt   draft-ietf-dnsop-cookies-03.txt 
INTERNET-DRAFT Donald Eastlake INTERNET-DRAFT Donald Eastlake
Intended Status: Proposed Standard Huawei Intended Status: Proposed Standard Huawei
Mark Andrews Mark Andrews
ISC ISC
Expires: December 15, 2015 June 16, 2015 Expires: December 31, 2015 July 1, 2015
Domain Name System (DNS) Cookies Domain Name System (DNS) Cookies
<draft-ietf-dnsop-cookies-02.txt> <draft-ietf-dnsop-cookies-03.txt>
Abstract Abstract
DNS cookies are a lightweight DNS transaction security mechanism that DNS cookies are a lightweight DNS transaction security mechanism that
provides limited protection to DNS servers and clients against a provides limited protection to DNS servers and clients against a
variety of increasingly common denial-of-service and amplification / variety of increasingly common denial-of-service and amplification /
forgery or cache poisoning attacks by off-path attackers. DNS Cookies forgery or cache poisoning attacks by off-path attackers. DNS Cookies
are tolerant of NAT, NAT-PT, and anycast and can be incrementally are tolerant of NAT, NAT-PT, and anycast and can be incrementally
deployed. deployed.
skipping to change at page 2, line 24 skipping to change at page 2, line 24
2.1 Denial-of-Service Attacks..............................6 2.1 Denial-of-Service Attacks..............................6
2.1.1 DNS Amplification Attacks............................6 2.1.1 DNS Amplification Attacks............................6
2.1.2 DNS Server Denial-of-Service.........................6 2.1.2 DNS Server Denial-of-Service.........................6
2.2 Cache Poisoning and Answer Forgery Attacks.............7 2.2 Cache Poisoning and Answer Forgery Attacks.............7
3. Comments on Existing DNS Security.......................8 3. Comments on Existing DNS Security.......................8
3.1 Existing DNS Data Security.............................8 3.1 Existing DNS Data Security.............................8
3.2 DNS Message/Transaction Security.......................8 3.2 DNS Message/Transaction Security.......................8
3.3 Conclusions on Existing DNS Security...................8 3.3 Conclusions on Existing DNS Security...................8
4. DNS Cookie Option.......................................9 4. DNS Cookie Option......................................10
4.1 Client Cookie.........................................10 4.1 Client Cookie.........................................11
4.2 Server Cookie.........................................10 4.2 Server Cookie.........................................11
5. DNS Cookies Protocol Description.......................11 5. DNS Cookies Protocol Specification.....................12
5.1 Originating Requests..................................11 5.1 Originating Requests..................................12
5.2 Responding to Request.................................11 5.2 Responding to Request.................................12
5.2.1 No Opt RR or No COOKIE OPT option...................12 5.2.1 No Opt RR or No COOKIE OPT option...................13
5.2.2 Malformed COOKIE OPT option.........................12 5.2.2 Malformed COOKIE OPT option.........................13
5.2.3 Only a Client Cookie................................12 5.2.3 Only a Client Cookie................................13
5.2.4 A Client Cookie and Server Cookie...................13 5.2.4 A Client Cookie and Server Cookie...................14
5.2.4.1 A Client Cookie and Invalid Server Cookie.........13 5.2.4.1 A Client Cookie and Invalid Server Cookie.........14
5.2.4.2 A Client Cookie and Valid Server Cookie...........13 5.2.4.2 A Client Cookie and Valid Server Cookie...........14
5.3 Processing Responses..................................13 5.3 Processing Responses..................................14
5.4 Client and Server Secret Rollover.....................14 5.4 QUERYing for a Server Cookie..........................15
5.5 Implementation Requirement............................15 5.5 Client and Server Secret Rollover.....................16
6. NAT Considerations and AnyCast Server Considerations...16 6. NAT Considerations and AnyCast Server Considerations...17
7. Deployment.............................................18 7. Deployment.............................................19
8. IANA Considerations....................................19 8. IANA Considerations....................................20
9. Security Considerations................................20 9. Security Considerations................................21
9.1 Cookie Algorithm Considerations.......................20 9.1 Cookie Algorithm Considerations.......................21
10. Implementation Considerations.........................21 10. Implementation Considerations.........................23
Normative References......................................22 Normative References......................................24
Informative References....................................22 Informative References....................................24
Acknowledgements..........................................24 Acknowledgements..........................................26
Appendix A: Example Client Cookie Algorithms..............25 Appendix A: Example Client Cookie Algorithms..............27
A.1 A Simple Algorithm....................................25 A.1 A Simple Algorithm....................................27
A.2 A More Complex Algorithm..............................25 A.2 A More Complex Algorithm..............................27
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
Table of Contents (continued) Table of Contents (continued)
Appendix B: Example Server Cookie Algorithms..............26 Appendix B: Example Server Cookie Algorithms..............28
B.1 A Simple Algorithm....................................26 B.1 A Simple Algorithm....................................28
B.2 A More Complex Algorithm..............................26 B.2 A More Complex Algorithm..............................28
Author's Address..........................................28 Author's Address..........................................30
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
1. Introduction 1. Introduction
As with many core Internet protocols, the Domain Name System (DNS) As with many core Internet protocols, the Domain Name System (DNS)
was originally designed at a time when the Internet had only a small was originally designed at a time when the Internet had only a small
pool of trusted users. As the Internet has grown exponentially to a pool of trusted users. As the Internet has grown exponentially to a
global information utility, the DNS has increasingly been subject to global information utility, the DNS has increasingly been subject to
abuse. abuse.
This document describes DNS cookies, a lightweight DNS transaction This document describes DNS cookies, a lightweight DNS transaction
security mechanism specified as an OPT [RFC6891] option. The DNS security mechanism specified as an OPT [RFC6891] option. The DNS
cookies mechanism provides limited protection to DNS servers and cookies mechanism provides limited protection to DNS servers and
clients against a variety of increasingly common abuses by off-path clients against a variety of increasingly common abuses by off-path
attackers. It is compatible with and can be used in conjunction with attackers. It is compatible with and can be used in conjunction with
other DNS transaction forgery resistance measures such as those in other DNS transaction forgery resistance measures such as those in
[RFC5452]. [RFC5452].
The protection provided by DNS cookies bears some resemblance to that The protection provided by DNS cookies is similar to that provided by
provided by using TCP for DNS transactions. To bypass the weak using TCP for DNS transactions. To bypass the weak protection
protection provided by using TCP requires an off-path attacker provided by using TCP requires. among other things, that an off-path
guessing the 32-bit TCP sequence number in use. To bypass the weak attacker guessing the 32-bit TCP sequence number in use. To bypass
protection provided by DNS Cookies requires such an attacker to guess the weak protection provided by DNS Cookies requires such an attacker
a 64-bit pseudo-random quantity. Where DNS Cookies are not available to guess a 64-bit pseudo-random "cookie" quantity. Where DNS Cookies
but TCP is, a fall back to using TCP is a reasonable strategy. are not available but TCP is, falling back to using TCP is
reasonable.
If only one party to a DNS transaction supports DNS cookies, the If only one party to a DNS transaction supports DNS cookies, the
mechanism does not provide a benefit or significantly interfere; but, mechanism does not provide a benefit or significantly interfere; but,
if both support it, the additional security provided is automatically if both support it, the additional security provided is automatically
available. available.
The DNS cookies mechanism is designed to work in the presence of NAT The DNS cookies mechanism is designed to work in the presence of NAT
and NAT-PT boxes and guidance is provided herein on supporting the and NAT-PT boxes and guidance is provided herein on supporting the
DNS cookies mechanism in anycast servers. DNS cookies mechanism in anycast servers.
skipping to change at page 5, line 17 skipping to change at page 5, line 17
Section 7 discusses incremental deployment considerations. Section 7 discusses incremental deployment considerations.
Sections 8 and 9 describe IANA and Security Considerations. Sections 8 and 9 describe IANA and Security Considerations.
1.2 Definitions 1.2 Definitions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
An "off-path attacker", for a particular DNS client and server, is "Off-path attacker", for a particular DNS client and server, is
defined as an attacker who cannot observe the DNS request and defined as an attacker who cannot observe the DNS request and
response messages between that client and server. response messages between that client and server.
"Soft state" indicates information learned or derived by a host which "Soft state" indicates information learned or derived by a host which
may be discarded when indicated by the policies of that host but can may be discarded when indicated by the policies of that host
be later re-instantiated if needed. For example, it could be but can be later re-instantiated if needed. For example, it
discarded after a period of time or when storage for caching such could be discarded after a period of time or when storage for
data becomes full. If operations requiring that soft state continue caching such data becomes full. If operations requiring that
after it has been discarded, it will be automatically re-generated, soft state continue after it has been discarded, it will be
albeit at some cost. automatically re-generated, albeit at some cost.
"Silently discarded" indicates that there are no DNS protocol message "Silently discarded" indicates that there are no DNS protocol message
consequences; however, it is RECOMMENDED that appropriate network consequences; however, it is RECOMMENDED that appropriate
management facilities be included in implementations, such as a network management facilities be included in implementations,
counter of the occurrences of each such event type. such as a counter of the occurrences of each such event type.
"IP address" is used herein as a length independent term and includes "IP address" is used herein as a length independent term and includes
both IPv4 and IPv6 addresses. both IPv4 and IPv6 addresses.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
2. Threats Considered 2. Threats Considered
DNS cookies are intended to provide significant but limited DNS cookies are intended to provide significant but limited
protection against certain attacks by off-path attackers as described protection against certain attacks by off-path attackers as described
below. These attacks include denial-of-service, cache poisoning and below. These attacks include denial-of-service, cache poisoning and
answer forgery. answer forgery.
skipping to change at page 7, line 10 skipping to change at page 7, line 10
can be even worse for recursive servers implementing DNSSEC can be even worse for recursive servers implementing DNSSEC
([RFC4033] [RFC4034] [RFC4035]) because they may be induced to ([RFC4033] [RFC4034] [RFC4035]) because they may be induced to
perform burdensome cryptographic computations in attempts to verify perform burdensome cryptographic computations in attempts to verify
the authenticity of data they retrieve in trying to answer the the authenticity of data they retrieve in trying to answer the
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
request. request.
The computational or communications burden caused by such requests The computational or communications burden caused by such requests
may not dependent on a forged IP source address, but the use of such may not depend on a forged IP source address, but the use of such
addresses makes addresses makes
+ the source of the requests causing the denial-of-service attack + the source of the requests causing the denial-of-service attack
harder to find and harder to find and
+ restriction of the IP addresses from which such requests should + restriction of the IP addresses from which such requests should
be honored hard or impossible to specify or verify. be honored hard or impossible to specify or verify.
Use of DNS cookies should enables a server to reject forged queries Use of DNS cookies should enable a server to reject forged requests
from an off path attacker with relative ease and before any recursive from an off path attacker with relative ease and before any recursive
queries or public key cryptographic operations are performed. queries or public key cryptographic operations are performed.
2.2 Cache Poisoning and Answer Forgery Attacks 2.2 Cache Poisoning and Answer Forgery Attacks
The form of the cache poisoning attacks considered is to send forged The form of the cache poisoning attacks considered is to send forged
replies to a resolver. Modern network speeds for well-connected hosts replies to a resolver. Modern network speeds for well-connected hosts
are such that, by forging replies from the IP addresses of a DNS are such that, by forging replies from the IP addresses of a DNS
server to a resolver for common names or names that resolver has been server to a resolver for names that resolver has been induced to
induced to resolve, there can be an unacceptably high probability of resolve or for common names whose resource records have short time-
to-live values, there can be an unacceptably high probability of
randomly coming up with a reply that will be accepted and cause false randomly coming up with a reply that will be accepted and cause false
DNS information to be cached by that resolver (the Dan Kaminsky DNS information to be cached by that resolver (the Dan Kaminsky
attack). This can be used to facilitate phishing attacks and other attack). This can be used to facilitate phishing attacks and other
diversion of legitimate traffic to a compromised or malicious host diversion of legitimate traffic to a compromised or malicious host
such as a web server. such as a web server.
With the use of DNS cookies, a resolver can generally reject such With the use of DNS cookies, a resolver can generally reject such
forged replies. forged replies.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
3. Comments on Existing DNS Security 3. Comments on Existing DNS Security
Two forms of security have been added to DNS, data security and Two forms of security have been added to DNS, data security and
message/transaction security. message/transaction security.
3.1 Existing DNS Data Security 3.1 Existing DNS Data Security
DNS data security is one part of DNSSEC and is described in DNS data security is one part of DNSSEC and is described in
[RFC4033], [RFC4034], and [RFC4035] and updates thereto. It provides [RFC4033], [RFC4034], [RFC4035], and updates thereto. It provides
data origin authentication and authenticated denial of existence. data origin authentication and authenticated denial of existence.
DNSSEC is being deployed and can provide strong protection against DNSSEC is being deployed and can provide strong protection against
forged data; however, it has the unintended effect of making some forged data; however, it has the unintended effect of making some
denial-of-service attacks worse because of the cryptographic denial-of-service attacks worse because of the cryptographic
computational load it can require and the increased size in DNS computational load it can require and the increased size in DNS
response packets that it tends to produce. response packets that it tends to produce.
3.2 DNS Message/Transaction Security 3.2 DNS Message/Transaction Security
The second form of security that has been added to DNS provides The second form of security that has been added to DNS provides
"transaction" security through TSIG [RFC2845] or SIG(0) [RFC2931]. "transaction" security through TSIG [RFC2845] or SIG(0) [RFC2931].
TSIG could provide strong protection against the attacks for which TSIG could provide strong protection against the attacks for which
the DNS Cookies mechanism provide weak protection; however, TSIG is the DNS Cookies mechanism provides weak protection; however, TSIG is
non-trivial to deploy in the general Internet because of the burden non-trivial to deploy in the general Internet because of the burdens
it imposes of pre-agreement and key distribution between client- it imposes. Among these burdens are pre-agreement and key
server pairs, the burden of server side key state, and because it distribution between client and server, keeping track of server side
requires time synchronization between client and server. key state, and required time synchronization between client and
server.
TKEY [RFC2930] can solve the problem of key distribution for TSIG but TKEY [RFC2930] can solve the problem of key distribution for TSIG but
some modes of TKEY impose a substantial cryptographic computation some modes of TKEY impose a substantial cryptographic computation
loads and can be dependent on the deployment of DNS data security load and can be dependent on the deployment of DNS data security (see
(see Section 3.1). Section 3.1).
SIG(0) [RFC2931] provides less denial of service protection than TSIG SIG(0) [RFC2931] provides less denial of service protection than TSIG
or, in one way, even DNS cookies, because it does not authenticate or, in one way, even DNS cookies, because it does not authenticate
requests, only complete transactions. In any case, it also depends requests, only complete transactions. In any case, it also depends
on the deployment of DNS data security and requires computationally on the deployment of DNS data security and requires computationally
burdensome public key cryptographic operations. burdensome public key cryptographic operations.
3.3 Conclusions on Existing DNS Security 3.3 Conclusions on Existing DNS Security
The existing DNS security mechanisms do not provide the services The existing DNS security mechanisms do not provide the services
provided by the DNS Cookies mechanism: lightweight message provided by the DNS Cookies mechanism: lightweight message
authentication of DNS requests and responses with no requirement for authentication of DNS requests and responses with no requirement for
INTERNET-DRAFT DNS Cookies
pre-configuration or per client server side state. pre-configuration or per client server side state.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
4. DNS Cookie Option 4. DNS Cookie Option
The DNS Cookie Option is an OPT RR [RFC6891] option that can be The DNS Cookie Option is an OPT RR [RFC6891] option that can be
included in the RDATA portion of an OPT RR in DNS requests and included in the RDATA portion of an OPT RR in DNS requests and
responses. The option length varies depending on the circumstances responses. The option length varies depending on the circumstances
in which it is being used. There are two cases as described below. in which it is being used. There are two cases as described below.
Both use the same OPTION-CODE; they are distinguished by their Both use the same OPTION-CODE; they are distinguished by their
length. length.
In a request sent by a client to a server when the client does not In a request sent by a client to a server when the client does not
know the server cookie, its length is 8, consisting an 8 byte Client know the server's cookie, its length is 8, consisting of an 8 byte
Cookie as shown in Figure 1. Client Cookie as shown in Figure 1.
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION-CODE = TBD1 | OPTION-LENGTH = 8 | | OPTION-CODE = 10 | OPTION-LENGTH = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
+-+- Client Cookie (fixed size, 8 bytes) -+-+-+-+ +-+- Client Cookie (fixed size, 8 bytes) -+-+-+-+
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1. COOKIE Option, Unknown Server Cookie Figure 1. COOKIE Option, Unknown Server Cookie
In a request sent by a client when a server cookie is known and in In a request sent by a client when a server cookie is known and in
all responses, the length is variable from 16 to 40 bytes, consisting all responses, the length is variable from 16 to 40 bytes, consisting
of an 8 bytes Client Cookie followed by the variable 8 to 32 bytes of an 8 bytes Client Cookie followed by the variable 8 to 32 bytes
Server Cookie as shown in Figure 2. The variability of the option Server Cookie as shown in Figure 2. The variability of the option
length stems from the variable length Server Cookie. The Server length stems from the variable length Server Cookie. The Server
Cookie is an integer number of bytes with a minimum size of 8 bytes Cookie is an integer number of bytes with a minimum size of 8 bytes
for security and a maximum size of 32 bytes for implementation for security and a maximum size of 32 bytes for implementation
convenience. convenience.
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3
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 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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| OPTION-CODE = TBD1 | OPTION-LENGTH >= 16, <= 40 | | OPTION-CODE = 10 | OPTION-LENGTH >= 16, <= 40 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
+-+- Client Cookie (fixed size, 8 bytes) -+-+-+-+ +-+- Client Cookie (fixed size, 8 bytes) -+-+-+-+
| | | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | | |
/ Server Cookie (variable size, 8 to 32 bytes) / / Server Cookie (variable size, 8 to 32 bytes) /
/ / / /
+-+-+-+-... +-+-+-+-...
Figure 2. COOKIE Option, Known Server Cookie Figure 2. COOKIE Option, Known Server Cookie
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
4.1 Client Cookie 4.1 Client Cookie
The Client Cookie SHOULD be a pseudo-random function of the server IP The Client Cookie SHOULD be a pseudo-random function of the server IP
address and a secret quantity known only to the client. This client address and a secret quantity known only to the client. This client
secret SHOULD have at least 64 bits of entropy [RFC4086] and be secret SHOULD have at least 64 bits of entropy [RFC4086] and be
changed periodically (see Section 5.4). The selection of the pseudo- changed periodically (see Section 5.5). The selection of the pseudo-
random function is a matter private to the client as only the client random function is a matter private to the client as only the client
needs to recognize its own DNS cookies. needs to recognize its own DNS cookies.
For further discussion of the Client Cookie field, see Section 5.1. For further discussion of the Client Cookie field, see Section 5.1.
For example methods of determining a Client Cookie, see Appendix A. For example methods of determining a Client Cookie, see Appendix A.
A client MUST NOT use the same Client Cookie value for queries to all A client MUST NOT use the same Client Cookie value for requests to
servers. all servers.
4.2 Server Cookie 4.2 Server Cookie
The Server Cookie SHOULD consist of or include a 64-bit or larger The Server Cookie SHOULD consist of or include a 64-bit or larger
pseudo-random function of the request source IP address, the request pseudo-random function of the request source IP address, the request
Client Cookie, and a secret quantity known only to the server. (See Client Cookie, and a secret quantity known only to the server. (See
Section 6 for a discussion of why the Client Cookie is used as input Section 6 for a discussion of why the Client Cookie is used as input
to the Server Cookie but the Server Cookie is not used as an input to to the Server Cookie but the Server Cookie is not used as an input to
the Client Cookie.) This server secret SHOULD have at least 64 bits the Client Cookie.) This server secret SHOULD have at least 64 bits
of entropy [RFC4086] and be changed periodically (see Section 5.4). of entropy [RFC4086] and be changed periodically (see Section 5.5).
The selection of the pseudo-random function is a matter private to The selection of the pseudo-random function is a matter private to
the server as only the server needs to recognize its own DNS cookies. the server as only the server needs to recognize its own DNS cookies.
For further discussion of the Server Cookie field see Section 5.2. For further discussion of the Server Cookie field see Section 5.2.
For example methods of determining a Server Cookie, see Appendix B. For example methods of determining a Server Cookie, see Appendix B.
A server MUST NOT use the same Server Cookie value for responses to A server MUST NOT use the same Server Cookie value for responses to
all clients. all clients.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
5. DNS Cookies Protocol Description 5. DNS Cookies Protocol Specification
This section discusses using DNS Cookies in the DNS Protocol. This section discusses using DNS Cookies in the DNS Protocol. The
cycle of originating a request, responding to that request, and
processing the response are covered in Sections 5.1, 5.2, and 5.3. A
de facto extension to QUERY to allow pre-fetching a Server Cookie is
specified in Section 5.4. Rollover of the client and server secrets
and transient retention of the old coookie or secret is covered in
Section 5.5.
DNS clients and servers SHOULD implement DNS cookies to decrease
their vulnerability to the threats discussed in Section 2.
5.1 Originating Requests 5.1 Originating Requests
A DNS client that implements DNS includes one DNS COOKIE OPT option A DNS client that implements DNS Cookies includes one DNS COOKIE OPT
containing a Client Cookie in every DNS request it sends unless DNS option containing a Client Cookie in every DNS request it sends
cookies are disabled. unless DNS cookies are disabled.
If the client has a cached server cookie for the server against its If the client has a cached Server Cookie for the server against its
IP address it uses the longer cookie form and includes that server IP address it uses the longer cookie form and includes that Server
cookie in the option along with the client cookie (Figure 2) Cookie in the option along with the Client Cookie (Figure 2).
otherwise it just sends the shorter form option with a client cookie Otherwise it just sends the shorter form option with a Client Cookie
(Figure 1). (Figure 1).
5.2 Responding to Request 5.2 Responding to Request
The Server Cookie, when it occurs in a COOKIE OPT option in a The Server Cookie, when it occurs in a COOKIE OPT option in a
request, is intended to weakly assure the server that the request request, is intended to weakly assure the server that the request
came from a client that is both at the source IP address of the came from a client that is both at the source IP address of the
request and using the Client Cookie included in the option. This weak request and using the Client Cookie included in the option. This weak
assurance is provided by the Server Cookie that server would send to assurance is provided by the Server Cookie that server would send to
that client in an earlier response appearing as the Server Cookie that client in an earlier response appearing as the Server Cookie
field in the request. field in the request.
At a server where DNS Cookies are not implemented and enabled, At a server where DNS Cookies are not implemented and enabled,
presence of a COOKIE OPT option is ignored and the server responds as presence of a COOKIE OPT option is ignored and the server responds as
before. before.
When DNS Cookies are implemented and enabled, there are four When DNS Cookies are implemented and enabled, there are four
possibilities: (1) there is no OPT RR at all in the request; (2) possibilities: (1) there is no OPT RR at all in the request; (2)
there is no valid Client Cookie in the request because the COOKIE OPT there is no valid Client Cookie in the request because the COOKIE OPT
option in absent from the request or one is present but not a legal option is absent from the request, or one is present but is not a
length; (3) there is a valid length cookie option in the request with legal length; (3) there is a valid length cookie option in the
no Server Cookie or an incorrect Server Cookie; or (4) there is a request with no Server Cookie or an incorrect Server Cookie; or (4)
cookie option in the request with a correct Server Cookie. The four there is a cookie option in the request with a correct Server Cookie.
possibilities are discussed in the subsections below.
INTERNET-DRAFT DNS Cookies
The four possibilities are discussed in the subsections below.
In all cases of multiple COOKIE OPT options in a request, only the In all cases of multiple COOKIE OPT options in a request, only the
first (the one closest to the DNS header) is considered. All others first (the one closest to the DNS header) is considered. All others
are ignored. are ignored.
INTERNET-DRAFT DNS Cookies
5.2.1 No Opt RR or No COOKIE OPT option 5.2.1 No Opt RR or No COOKIE OPT option
If there is no OPT record or on COOKIE OPT option present in the If there is no OPT record or no COOKIE OPT option present in the
request then the server responds to the request as if the server request then the server responds to the request as if the server
doesn't understand the COOKIE OPT. doesn't implement the COOKIE OPT.
5.2.2 Malformed COOKIE OPT option 5.2.2 Malformed COOKIE OPT option
If the COOKIE OPT is too short to contain a Client Cookie then If the COOKIE OPT is too short to contain a Client Cookie then
FORMERR is generated. If the COOKIE OPT is longer than that required FORMERR is generated. If the COOKIE OPT is longer than that required
to hold a COOKIE OPT with just a Client Cookie (8) but is shorter to hold a COOKIE OPT with just a Client Cookie (8) but is shorter
that the minimum COOKIE OPT with both a Client and Server Cookie (16) that the minimum COOKIE OPT with both a Client and Server Cookie (16)
then FORMERR is generated. If the COOKIE OPT is longer than the then FORMERR is generated. If the COOKIE OPT is longer than the
maximum valid COOKIE OPT (40) then a FORMERR is generated. maximum valid COOKIE OPT (40) then a FORMERR is generated.
skipping to change at page 12, line 34 skipping to change at page 13, line 40
5.2.3 Only a Client Cookie 5.2.3 Only a Client Cookie
Based on server policy, including rate limiting, the server chooses Based on server policy, including rate limiting, the server chooses
one of the following: one of the following:
(1) Silently discard the request. (1) Silently discard the request.
(2) Send a BADCOOKIE error response. (2) Send a BADCOOKIE error response.
(3) Process the request and provide a normal response. The RCODE is (3) Process the request and provide a normal response. The RCODE is
zero unless some non-cookie error occurs in processing the NOERROR unless some non-cookie error occurs in processing the
request. request.
If the server responds, choosing 2 or 3 above, it SHALL generate its If the server responds, choosing 2 or 3 above, it SHALL generate its
own COOKIE OPT containing both the client cookie copied from the own COOKIE OPT containing both the Client Cookie copied from the
request and a server cookie it has generated and adds this COOKIE OPT request and a Server Cookie it has generated and adds this COOKIE OPT
to the response's OPT record. Servers MUST, at least occasionally, to the response's OPT record. Servers MUST, at least occasionally,
respond to such requests to inform the client of the correct server respond to such requests to inform the client of the correct Server
cookie. This is necessary so that such a client can bootstrap to the Cookie. This is necessary so that such a client can bootstrap to the
weakly secure state where requests and responses have recognized weakly secure state where requests and responses have recognized
server cookies and client cookies. If the request was received over Server Cookies and Client Cookies.
TCP, the server SHOULD take the weak authentication provided by the
use of TCP into account, increasing the probability of choice 3
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
If the request was received over TCP, the server SHOULD take the weak
authentication provided by the use of TCP into account and SHOULD
choose 3. In this case, if the server is not willing to accept the
weak security provided by TCP as a substitute for the weak security
provided by DNS Cookies but instead chooses 2, there is some danger
of an indefinite loop of retries (see Section 5.3).
5.2.4 A Client Cookie and Server Cookie 5.2.4 A Client Cookie and Server Cookie
The server examines the server cookie to determine if it is a valid The server examines the Server Cookie to determine if it is a valid
server cookie it has generated. This examination will result in a Server Cookie it has generated. This examination will result in a
determination of whether the server cookie is valid or not. These determination of whether the Server Cookie is valid or not. These
cases are discussed below. cases are discussed below.
5.2.4.1 A Client Cookie and Invalid Server Cookie 5.2.4.1 A Client Cookie and Invalid Server Cookie
This can occur due to a stale server Cookie being returned, a This can occur due to a stale Server Cookie being returned, a
client's IP address or client cookie changing without the DNS server client's IP address or Client Cookie changing without the DNS server
being aware, or an attempt to spoof the client. being aware, an anycast server cluster that is not consistently
configured, or an attempt to spoof the client.
The server SHALL process the query as if the invalid server cookie The server SHALL process the request as if the invalid Server Cookie
was not present as described in Section 5.2.3. was not present as described in Section 5.2.3.
5.2.4.2 A Client Cookie and Valid Server Cookie 5.2.4.2 A Client Cookie and Valid Server Cookie
When this occurs the server can assume that it is talking to a client When this occurs the server can assume that the request is from a
that it has talked to before and defensive measures for spoofed UDP client that it has talked to before and defensive measures for
queries, if any, are no longer required. spoofed UDP requests, if any, are no longer required.
The server SHALL process the query and include a COOKIE OPT in the The server SHALL process the request and include a COOKIE OPT in the
response by (a) copying the complete COOKIE OPT from the request or response by (a) copying the complete COOKIE OPT from the request or
(b) generating a new COOKIE OPT containing both the client cookie (b) generating a new COOKIE OPT containing both the Client Cookie
copied from the request and a valid server cookie it has generated. copied from the request and a valid Server Cookie it has generated.
5.3 Processing Responses 5.3 Processing Responses
The client cookie, when it occurs in a COOKIE OPT option in a DNS The Client Cookie, when it occurs in a COOKIE OPT option in a DNS
reply, is intended to weakly assure the client that the reply came reply, is intended to weakly assure the client that the reply came
from a server at the source IP address use in the response packet from a server at the source IP address used in the response packet
because the client cookie value is the value that client would send because the Client Cookie value is the value that client would send
to that server in a request. In a DNS reply with multiple COOKIE OPT to that server in a request. In a DNS reply with multiple COOKIE OPT
INTERNET-DRAFT DNS Cookies
options, all but the first (the one closest to the DNS Header) are options, all but the first (the one closest to the DNS Header) are
ignored. ignored.
A DNS client where DNS cookies are implemented and enabled examines A DNS client where DNS cookies are implemented and enabled examines
response for DNS cookies and MUST discard the response if it contains the response for DNS cookies and MUST discard the response if it
an illegal COOKIE OPT option length or an incorrect client cookie contains an illegal COOKIE OPT option length or an incorrect Client
value. If the COOKIE OPT option client cookie is correct, the client Cookie value. If the COOKIE OPT option Client Cookie is correct, the
caches the server cookie provided even if the response is an error client caches the Server Cookie provided even if the response is an
response (RCODE non-zero). error response (RCODE non-zero).
INTERNET-DRAFT DNS Cookies
If the reply extended RCDOE is BADCOOKIE, it means that the server
was unwilling to process the request because it did not have the
correct server cookie in it. The client should retry the request
using the new server cookie from the response.
If the reply extended RCODE is BADCOOKIE and the client cookie If the reply extended RCODE is BADCOOKIE and the Client Cookie
matches what was sent, it means that the server was unwilling to matches what was sent, it means that the server was unwilling to
process the request because it did not have the correct server cookie process the request because it did not have the correct Server Cookie
in it. The client SHOULD retry the request using the new server in it. The client SHOULD retry the request using the new Server
cookie from the response. Multiple BADCOOKIE responses may be an Cookie from the response. Repeated BADCOOKIE responses to requests
indication that the shared secrets / secret generation method in an that use the Server Cookie provided in the previous response may be
anycast cluster of servers are not consistent. If the reply to a an indication that the shared secrets / secret generation method in
retried query with a fresh server cookie is BADCOOKIE, the client an anycast cluster of servers are inconsistent. If the reply to a
SHOULD retry using TCP as the transport since the server will be more retried request with a fresh Server Cookie is BADCOOKIE, the client
likely to process the query normally based on the weak security SHOULD retry using TCP as the transport since the server will likely
provided by TCP. process the request normally based on the weak security provided by
TCP (see Section 5.2.3).
If the RCODE is some value other than BADCOOKIE, including zero, the If the RCODE is some value other than BADCOOKIE, including zero, the
further processing of the response proceedes normally. further processing of the response proceeds normally.
5.4 Client and Server Secret Rollover 5.4 QUERYing for a Server Cookie
Clients and servers MUST NOT continue to use the same secret in new In many cases a client will learn the Server Cookie for a server as
queries and responses, respectively, for more than 35 days and SHOULD the side effect of another transaction; however, there may be times
NOT continue to do so for more than 25 hours. Many clients rolling when this is not desirable. Therefore a means is provided for
over their secret at the same time could briefly increase server obtaining a Server Cookie through an extension to the QUERY opcode
traffic and exactly predictable rollover times for clients or servers for which opcode most existing implementations require that QDCOUNT
might facilitate guessing attacks. For example, an attacker might be one (see Section 4.1.2 of [RFC1035]).
increase the priority of attacking secrets they believe will be in
effect for an extended period of time. To avoid rollover
synchronization and predictability, it is RECOMMENDED that
pseudorandom jitter in the range of plus zero to minus at least 40%
be applied to the time until a scheduled rollover of a DNS cookie
secret.
It is RECOMMENDED that a client keep the client cookie it is For servers with DNS Cookies enabled, the QUERY opcode behavior is
expecting in a reply associated with the outstanding query to avoid extended to support queries with a empty question section (QDCOUNT
rejection of replies due to a bad client cookie right after a change zero) provided that an OPT record is present with a COOKIE option.
in the client secret. It is RECOMMENDED that a server retain its Such servers will reply with an empty answer section and a COOKIE
previous secret for a period of time not less than 1 second or more option giving the Client Cookie provided in the query and a valid
than 3 minutes, after a change in its secret, and consider queries Server Cookie.
with server cookies based on its previous secret to have a correct
server cookie during that time.
Receiving a sudden increased level of requests with bad server If such a query provided just a Client Cookie and no Server Cookie,
cookies or replies with bad client cookies would be reason to believe the response SHALL have the RCODE NOERROR.
a server or client is likely to be under attack and should consider
more frequent rollover of its secret. This mechanism can also be used to confirm/re-establish a existing
Server Cookie by sending a cached Server Cookie with the Client
Cookie. In this case the response SHALL have the RCODE BADCOOKIE if
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
5.5 Implementation Requirement the Server Cookie sent with the query was invalid and the RCODE
NOERROR if it was valid.
DNS clients and servers SHOULD implement DNS cookies to decrease Servers which don't support the COOKIE option will normally send
their vulnerability to the threats discussed in Section 2. FORMERR in response to such a query, though REFUSED and NOTIMP are
also possible in such responses.
5.5 Client and Server Secret Rollover
Clients and servers MUST NOT continue to use the same secret in new
requests and responses for more than 36 days and SHOULD NOT continue
to do so for more than 26 hours. Many clients rolling over their
secret at the same time could briefly increase server traffic and
exactly predictable rollover times for clients or servers might
facilitate guessing attacks. For example, an attacker might increase
the priority of attacking secrets they believe will be in effect for
an extended period of time. To avoid rollover synchronization and
predictability, it is RECOMMENDED that pseudorandom jitter in the
range of plus zero to minus at least 40% be applied to the time until
a scheduled rollover of a DNS cookie secret.
It is RECOMMENDED that a client keep the Client Cookie it is
expecting in a reply associated with the outstanding request to avoid
rejection of replies due to a bad Client Cookie right after a change
in the client secret. It is RECOMMENDED that a server retain its
previous secret for a period of time not less than 1 second or more
than 5 minutes, after a change in its secret, and consider requests
with Server Cookies based on its previous secret to have a correct
Server Cookie during that time.
When a server or client starts receiving an increased level of
requests with bad server cookies or replies with bad client cookies,
it would be reasonable for it to believe it is likely under attack
and it should consider a more frequent rollover of its secret.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
6. NAT Considerations and AnyCast Server Considerations 6. NAT Considerations and AnyCast Server Considerations
In the Classic Internet, DNS Cookies could simply be a pseudo-random In the Classic Internet, DNS Cookies could simply be a pseudo-random
function of the client IP address and a sever secret or the server IP function of the client IP address and a sever secret or the server IP
address and a client secret. You would want to compute the Server address and a client secret. You would want to compute the Server
Cookie that way, so a client could cache its Server Cookie for a Cookie that way, so a client could cache its Server Cookie for a
particular server for an indefinitely amount of time and the server particular server for an indefinitely amount of time and the server
skipping to change at page 16, line 45 skipping to change at page 17, line 45
multiple DNS requests and responses from multiple internal hosts to multiple DNS requests and responses from multiple internal hosts to
be mapped to a smaller number of external IP addresses, such as one be mapped to a smaller number of external IP addresses, such as one
address. Thus there could be many clients behind a NAT box that address. Thus there could be many clients behind a NAT box that
appear to come from the same source IP address to a server outside appear to come from the same source IP address to a server outside
that NAT box. If one of these were an attacker (think Zombie or that NAT box. If one of these were an attacker (think Zombie or
Botnet), that behind-NAT attacker could get the Server Cookie for Botnet), that behind-NAT attacker could get the Server Cookie for
some server for the outgoing IP address by just making some random some server for the outgoing IP address by just making some random
request to that server. It could then include that Server Cookie in request to that server. It could then include that Server Cookie in
the COOKIE OPT of requests to the server with the forged local IP the COOKIE OPT of requests to the server with the forged local IP
address of some other host and/or client behind the NAT box. address of some other host and/or client behind the NAT box.
(Attacker possession of this server cookie will not help in forging (Attacker possession of this Server Cookie will not help in forging
responses to cause cache poisoning as such responses are protected by responses to cause cache poisoning as such responses are protected by
the required Client Cookie.) the required Client Cookie.)
To fix this potential defect, it is necessary to distinguish To fix this potential defect, it is necessary to distinguish
different clients behind a NAT box from the point of view of the different clients behind a NAT box from the point of view of the
server. It is for this reason that the Server Cookie is specified as server. It is for this reason that the Server Cookie is specified as
a pseudo-random function of both the request source IP address and a pseudo-random function of both the request source IP address and
the Client Cookie. From this inclusion of the Client Cookie in the the Client Cookie. From this inclusion of the Client Cookie in the
calculation of the Server Cookie, it follows that a stable Client calculation of the Server Cookie, it follows that a stable Client
Cookie, for any particular server, is needed. If, for example, the Cookie, for any particular server, is needed. If, for example, the
skipping to change at page 17, line 16 skipping to change at page 18, line 16
would normally change with each request to a particular server. This would normally change with each request to a particular server. This
would mean that each request would have to be sent twice: first to would mean that each request would have to be sent twice: first to
learn the new Server Cookie based on this new Client Cookie based on learn the new Server Cookie based on this new Client Cookie based on
the new ID and then again using this new Client Cookie to actually the new ID and then again using this new Client Cookie to actually
get an answer. Thus the input to the Client Cookie computation must get an answer. Thus the input to the Client Cookie computation must
be limited to the server IP address and one or more things that be limited to the server IP address and one or more things that
change slowly such as the client secret. change slowly such as the client secret.
In principle, there could be a similar problem for servers, not due In principle, there could be a similar problem for servers, not due
to NAT but due to mechanisms like anycast which may cause queries to to NAT but due to mechanisms like anycast which may cause requests to
a DNS server at an IP address to be delivered to any one of several a DNS server at an IP address to be delivered to any one of several
machines. (External queries to a DNS server behind a NAT box usually machines. (External requests to a DNS server behind a NAT box usually
occur via port forwarding such that all such queries go to one host.) occur via port forwarding such that all such requests go to one
However, it is impossible to solve this the way the similar problem host.) However, it is impossible to solve this the way the similar
was solved for NATed clients; if the Server Cookie was included in problem was solved for NATed clients; if the Server Cookie was
the calculation of the Client Cookie the same way the Client Cookie included in the calculation of the Client Cookie the same way the
is included in the Server Cookie, you would just get an almost Client Cookie is included in the Server Cookie, you would just get an
infinite series of errors as a request was repeatedly retried. almost infinite series of errors as a request was repeatedly retried.
For servers accessed via anycast to successfully support DNS COOKIES, For servers accessed via anycast to successfully support DNS COOKIES,
the server clones must either all use the same server secret or the the server clones must either all use the same server secret or the
mechanism that distributes queries to them must cause the queries mechanism that distributes requests to them must cause the requests
from a particular client to go to a particular server for a from a particular client to go to a particular server for a
sufficiently long period of time that extra queries due to changes in sufficiently long period of time that extra requests due to changes
Server Cookie resulting from accessing different server machines are in Server Cookie resulting from accessing different server machines
not unduly burdensome. (When such anycast-accessed servers act as are not unduly burdensome. (When such anycast-accessed servers act
recursive servers or otherwise act as clients they normally use a as recursive servers or otherwise act as clients they normally use a
different unique address to source their queries to avoid confusion different unique address to source their requests to avoid confusion
in the delivery of responses.) in the delivery of responses.)
For simplicity, it is RECOMMENDED that the same server secret be used For simplicity, it is RECOMMENDED that the same server secret be used
by each DNS server in a set of anycast servers. If there is limited by each DNS server in a set of anycast servers. If there is limited
time skew in updating this secret in different anycast servers, this time skew in updating this secret in different anycast servers, this
can be handled by a server accepting requests containing a Server can be handled by a server accepting requests containing a Server
Cookie based on either its old or new secret for the maximum likely Cookie based on either its old or new secret for the maximum likely
time period of such time skew (see also Section 5.4). time period of such time skew (see also Section 5.5).
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
7. Deployment 7. Deployment
The DNS cookies mechanism is designed for incremental deployment and The DNS cookies mechanism is designed for incremental deployment and
to complement the orthogonal techniques in [RFC5452]. Either or both to complement the orthogonal techniques in [RFC5452]. Either or both
techniques can be deployed independently at each DNS server and techniques can be deployed independently at each DNS server and
client. client.
skipping to change at page 19, line 9 skipping to change at page 20, line 9
case it will not get the benefit of the mechanism and the server case it will not get the benefit of the mechanism and the server
involved might choose to severely rate limit responses. When such a involved might choose to severely rate limit responses. When such a
server or client interoperates with a client or server which also server or client interoperates with a client or server which also
implements the DNS cookies mechanism, they get the weak security implements the DNS cookies mechanism, they get the weak security
benefits of the DNS Cookies mechanism. benefits of the DNS Cookies mechanism.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
8. IANA Considerations 8. IANA Considerations
IANA is requested to assign the following two code points: IANA has assigned the following OPT option value:
A new OPT option value as shown below:
Value Name Status Reference Value Name Status Reference
-------- ------ -------- --------------- -------- ------ -------- ---------------
TBD1[10] COOKIE Standard [this document] 10 COOKIE Standard [this document]
A new DNS error code in the range above 16 and below 3,840 as IANA is requested to assign a new DNS error code in the range above
shown below: 16 and below 3,840 as follows:
RCODE Name Description Reference RCODE Name Description Reference
-------- --------- ------------------------- --------------- -------- --------- ------------------------- ---------------
TBD2[23] BADCOOKIE Bad/missing server cookie [this document] TBD[23] BADCOOKIE Bad/missing server cookie [this document]
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
9. Security Considerations 9. Security Considerations
DNS Cookies provide a weak form of authentication of DNS requests and DNS Cookies provide a weak form of authentication of DNS requests and
responses. In particular, they provide no protection against "on- responses. In particular, they provide no protection against "on-
path" adversaries; that is, they provide no protection against any path" adversaries; that is, they provide no protection against any
adversary that can observe the plain text DNS traffic, such as an on- adversary that can observe the plain text DNS traffic, such as an on-
path router, bridge, or any device on an on-path shared link (unless path router, bridge, or any device on an on-path shared link (unless
skipping to change at page 20, line 41 skipping to change at page 21, line 41
however, it may be useful to use DNS Cookies in conjunction with however, it may be useful to use DNS Cookies in conjunction with
these features. In particular, DNS Cookies could screen out many DNS these features. In particular, DNS Cookies could screen out many DNS
messages before the cryptographic computations of TSIG or SIG(0) are messages before the cryptographic computations of TSIG or SIG(0) are
required and, if SIG(0) is in use, DNS Cookies could usefully screen required and, if SIG(0) is in use, DNS Cookies could usefully screen
out many requests given that SIG(0) does not screen requests but only out many requests given that SIG(0) does not screen requests but only
authenticates the response of complete transactions. authenticates the response of complete transactions.
9.1 Cookie Algorithm Considerations 9.1 Cookie Algorithm Considerations
The cookie computation algorithm for use in DNS Cookies SHOULD be The cookie computation algorithm for use in DNS Cookies SHOULD be
based on a pseudo-random function at least as strong as [FNV] because based on a pseudo-random function at least as strong as FNV (Fowler-
an excessively weak or trivial algorithm could enable adversaries to Noll-Vo [FNV]) because an excessively weak or trivial algorithm could
guess cookies. However, in light of the weak plain-text token enable adversaries to guess cookies. However, in light of the weak
security provided by DNS Cookies, a strong cryptography hash plain-text token security provided by DNS Cookies, a strong
algorithm may not be warranted in many cases, and would cause an cryptography hash algorithm may not be warranted in many cases, and
increased computational burden. Nevertheless there is nothing wrong would cause an increased computational burden. Nevertheless there is
with using something stronger, for example, HMAC-SHA256-64 [RFC6234], nothing wrong with using something stronger, for example, HMAC-
assuming a DNS processor has adequate computational resources SHA256-64 [RFC6234], assuming a DNS processor has adequate
available. DNS processors that feel the need for somewhat stronger computational resources available. DNS processors that feel the need
security without a significant increase in computational load should for somewhat stronger security without a significant increase in
consider more frequent changes in their client and/or server secret; computational load should consider more frequent changes in their
however, this does require more frequent generation of a client and/or server secret; however, this does require more frequent
cryptographically strong random number [RFC4086]. See Appendices A generation of a cryptographically strong random number [RFC4086]. See
and B for specific examples of cookie computation algorithms. Appendices A and B for specific examples of cookie computation
INTERNET-DRAFT DNS Cookies
algorithms.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
10. Implementation Considerations 10. Implementation Considerations
The DNS Cookie Option specified herein is implemented in BIND 9.10 The DNS Cookie Option specified herein is implemented in BIND 9.10
using a experimental option code. using a experimental option code.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
Normative References Normative References
[RFC1035] - Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, DOI 10.17487/RFC1035,
November 1987, <http://www.rfc-editor.org/info/rfc1035>.
[RFC2119] - Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] - Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119,
March 1997, <http://www.rfc-editor.org/info/rfc2119>.
[RFC4086] - Eastlake 3rd, D., Schiller, J., and S. Crocker, [RFC4086] - Eastlake 3rd, D., Schiller, J., and S. Crocker,
"Randomness Requirements for Security", BCP 106, RFC 4086, June "Randomness Requirements for Security", BCP 106, RFC 4086, DOI
2005. 10.17487/RFC4086, June 2005, <http://www.rfc-
editor.org/info/rfc4086>.
[RFC6891] - Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms [RFC6891] - Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms
for DNS (EDNS(0))", STD 75, RFC 6891, April 2013. for DNS (EDNS(0))", STD 75, RFC 6891, DOI 10.17487/RFC6891,
April 2013, <http://www.rfc-editor.org/info/rfc6891>.
Informative References Informative References
[FNV] - G. Fowler, L. C. Noll, K.-P. Vo, D. Eastlake, "The FNV Non- [FNV] - G. Fowler, L. C. Noll, K.-P. Vo, D. Eastlake, "The FNV Non-
Cryptographic Hash Algorithm", draft-eastlake-fnv, work in Cryptographic Hash Algorithm", draft-eastlake-fnv, work in
progress. progress.
[RFC2845] - Vixie, P., Gudmundsson, O., Eastlake 3rd, D., and B. [RFC2845] - Vixie, P., Gudmundsson, O., Eastlake 3rd, D., and B.
Wellington, "Secret Key Transaction Authentication for DNS Wellington, "Secret Key Transaction Authentication for DNS
(TSIG)", RFC 2845, May 2000. (TSIG)", RFC 2845, DOI 10.17487/RFC2845, May 2000,
<http://www.rfc-editor.org/info/rfc2845>.
[RFC2930] - Eastlake 3rd, D., "Secret Key Establishment for DNS (TKEY [RFC2930] - Eastlake 3rd, D., "Secret Key Establishment for DNS (TKEY
RR)", RFC 2930, September 2000. RR)", RFC 2930, DOI 10.17487/RFC2930, September 2000,
<http://www.rfc-editor.org/info/rfc2930>.
[RFC2931] - Eastlake 3rd, D., "DNS Request and Transaction Signatures [RFC2931] - Eastlake 3rd, D., "DNS Request and Transaction Signatures
( SIG(0)s )", RFC 2931, September 2000. ( SIG(0)s )", RFC 2931, DOI 10.17487/RFC2931, September 2000,
<http://www.rfc-editor.org/info/rfc2931>.
[RFC3022] - Srisuresh, P. and K. Egevang, "Traditional IP Network [RFC3022] - Srisuresh, P. and K. Egevang, "Traditional IP Network
Address Translator (Traditional NAT)", RFC 3022, January 2001. Address Translator (Traditional NAT)", RFC 3022, DOI
10.17487/RFC3022, January 2001, <http://www.rfc-
editor.org/info/rfc3022>.
[RFC4033] - Arends, R., Austein, R., Larson, M., Massey, D., and S. [RFC4033] - Arends, R., Austein, R., Larson, M., Massey, D., and S.
Rose, "DNS Security Introduction and Requirements", RFC 4033, Rose, "DNS Security Introduction and Requirements", RFC 4033,
March 2005. DOI 10.17487/RFC4033, March 2005, <http://www.rfc-
editor.org/info/rfc4033>.
INTERNET-DRAFT DNS Cookies
[RFC4034] - Arends, R., Austein, R., Larson, M., Massey, D., and S. [RFC4034] - Arends, R., Austein, R., Larson, M., Massey, D., and S.
Rose, "Resource Records for the DNS Security Extensions", RFC Rose, "Resource Records for the DNS Security Extensions", RFC
4034, March 2005. 4034, DOI 10.17487/RFC4034, March 2005, <http://www.rfc-
editor.org/info/rfc4034>.
[RFC4035] - Arends, R., Austein, R., Larson, M., Massey, D., and S. [RFC4035] - Arends, R., Austein, R., Larson, M., Massey, D., and S.
Rose, "Protocol Modifications for the DNS Security Extensions", Rose, "Protocol Modifications for the DNS Security Extensions",
RFC 4035, March 2005. RFC 4035, DOI 10.17487/RFC4035, March 2005, <http://www.rfc-
editor.org/info/rfc4035>.
[RFC4966] - Aoun, C. and E. Davies, "Reasons to Move the Network [RFC4966] - Aoun, C. and E. Davies, "Reasons to Move the Network
Address Translator - Protocol Translator (NAT-PT) to Historic Address Translator - Protocol Translator (NAT-PT) to Historic
Status", RFC 4966, July 2007. Status", RFC 4966, DOI 10.17487/RFC4966, July 2007,
<http://www.rfc-editor.org/info/rfc4966>.
[RFC5452] - Hubert, A. and R. van Mook, "Measures for Making DNS More [RFC5452] - Hubert, A. and R. van Mook, "Measures for Making DNS More
Resilient against Forged Answers", RFC 5452, DOI
INTERNET-DRAFT DNS Cookies 10.17487/RFC5452, January 2009, <http://www.rfc-
editor.org/info/rfc5452>.
Resilient against Forged Answers", RFC 5452, January 2009.
[RFC6234] - Eastlake 3rd, D. and T. Hansen, "US Secure Hash [RFC6234] - Eastlake 3rd, D. and T. Hansen, "US Secure Hash
Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, May Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI
2011. 10.17487/RFC6234, May 2011, <http://www.rfc-
editor.org/info/rfc6234>.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
Acknowledgements Acknowledgements
The contributions of the following are gratefully acknowledged: The contributions of the following are gratefully acknowledged:
Tim Wicinski Gayle Noble, Tim Wicinski
The document was prepared in raw nroff. All macros used were defined The document was prepared in raw nroff. All macros used were defined
within the source file. within the source file.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
Appendix A: Example Client Cookie Algorithms Appendix A: Example Client Cookie Algorithms
A.1 A Simple Algorithm A.1 A Simple Algorithm
An simple example method to compute Client Cookies is the FNV-64 An simple example method to compute Client Cookies is the FNV-64
[FNV] of the server IP address and the client secret. That is [FNV] of the server IP address and the client secret. That is
Client Cookie = FNV-64 ( Client Secret | Server IP Address ) Client Cookie = FNV-64 ( Client Secret | Server IP Address )
where "|" indicates concatenation. where "|" indicates concatenation.
A.2 A More Complex Algorithm A.2 A More Complex Algorithm
A more complex algorithm to calculate Client Cookies is give below. A more complex algorithm to calculate Client Cookies is given below.
It uses more computational resources than the simpler algorithm shown It uses more computational resources than the simpler algorithm shown
in A.1. in A.1.
Client Cookie = HMAC-SHA256-64 ( Client Secret, Client Cookie = HMAC-SHA256-64 ( Client Secret,
Server IP Address ) Server IP Address )
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
Appendix B: Example Server Cookie Algorithms Appendix B: Example Server Cookie Algorithms
B.1 A Simple Algorithm B.1 A Simple Algorithm
An example simple method producing a 64-bit Server Cookie is the An example of a simple method producing a 64-bit Server Cookie is the
FNV-64 [FNV] of the request IP address, the Client Cookie, and the FNV-64 [FNV] of the request IP address, the Client Cookie, and the
server secret. That is server secret. That is
Server Cookie = Server Cookie =
FNV-64 ( Server Secret | Request IP Address | Client Cookie ) FNV-64 ( Server Secret | Request IP Address | Client Cookie )
where "|" represents concatenation. where "|" represents concatenation.
B.2 A More Complex Algorithm B.2 A More Complex Algorithm
Since the Server Cookie is variable size, the server can store Since the Server Cookie has a variable size, the server can store
various information in that field as long as it is hard for an various information in that field as long as it is hard for an
adversary to guess the entire quantity used for weak authentication. adversary to guess the entire quantity used for weak authentication.
There should be 64 bits of entropy in the Server Cookie; for example There should be 64 bits of entropy in the Server Cookie; for example
it could have a sub-field of 64-bits computed pseudo-randomly with it could have a sub-field of 64-bits computed pseudo-randomly with
the server secret as one of the inputs to the pseudo-random function. the server secret as one of the inputs to the pseudo-random function.
Types of additional information that could be stored include a time Types of additional information that could be stored include a time
stamp and/or a nonce. stamp and/or a nonce.
The example below is one variation for the Server Cookie that has The example below is one variation for the Server Cookie that has
been implemented in a beta release of BIND where the Server Cookie is been implemented in a beta release of BIND where the Server Cookie is
 End of changes. 91 change blocks. 
229 lines changed or deleted 292 lines changed or added

This html diff was produced by rfcdiff 1.42. The latest version is available from http://tools.ietf.org/tools/rfcdiff/