< draft-eastlake-dnsext-cookies-00.txt   draft-eastlake-dnsext-cookies-01.txt >
INTERNET-DRAFT Donald E. Eastlake 3rd INTERNET-DRAFT Donald E. Eastlake 3rd
Motorola Laboratories Motorola Laboratories
Expires: December 2006 June 2006 Expires: April 2007 October 2006
Domain Name System (DNS) Cookies Domain Name System (DNS) Cookies
------ ---- ------ ----- ------- ------ ---- ------ ----- -------
<draft-eastlake-dnsext-cookies-00.txt> <draft-eastlake-dnsext-cookies-01.txt>
Status of This Document Status of This Document
By submitting this Internet-Draft, each author represents that any By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79. aware will be disclosed, in accordance with Section 6 of BCP 79.
This draft is intended to be become a Proposed Standard RFC. This draft is intended to be become a Proposed Standard RFC.
Distribution of this document is unlimited. Comments should be sent Distribution of this document is unlimited. Comments should be sent
skipping to change at page 2, line 24 skipping to change at page 2, line 24
1. Introduction............................................3 1. Introduction............................................3
1.1 Contents of This Document..............................3 1.1 Contents of This Document..............................3
1.2 Definitions............................................3 1.2 Definitions............................................3
2. Threats Considered......................................4 2. Threats Considered......................................4
2.1 Denial-of-Service Attacks..............................4 2.1 Denial-of-Service Attacks..............................4
2.1.1 DNS Server Denial-of-Service.........................4 2.1.1 DNS Server Denial-of-Service.........................4
2.1.2 Selected Host Denial-of-Service......................5 2.1.2 Selected Host Denial-of-Service......................5
2.2 Cache Poisoning Attacks................................5 2.2 Cache Poisoning Attacks................................5
3. Comments on Existing DNS Security.......................5 3. Comments on Existing DNS Security.......................5
4. The COOKIE RR...........................................6 4. The COOKIE OPT option...................................6
4.1 Resolver Cookies.......................................7 4.1 Resolver Cookies.......................................7
4.2 Server Cookies.........................................7 4.2 Server Cookies.........................................8
5. General Policies and Implementation.....................8 5. General Policies and Implementation.....................8
5.1 Resolver Policies and Implementation...................8 5.1 Resolver Policies and Implementation...................9
5.2 Server Policies and Implementation.....................9 5.2 Server Policies and Implementation.....................9
5.3 Implementation Requirements...........................10 5.3 Implementation Requirements...........................10
6. NAT and AnyCast Considerations.........................10 6. NAT and AnyCast Considerations.........................10
7. IANA Considerations....................................12 7. IANA Considerations....................................12
8. Security Considerations................................12 8. Security Considerations................................12
9. Copyright and Disclaimer...............................13 9. Copyright and Disclaimer...............................13
10. Normative References..................................13 10. Normative References..................................13
11. Informative References................................13 11. Informative References................................14
Author's Address..........................................15 Author's Address..........................................15
Additional IPR Provisions.................................15 Additional IPR Provisions.................................15
Expiration and File Name..................................15 Expiration and File Name..................................15
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
1. Introduction 1. Introduction
The Domain Name System (DNS) provides a replicated distributed The Domain Name System (DNS) provides a replicated distributed
database which stores "resource records" (RRs) under hierarchical database which stores "resource records" (RRs) under hierarchical
domain names. DNS data is structured into CLASSes and zones which domain names. DNS data is structured into CLASSes and zones which
can be independently maintained. See [STD 13], [RFC 2181] can be independently maintained. See [STD13], [RFC2181] familiarity
familiarity with which is assumed. with which is assumed.
As with many core Internet protocols, DNS was designed at a time when As with many core Internet protocols, DNS was designed at a time when
the Internet had only a small pool of trusted users. As the Internet the Internet had only a small pool of trusted users. As the Internet
has exploded to a global information utility the DNS has increasingly has exploded to a global information utility the DNS has increasingly
been subject to abuse and been used as a vector for abuse. been subject to abuse and been used as a vector for abuse.
This document describes DNS cookies, a light-weight DNS transaction This document describes DNS cookies, a light-weight DNS transaction
security mechanism. They provides limited protection to DNS servers security mechanism specified as an OPT [RFC2671] option. They
and resolvers against a variety of increasingly common denial-of- provides limited protection to DNS servers and resolvers against a
service and cache poisoning attacks by off-path attackers. variety of increasingly common denial-of-service and cache poisoning
attacks by off-path attackers.
1.1 Contents of This Document 1.1 Contents of This Document
In Section 2, we discuss the threats against which DNS cookies In Section 2, we discuss the threats against which DNS cookies
provides some protection. provides some protection.
Section 3 describes existing DNS security mechanisms and why they are Section 3 describes existing DNS security mechanisms and why they are
not adequate subsitutes for DNS cookies. not adequate substitutes for DNS cookies.
Section 4 describes the COOKIE RR including how recommendations for Section 4 describes the COOKIE OPT option including recommendations
calculating Resolver and Server Cookies. for calculating Resolver and Server Cookies.
Section 5 describes the processing of COOKIE RRs by resolvers and Section 5 describes the processing of COOKIE OPT optionby resolvers
server and policies for such processing. and server and policies for such processing.
Section 6 discusses some NAT and anycast related DNS Cookies design Section 6 discusses some NAT and anycast related DNS Cookies design
considerations. considerations.
Sections 7 and 8 describe IANA and Security Considerations. Sections 7 and 8 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 RFC 2119. document are to be interpreted as described in [RFC2119].
An "off-path attacker", for a particular DNS resolver and server, is An "off-path attacker", for a particular DNS resolver and server, is
defined as an attacker which cannot observe the legitimate plain text defined as an attacker which cannot observe the legitimate plain text
DNS requests and responses between that resolver and server.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
DNS requests and responses between that resolver 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. For may be discarded when indicated by the policies of that host. For
example, it could be discarded after a period of time or when storage example, it could be discarded after a period of time or when storage
for caching such data becomes full. If operations requiring that soft for caching such data becomes full. If operations requiring that soft
state continue after it has been discarded, it will be automatically state continue after it has been discarded, it will be automatically
re-generated, albeit at some cost. 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 debugging consequences; however, it is RECOMMENDED that appropriate debugging
network management facilities be included in implementations, such as network management facilities be included in implementations, such as
skipping to change at page 4, line 31 skipping to change at page 4, line 33
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 denial-of-service and cache poisoning protection against certain denial-of-service and cache poisoning
attacks by off-path attackers described below. attacks by off-path attackers described below.
2.1 Denial-of-Service Attacks 2.1 Denial-of-Service Attacks
The normal form of the denial-of-service attacks considered herein is The normal form of the denial-of-service attacks considered herein is
to send DNS requests to the attacked server with forged source IP to send DNS requests with forged source IP addresses to a server. The
addresses. The intent can be to attack the server or a selected host intent can be to attack that server or a selected host as described
as described below. below.
2.1.1 DNS Server Denial-of-Service 2.1.1 DNS Server Denial-of-Service
DNS requests that are accepted cause work on the part of DNS servers. DNS requests that are accepted cause work on the part of DNS servers.
This is particularly true for recursive servers which may issue one This is particularly true for recursive servers which may issue one
or more requests and process the responses thereto in order to or more requests and process the responses thereto in order to
determine their response to the initial query. And the situation is determine their response to the initial query. And the situation is
even worse for recursive servers implementing DNSSEC [RFC 4033], [RFC even worse for recursive servers implementing DNSSEC [RFC4033],
4034], [RFC 4035] because they may be induced to perform burdensome [RFC4034], [RFC4035] because they may be induced to perform
public key cryptographic computations in attempts to verify the burdensome public key cryptographic computations in attempts to
authenticity of data they retrieve in trying to answer the request. verify the authenticity of data they retrieve in trying to answer the
request.
While the burden cause by such requests is not dependent on a forged While the burden cause by such requests is not dependent on a forged
IP source address, the use of such addresses makes IP source address, the use of such addresses makes
+ the source of the requests causing the denial-of-service requests
to be harder to find and
+ administrative restriction of the IP addresses from which such
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
+ the source of the requests causing the denial-of-service requests
to be harder to find and
+ administrative restriction of the IP addresses from which such
requests should be honored harder to enforce. requests should be honored harder to enforce.
2.1.2 Selected Host Denial-of-Service 2.1.2 Selected Host Denial-of-Service
Request with a forged IP address causes a response to be sent to that Request with a forged IP address causes a response to be sent to that
forged IP address. Thus the forging of many such requests can, forged IP address. Thus the forging of many such requests can,
indirectly, result in enough traffic being sent to the forged IP indirectly, result in enough traffic being sent to the forged IP
address to interfere with service to the host at the IP address. address to interfere with service to the host at the IP address.
Furthermore, it is generally easy in the DNS to create short requests Furthermore, it is generally easy in the DNS to create short requests
that produce much longer responses. Thus a DNS server can be used as that produce much longer responses. Thus a DNS server can be used as
not only a way to obscure the true source of an attack but as a not only a way to obscure the true source of an attack but as a
traffic amplifier to make the attack more effective. traffic amplifier to make the attack more effective.
Use of DNS cookies severely limits the traffic amplification that can Use of DNS cookies severely limits the traffic amplification that can
be obtained by attackers off path for the server and the attacked be obtained by attackers off path for the server and the attacked
host. Enforced DNS cookies would make it hard for an off path host. Enforced DNS cookies would make it hard for an off path
attacker to cause any more than a brief error response to be send to attacker to cause any more than a brief error response to be send to
a forged IP address. Furthermore, DNS cookies make it more effective a forged IP address. Furthermore, DNS cookies make it more effective
to implement a rate limiting scheme for bad DNS cookie error response to implement a rate limiting scheme for bad DNS cookie error response
from the server which would further restrict selected host denial-of- from the server. Such a scheme would further restrict selected host
service traffic from that server. denial-of-service traffic from that server.
2.2 Cache Poisoning Attacks 2.2 Cache Poisoning 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 heavily are such that, by forging replies from the IP addresses of heavily
used DNS servers and for popular names to a heavily used resolver, used DNS servers and for popular names to a heavily used resolver,
there can be an unacceptably high probability of randomly coming up there can be an unacceptably high probability of randomly coming up
with a reply that will be accepted and cause false DNS information to with a reply that will be accepted and cause false DNS information to
be cached by that resolver. This can be used to facilitate phishing be cached by that resolver. This can be used to facilitate phishing
attacks and other diversion of legitimate traffic to a compromised or attacks and other diversion of legitimate traffic to a compromised or
malicious host such as a web server. malicious host such as a web server.
3. Comments on Existing DNS Security 3. Comments on Existing DNS Security
Two forms of security have been added to DNS: Two forms of security have been added to DNS:
The first, called DNSSEC and described in [RFC 4033], [RFC 4034], The first, called DNSSEC and described in [RFC4033], [RFC4034], and
[RFC 4035], provides data origin authentication and authenticated [RFC4035], provides data origin authentication and authenticated
denial of existence. It is being deployed very slowly and, in any denial of existence. It is being deployed very slowly and, in any
INTERNET-DRAFT DNS Cookies
case, can make some denial-of-service attacks worse because of the case, can make some denial-of-service attacks worse because of the
high cryptographic computational load it can require and the high cryptographic computational load it can require and the
increased size in DNS packets that it can produces. increased size in DNS packets that it can produces.
INTERNET-DRAFT DNS Cookies
The second form of security which has been added to DNS provides The second form of security which has been added to DNS provides
"transaction" security through TSIG [RFC 2845] or SIG(0) [RFC 2931]. "transaction" security through TSIG [RFC2845] or SIG(0) [RFC2931].
TSIG could provide near perfect protection against the attacks for TSIG could provide near perfect protection against the attacks for
which DNS cookies provide weak and incomplete protection; however, which DNS cookies provide weak and incomplete protection; however,
TSIG is hard to deploy in the general Internet because of the burden TSIG is hard to deploy in the general Internet because of the burden
it imposes of pre-agreement and key distribution between pairs of it imposes of pre-agreement and key distribution between pairs of
resolvers and servers and because it requires time synchronization resolvers and servers and because it requires time synchronization
between resolver and server. between resolver and server.
TKEY [RFC 2930] can solve the problem of key distribution for TSIG TKEY [RFC2930] can solve the problem of key distribution for TSIG but
but some modes of TKEY impose substantial cryptographic computations some modes of TKEY impose substantial cryptographic computations
loads and can be dependent on the deployment of DNSSEC. loads and can be dependent on the deployment of DNSSEC.
SIG(0) provides less protection than TSIG or, in one way, even DNS SIG(0) provides less protection than TSIG or, in one way, even DNS
cookies, because it does not authentication requests, only complete cookies, because it does not authentication requests, only complete
transactions. In any case, it also depends on the deployment of transactions. In any case, it also depends on the deployment of
DNSSEC and requires computationally burdensome public key DNSSEC and requires computationally burdensome public key
cryptographic operations. cryptographic operations.
Thus, none of the previous forms of DNS security are a suitable Thus, none of the previous forms of DNS security are a suitable
substitute for DNS cookies, which provide light weight transaction substitute for DNS cookies, which provide light weight transaction
authentication of DNS requests and responses with no requirement for authentication of DNS requests and responses with no requirement for
pre-configuration. pre-configuration.
4. The COOKIE RR 4. The COOKIE OPT option
COOKIE is a meta-RR that can be included once in the Additional COOKIE is an OPT RR [RFC2671] option that can be included once in the
Information portion of DNS requests and responses. RDATA portion of an OPT RR in DNS requests and responses.
The RDATA portion of the COOKIE RR is 18 bytes long as shown below. The option is encoded into 22 bytes as shown below.
INTERNET-DRAFT DNS Cookies
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 TBD | OPTION-LENGTH = 18 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Resolver Cookie upper half | | Resolver Cookie upper half |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Resolver Cookie lower half | | Resolver Cookie lower half |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Server Cookie upper half | | Server Cookie upper half |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Server Cookie lower half | | Server Cookie lower half |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code | | Error Code |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The Resolver and Server Cookies are stored in network byte order and The Resolver and Server Cookies are stored in network byte order and
are determined as described below. are determined as described below.
INTERNET-DRAFT DNS Cookies
The Error Code field MUST BE zero in requests and in responses unless The Error Code field MUST BE zero in requests and in responses unless
the response is communicating a DNS cookie related error. Three the response is communicating a DNS cookie error. Three values are
values are possible for Error Code: NOCOOKIE and BADCOOKIE which possible for Error Code: NOCOOKIE and BADCOOKIE which occur with a
occur with a Refused RCODE in the DNS response header, and MANYCOOKIE Refused RCODE in the DNS response header, and MANYCOOKIE which occurs
which occurs with a FormErr RCODE in the DNS header. More information with a FormErr RCODE in the DNS header. More information on the
on the generation of error response appears in Section 5 below. generation of error response appears in Section 5 below.
4.1 Resolver Cookies 4.1 Resolver Cookies
The Resolver Cookie, when it occurs in a COOKIE RR in a DNS response, The Resolver Cookie, when it occurs in an OPT in a DNS response, is
is intended to weakly assure the resolver that the response came from intended to weakly assure the resolver that the response came from a
a server at the indicated source IP address. server at the indicated source IP address.
Servers remember the Resolver Cookie that appears in a query long Servers remember the Resolver Cookie that appears in a query long
enough to use it in the construction of the COOKIE RR in the enough to use it in the construction of the COOKIE OPT option in the
corresponding response if such a COOKIE RR is included in that corresponding response if such a COOKIE OPT option is included in
response. that response.
The Resolver Cookie SHOULD be a pseudo-random function of the server The Resolver Cookie SHOULD be a pseudo-random function of the server
IP address and a secret quantity known only to the resolver. This IP address and a secret quantity known only to the resolver. This
resolver secret SHOULD have 64 bits of entropy [RFC 4086] and MAY be resolver secret SHOULD have 64 bits of entropy [RFC4086] and MAY be
changed periodically. The RECOMMENDED method is the HMAC-MD5-64 [RFC changed periodically. The RECOMMENDED method is the HMAC-MD5-64
1321], [RFC 2104] of the server IP address and the resolver secret. [RFC1321], [RFC2104] of the server IP address and the resolver
That is secret. That is
Resolver Cookie = Resolver Cookie =
Truncate-64 ( HMAC-MD5 ( Server IP, Resolver Secret ) ) Truncate-64 ( HMAC-MD5 ( Server IP, Resolver Secret ) )
A resolver MUST NOT use the same Resolver Cookie value for queries to A resolver MUST NOT use the same Resolver Cookie value for queries to
INTERNET-DRAFT DNS Cookies
all servers. all servers.
4.2 Server Cookies 4.2 Server Cookies
The Server Cookie, when it occurs in a COOKIE RR in a query, is The Server Cookie, when it occurs in a COOKIE OPT option in a query,
intended to weakly assure the server that the query legitimately came is intended to weakly assure the server that the query legitimately
from a resolver at the indicated source IP address that is using the came from a resolver at the indicated source IP address that is using
indicated Resolver Cooker. the indicated Resolver Cookie.
Resolvers learn Server Cookies and retain them as soft state Resolvers learn Server Cookies and retain them as soft state
associated with the server IP address. They learn them from the associated with the server IP address. They learn them from the
Server Cookie that appears in the COOKIE RR of a reply that also has Server Cookie that appears in the COOKIE OPT option of a reply that
the correct Resolver Cookie, even if that reply is an error message. also has the correct Resolver Cookie, even if that reply is an error
message.
The Server Cookie SHOULD be a pseudo-random function of the request The Server Cookie SHOULD be a pseudo-random function of the request
source IP address, the request Resolver Cookie, and a secret quantity source IP address, the request Resolver Cookie, and a secret quantity
known only to the server. This server secret SHOULD have 64 bits of known only to the server. This server secret SHOULD have 64 bits of
entropy [RFC4086] and SHOULD be changed periodically such as daily.
INTERNET-DRAFT DNS Cookies The RECOMMENDED method is the HMAC-MD5-64 [RFC1321], [RFC2104] of the
request IP address, the Resolver Cookie, and the server secret. That
entropy [RFC 4086] and SHOULD be changed periodically such as daily. is
The RECOMMENDED method is the HMAC-MD5-64 [RFC 1321], [RFC 2104] of
the request IP address, the Resolver Cookie, and the server secret.
That is
Server Cookie = Truncate-64 ( Server Cookie = Truncate-64 (
HMAC-MD5 ( (Request IP | Resolver Cookie), Server Secret ) ) HMAC-MD5 ( (Request IP | Resolver Cookie), Server Secret ) )
where "|" represents concatenation. A server MUST NOT use the same where "|" represents concatenation.
Server Cookie value for responses to all requests.
A server MUST NOT use the same Server Cookie value for responses to
all requests.
5. General Policies and Implementation 5. General Policies and Implementation
DNS resolvers and servers will adopt one of three policies regarding DNS resolvers and servers will adopt one of various policies
cookies. These policies SHOULD be logically settable on a per server regarding cookies. These policies SHOULD be logically settable on a
IP address basis for resolvers and a per resolver IP address, per server IP address basis for resolvers and a per resolver ( IP
Resolver Cookie pair for servers. Thus a resolver can have different address, Resolver Cookie ) pair for servers. Thus a resolver can
policies for different servers, based on the server IP address. And a have different policies for different servers, based on the server IP
server can have different policies for different resolvers, based on address. And a server can have different policies for different
the resolver IP address and Resolver Cookie. Of course, the actual resolvers, based on the resolver IP address and Resolver Cookie. Of
implementation of setting these policies may by for blocks of values course, the actual implementation of setting these policies may by
or use sparse array techniques. for blocks or classes of values or use sparse array techniques.
The policy for each value is either "Disabled", "Enabled", or The policy for each value is either "Disabled", "Enabled", or
"Enforced" as described below. "Enforced" as described below.
INTERNET-DRAFT DNS Cookies
5.1 Resolver Policies and Implementation 5.1 Resolver Policies and Implementation
Disabled: Disabled:
Never include a COOKIE RR in requests. Never include a COOKIE RR in requests.
Ignore COOKIE RRs in the Additional Information section of Ignore COOKIE OPT options in responses.
responses.
Enabled: Enabled:
Always include a COOKIE RR in the Additional Information section Always include an OPT RR with a COOKIE option in requests. If a
of requests. If a cached Server Cookie for the server is not cached Server Cookie for the server is not available, the
available, the Server Cookie field can be set to any value. Server Cookie field can be set to any value.
Normally process responses without a COOKIE RR. Normally process responses without a COOKIE OPT option.
Silently ignore responses with more than one COOKIE RR. Silently ignore responses with more than one COOKIE OPT option.
Silently ignore responses with one COOKIE RR if that RR has an Silently ignore responses with one COOKIE OPT option if it has an
incorrect Resolver Cookie value. incorrect Resolver Cookie value.
On receipt of a response with one COOKIE RR and that RR having the On receipt of a response with one COOKIE OPT option and it having
correct Resolver Cookie value (even if it is a BADCOOKIE error the correct Resolver Cookie value (even if it is a BADCOOKIE
response), perform normal response processing, including error response), perform normal response processing, including
caching the received Server Cookie and MUST change to the caching the received Server Cookie and MUST change to the
Enforced policy for DNS requests to that server IP address. Enforced policy for DNS requests to that server IP address.
INTERNET-DRAFT DNS Cookies
This policy change SHOULD be treated as soft state with the This policy change SHOULD be treated as soft state with the
same discard policy as the Server Cookie value for that server. same discard policy as the Server Cookie value for that server.
On discarding that state information, the policy for that On discarding that state information, the policy for that
server reverts to Enabled. server reverts to Enabled.
Enforced: Enforced:
Always include a COOKIE RR in the Additional Information section Always include a COOKIE OPT option in requests.
of requests.
Silently ignore all responses that do not include exactly one Silently ignore all responses that do not include exactly one
COOKIE RR with that RR having the correct Resolver Cookie COOKIE OPT option with it having the correct Resolver Cookie
value. Normally process responses which do include such a value. Normally process responses which do include such a
COOKIE RR. COOKIE OPT option.
5.2 Server Policies and Implementation 5.2 Server Policies and Implementation
Disabled: Disabled:
Ignore COOKIE RRs in requests. Ignore COOKIE OPT options in requests.
Never include a COOKIE RR in responses. Never include a COOKIE OPT option in responses.
Enabled: Enabled:
Normally process requests without a COOKIE RR. Normally process requests without a COOKIE OPT option.
Ignore, other than sending a MANYCOOKIE error response, any Ignore, other than sending a MANYCOOKIE error response, any
request with more than one COOKIE RR. request with more than one COOKIE OPT option.
Ignore, other than sending a BADCOOKIE error response, any query Ignore, other than sending a BADCOOKIE error response, any query
with one COOKIE RR if that RR has an incorrect Server Cookie. with one COOKIE OPT option if it has an incorrect Server
On receipt of a request with a COOKIE RR having the correct Server Cookie.
Cookie value, perform normal request processing and SHOULD On receipt of a request with a COOKIE OPT option having the
adopt the Enforced policy for DNS requests from that resolver correct Server Cookie value, perform normal request processing
IP address with the Resolver Cookie in the request. This policy and SHOULD adopt the Enforced policy for DNS requests from that
change for that resolver SHOULD be treated as soft state. On resolver IP address with that Resolver Cookie in the request.
discarding that state information, the policy for that resolver
IP and Resolver Cookie pair reverts to enabled.
Always include a COOKIE RR in responses.
Enforced:
Ignore requests without a COOKIE RR or with more than one COOKIE
RR, other than sending a NOCOOKIE or MANYCOOKIE error message
respectively.
Ignore requests with one COOKIE RR if that RR has an incorrect
Server Cookie, other than sending a BADCOOKIE error message.
If a request has one COOKIE RR with a correct Server Cookie,
perform normal processing of the request.
Include a COOKIE RR in all responses.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
This policy change for that resolver SHOULD be treated as soft
state. On discarding that state information, the policy for
that resolver IP and Resolver Cookie pair reverts to enabled.
Always include a COOKIE OPT option in responses.
Enforced:
Ignore requests without a COOKIE OPT option or with more than one
COOKIE OPT option, other than sending a NOCOOKIE or MANYCOOKIE
error respectively.
Ignore requests with one COOKIE OPT option if they have an
incorrect Server Cookie, other than sending a BADCOOKIE error
message.
If a request has one COOKIE OPT option with a correct Server
Cookie, perform normal processing of the request.
Include a COOKIE OPT option in all responses.
5.3 Implementation Requirements 5.3 Implementation Requirements
DNS resolvers and servers MUST implement DNS cookies. DNS resolvers and servers MUST implement DNS cookies.
DNS resolvers SHOULD operate in and be shipped so as to default to DNS resolvers SHOULD operate in and be shipped so as to default to
the Enabled or Enforced mode for all servers. the Enabled or Enforced mode for all servers.
DNS servers SHOULD operate in and be shipped so as to default to the DNS servers SHOULD operate in and be shipped so as to default to the
Enabled or Enforced mode for all resolvers they are willing to Enabled or Enforced mode for all resolvers they are willing to
service. service.
skipping to change at page 10, line 28 skipping to change at page 10, line 44
6. NAT and AnyCast Considerations 6. NAT and AnyCast 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 resolver IP address and a sever secret or the server function of the resolver IP address and a sever secret or the server
IP address and a resolver secret. You would want to compute the IP address and a resolver secret. You would want to compute the
Server Cookie that way, so a resolver could cache its Server Cookie Server Cookie that way, so a resolver could cache its Server Cookie
for a particular server for an indefinitely amount of time and the for a particular server for an indefinitely amount of time and the
server could easily regenerate and check it. You could consider the server could easily regenerate and check it. You could consider the
Resolver Cookie to be a resolver signature over the server IP address Resolver Cookie to be a resolver signature over the server IP address
which the resolver checks in responses and you could extend this which the resolver checks in responses and you could extend this
signature to cover the ID for example. signature to cover the request ID, for example.
But we have this wart called NAT [RFC 3022], Network Address But we have this wart called NAT [RFC3022], Network Address
Translation (including therein for the purposes of this document NAT- Translation (including therein for the purposes of this document NAT-
PT [RFC 2766], Network Address and Protocol Translation). There is no PT [RFC2766], Network Address and Protocol Translation). There is no
problem with DNS transactions between resolvers and servers behind a problem with DNS transactions between resolvers and servers behind a
NAT box using local IP addresses. Nor is there a problem with NAT NAT box using local IP addresses. Nor is there a problem with NAT
translation of internal addresses to external addresses or translation of internal addresses to external addresses or
translations between IPv4 and IPv6 addresses, as long as the address translations between IPv4 and IPv6 addresses, as long as the address
INTERNET-DRAFT DNS Cookies
mapping is relatively stable. Should an internal resolver being mapping is relatively stable. Should an internal resolver being
mapped to a particular external IP address change occasionally, the mapped to a particular external IP address change occasionally, the
disruption is no more than when a resolver rolls-over its DNS COOKIE disruption is no more than when a resolver rolls-over its DNS COOKIE
secret. And normally external access to a DNS server behind a NAT box secret. And normally external access to a DNS server behind a NAT box
is handled by a fixed mapping which forwards externally received DNS is handled by a fixed mapping which forwards externally received DNS
requests to a specific host. requests to a specific host.
However, NAT devices sometimes also map ports. This can cause However, NAT devices sometimes also map ports. This can cause
multiple DNS requests and responses from multiple internal hosts to multiple DNS requests and responses from multiple internal hosts to
be simultaneously mapped to a smaller number of external IP be simultaneously mapped to a smaller number of external IP
addresses, frequently one. There could be many resolvers behind a addresses, frequently one. There could be many resolvers behind a
NAT box that appear to come from the same source IP address to a NAT box that appear to come from the same source IP address to a
server outside that NAT box.. If one of these were an attacker server outside that NAT box.. If one of these were an attacker
(think Zombie or Botnet), that behind-NAT attacked could get the (think Zombie or Botnet), that behind-NAT attacked could get the
Server Cookie for some server for the outgoing IP address by just Server Cookie for some server for the outgoing IP address by just
making some random request to that server. It could then include that making some random request to that server. It could then include that
Server Cookie in the COOKIE RR of requests to the server with the Server Cookie in the COOKIE RR of requests to the server with the
forged IP address of the local IP address of some other host and/or forged IP address of the local IP address of some other host and/or
INTERNET-DRAFT DNS Cookies
resolver behind the NAT box. (Attacker possession of this Server resolver behind the NAT box. (Attacker possession of this Server
Cookie will not help in forging responses to cause cache poisoning as Cookie will not help in forging responses to cause cache poisoning as
such responses are protected by the required Resolver Cookie.) such responses are protected by the required Resolver Cookie.)
To fix this potential defect, it is necessary to distinguish To fix this potential defect, it is necessary to distinguish
different resolvers behind a NAT box from the point of view of the different resolvers 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 Resolver Cookie. From this inclusion of the Resolver Cookie in the Resolver Cookie. From this inclusion of the Resolver Cookie in
the calculation of the Server Cookie, it follows that a stable the calculation of the Server Cookie, it follows that a stable
skipping to change at page 11, line 40 skipping to change at page 12, line 5
cause queries to a DNS server at an IP address to be delivered to any cause queries to a DNS server at an IP address to be delivered to any
one of several machines. (External queries to a DNS server behind a one of several machines. (External queries to a DNS server behind a
NAT box usually occur via port forwarding such that all such queries NAT box usually occur via port forwarding such that all such queries
go to one host.) However, it is impossible to solve this the way the go to one host.) However, it is impossible to solve this the way the
similar problem was solved for NATed resolvers; if the Server Cookie similar problem was solved for NATed resolvers; if the Server Cookie
was included in the calculation of the Resolver Cookie the same way was included in the calculation of the Resolver Cookie the same way
the Resolver Cookie is included in the Server Cookie, you would just the Resolver Cookie is included in the Server Cookie, you would just
get an almost infinite series of BADCOOKIE errors as a query was get an almost infinite series of BADCOOKIE errors as a query was
repeatedly retried. repeatedly retried.
INTERNET-DRAFT DNS Cookies
For server accessed via anycast or similar mechanisms to successfully For server accessed via anycast or similar mechanisms to successfully
support DNS COOKIES, the server clones must either all use the same support DNS COOKIES, the server clones must either all use the same
server secret or the mechanism that distributes queries to them must server secret or the mechanism that distributes queries to them must
cause the queries from a particular resolver to go to a particular cause the queries from a particular resolver to go to a particular
server for a sufficiently long period of time that extra queries due server for a sufficiently long period of time that extra queries due
to changes in Server Cookie resulting from accessing different server to changes in Server Cookie resulting from accessing different server
machines are not unduly burdensome. Such anycast accessed servers are machines are not unduly burdensome. When such anycast accessed
unlikely to be recursive servers or otherwise act as resolvers due to servers act as recursive servers or otherwise act as resolvers they
the confusion that would result in getting responses to their queries normally use a different unique address to source their queries and
back to the right machine. If they are they must all use the same avoid confusion in the delivery of responses.
resolver secret.
INTERNET-DRAFT DNS Cookies For simplicity, it is recommended that the same server secret be used
by each set of anycast servers.
7. IANA Considerations 7. IANA Considerations
The meta-RRTYPE value for COOKIE is (TBD, 248 (0xF8) suggested). The OPT option value for COOKIE is TBD.
Three new RCODES are assigned values above 15: Three new RCODES are assigned values above 15:
NOCOOKIE is assigned the value (TBD, 23 suggested). NOCOOKIE is assigned the value (TBD, 23 suggested).
BADCOOKIE is assigned the value (TBD, 24 suggested). BADCOOKIE is assigned the value (TBD, 24 suggested).
MANYCOOKIE is assigned the value (TBD, 25 suggested). MANYCOOKIE is assigned the value (TBD, 25 suggested).
8. Security Considerations 8. 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 at all against responses. In particular, they provide no protection at all against
"on-path" adversaries; that is, they provide no protection against "on-path" adversaries; that is, they provide no protection against
any adversary which can observe the plain text DNS traffic, such as any adversary which can observe the plain text DNS traffic, such as
an on-path router, bridge, or any device on an on-path shared link an on-path router, bridge, or any device on an on-path shared link
unless the DNS traffic in question on that link is appropriately (unless the DNS traffic in question on that path is appropriately
encrypted. encrypted).
For example, if a host is connected via an unsecured IEEE 802.11 link For example, if a host is connected via an unsecured IEEE 802.11 link
(Wi-Fi), any device in the vicinity that could receive and decode the (Wi-Fi), any device in the vicinity that could receive and decode the
802.11 transmissions must be considered "on-path". On the other hand, 802.11 transmissions must be considered "on-path". On the other hand,
in a similar situation but one where 802.11i security is in a similar situation but one where 802.11i security is
appropriately deployed, of the Wi-Fi network nodes, only the Access appropriately deployed on the Wi-Fi network nodes, only the Access
Point via which the host is connecting is "on-path". Point via which the host is connecting is "on-path".
Despite these limitations, use of DNS Cookies on the global Internet Despite these limitations, use of DNS Cookies on the global Internet
are expected to provide a significant reduction in the available are expected to provide a reduction in the available launch points
launch points for the traffic amplification and denial of service for the traffic amplification and denial of service attacks described
attacks described in Section 2 above. in Section 2 above.
The recommended cryptographic algorithm for use in DNS Cookies is The recommended cryptographic algorithm for use in DNS Cookies is
HMAC-MD5-64, that is, the HMAC scheme [RFC 2104] using the MD5 hash
function [RFC 1321] with its output truncated to 64-bits. Although INTERNET-DRAFT DNS Cookies
MD5 is now considered to be susceptible to collisions attacks, this
does not effect the security of HMAC-MD5. HMAC-MD5-64, that is, the HMAC scheme [RFC2104] using the MD5 hash
function [RFC1321] with its output truncated to 64-bits. Although MD5
is now considered to be susceptible to collisions attacks, this does
not effect the security of HMAC-MD5.
In light of the weak plain-text token security provided by DNS In light of the weak plain-text token security provided by DNS
Cookies, stronger cryptography is probably not warranted. However, Cookies, stronger cryptography is probably not warranted. However,
there is nothing wrong with using, for example, HMAC-SHA256-64 there is nothing wrong with using, for example, HMAC-SHA256-64
instead, assuming a DNS processor has adequate computational instead, assuming a DNS processor has adequate computational
resources available. DNS processors that feel the need for somewhat resources available. DNS processors that feel the need for somewhat
stronger security without a significant increase in computational stronger security without a significant increase in computational
load should consider more frequent changes in their resolver and/or load should consider more frequent changes in their resolver and/or
server secret; however, this does require more frequent generation of server secret; however, this does require more frequent generation of
a cryptographically strong random number [RFC 4086] and a change in a a cryptographically strong random number [RFC4086] and a change in a
server secret will result in a number of BADCOOKIE rejected requests server secret will result in a number of BADCOOKIE rejected requests
from resolvers caching their old Server Cookie. from resolvers caching their old Server Cookie.
INTERNET-DRAFT DNS Cookies
9. Copyright and Disclaimer 9. Copyright and Disclaimer
Copyright (C) The Internet Society (2006). Copyright (C) The Internet Society (2006).
This document is subject to the rights, licenses and restrictions This document is subject to the rights, licenses and restrictions
contained in BCP 78, and except as set forth therein, the authors contained in BCP 78, and except as set forth therein, the authors
retain all their rights. retain all their rights.
This document and the information contained herein are provided on an This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
10. Normative References 10. Normative References
[RFC 1321] - Rivest, R., "The MD5 Message-Digest Algorithm", RFC [RFC1321] - Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321,
1321, April 1992. April 1992.
[RFC 2104] - Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- [RFC2104] - Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-
Hashing for Message Authentication", RFC 2104, February 1997. Hashing for Message Authentication", RFC 2104, February 1997.
[RFC 2119] - 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, March 1997.
[RFC 2181] - Elz, R. and R. Bush, "Clarifications to the DNS [RFC2181] - Elz, R. and R. Bush, "Clarifications to the DNS
INTERNET-DRAFT DNS Cookies
Specification", RFC 2181, July 1997. Specification", RFC 2181, July 1997.
[RFC 4086] - Eastlake, D., 3rd, Schiller, J., and S. Crocker, [RFC2671] - Vixie, P., "Extension Mechanisms for DNS (EDNS0)", August
1999.
[RFC4086] - Eastlake, D., 3rd, Schiller, J., and S. Crocker,
"Randomness Requirements for Security", BCP 106, RFC 4086, June 2005. "Randomness Requirements for Security", BCP 106, RFC 4086, June 2005.
[STD 13] [STD13]
Mockapetris, P., "Domain names - concepts and facilities", STD Mockapetris, P., "Domain names - concepts and facilities", STD
13, RFC 1034, November 1987. 13, RFC 1034, November 1987.
Mockapetris, P., "Domain names - implementation and Mockapetris, P., "Domain names - implementation and
specification", STD 13, RFC 1035, November 1987. specification", STD 13, RFC 1035, November 1987.
11. Informative References. 11. Informative References.
[RFC 2845] - Vixie, P., Gudmundsson, O., Eastlake 3rd, D., and B. [RFC2766] - Tsirtsis, G., P. Srisuresh"Network Address Translation -
Protocol Translation (NAT-PT)", February 2000.
[RFC2845] - Vixie, P., Gudmundsson, O., Eastlake 3rd, D., and B.
Wellington, "Secret Key Transaction Authentication for DNS (TSIG)", Wellington, "Secret Key Transaction Authentication for DNS (TSIG)",
RFC 2845, May 2000. RFC 2845, May 2000.
INTERNET-DRAFT DNS Cookies [RFC2930] - Eastlake 3rd, D., "Secret Key Establishment for DNS (TKEY
RR)", RFC 2930, September 2000.
[RFC 2930] - Eastlake 3rd, D., "Secret Key Establishment for DNS
(TKEY RR)", RFC 2930, September 2000.
[RFC 2931] - Eastlake 3rd, D., "DNS Request and Transaction [RFC2931] - Eastlake 3rd, D., "DNS Request and Transaction Signatures
Signatures ( SIG(0)s )", RFC 2931, September 2000. ( SIG(0)s )", RFC 2931, September 2000.
[RFC 3022] - 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, January 2001.
[RFC 4033] - 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, March Rose, "DNS Security Introduction and Requirements", RFC 4033, March
2005. 2005.
[RFC 4034] - 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 4034, Rose, "Resource Records for the DNS Security Extensions", RFC 4034,
March 2005. March 2005.
[RFC 4035] - 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", RFC Rose, "Protocol Modifications for the DNS Security Extensions", RFC
4035, March 2005. 4035, March 2005.
INTERNET-DRAFT DNS Cookies INTERNET-DRAFT DNS Cookies
Author's Address Author's Address
Donald E. Eastlake 3rd Donald E. Eastlake 3rd
Motorola Laboratories Motorola Laboratories
155 Beaver Street 111 Locke Drive
Milford, MA 01757 USA Marlborough, MA 01752 USA
Telephone: +1-508-786-7554 (w) Telephone: +1-508-786-7554 (w)
EMail: Donald.Eastlake@motorola.com EMail: Donald.Eastlake@motorola.com
Additional IPR Provisions Additional IPR Provisions
The IETF takes no position regarding the validity or scope of any The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed Intellectual Property Rights or other rights that might be claimed
to pertain to the implementation or use of the technology to pertain to the implementation or use of the technology
skipping to change at page 15, line 44 skipping to change at page 15, line 44
at http://www.ietf.org/ipr. at http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention The IETF invites any interested party to bring to its attention
any copyrights, patents or patent applications, or other any copyrights, patents or patent applications, or other
proprietary rights that may cover technology that may be required proprietary rights that may cover technology that may be required
to implement this standard. Please address the information to the to implement this standard. Please address the information to the
IETF at ietf-ipr@ietf.org. IETF at ietf-ipr@ietf.org.
Expiration and File Name Expiration and File Name
This draft expires in December 2006. This draft expires in April 2007.
Its file name is draft-eastlake-dnsext-cookies-00.txt Its file name is draft-eastlake-dnsext-cookies-01.txt
 End of changes. 83 change blocks. 
170 lines changed or deleted 189 lines changed or added

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