idnits 2.17.1 draft-ietf-dnsop-nsec-aggressiveuse-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year (Using the creation date from RFC4035, updated by this document, for RFC5378 checks: 2002-10-29) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 02, 2016) is 2823 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Historic RFC: RFC 5074 ** Obsolete normative reference: RFC 7719 (Obsoleted by RFC 8499) == Outdated reference: A later version (-05) exists of draft-ietf-dnsop-nxdomain-cut-03 Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group K. Fujiwara 3 Internet-Draft JPRS 4 Updates: 4035 (if approved) A. Kato 5 Intended status: Standards Track Keio/WIDE 6 Expires: February 3, 2017 W. Kumari 7 Google 8 August 02, 2016 10 Aggressive use of NSEC/NSEC3 11 draft-ietf-dnsop-nsec-aggressiveuse-01 13 Abstract 15 The DNS relies upon caching to scale; however, the cache lookup 16 generally requires an exact match. This document specifies the use 17 of NSEC/NSEC3 resource records to generate negative answers within a 18 range. This increases resilience to DoS attacks, increases 19 performance / decreases latency, decreases resource utilization on 20 both authoritative and recursive servers, and also increases privacy. 22 This document updates RFC4035 by allowing resolvers to generate 23 negative answers based upon NSEC/NSEC3 records. 25 [ Ed note: Text inside square brackets ([]) is additional background 26 information, answers to frequently asked questions, general musings, 27 etc. They will be removed before publication.This document is being 28 collaborated on in Github at: https://github.com/wkumari/draft-ietf- 29 dnsop-nsec-aggressiveuse. The most recent version of the document, 30 open issues, etc should all be available here. The authors 31 (gratefully) accept pull requests. 33 Known / open issues [To be moved to Github issue tracker]: 35 1. We say things like: "Currently the DNS does ..." - this will not 36 be true after this is deployed, but I'm having a hard time 37 rewording this. "Without the techniques described in this 38 document..." seems klunky. Perhaps "historically?!" 40 ] 42 Status of This Memo 44 This Internet-Draft is submitted in full conformance with the 45 provisions of BCP 78 and BCP 79. 47 Internet-Drafts are working documents of the Internet Engineering 48 Task Force (IETF). Note that other groups may also distribute 49 working documents as Internet-Drafts. The list of current Internet- 50 Drafts is at http://datatracker.ietf.org/drafts/current/. 52 Internet-Drafts are draft documents valid for a maximum of six months 53 and may be updated, replaced, or obsoleted by other documents at any 54 time. It is inappropriate to use Internet-Drafts as reference 55 material or to cite them other than as "work in progress." 57 This Internet-Draft will expire on February 3, 2017. 59 Copyright Notice 61 Copyright (c) 2016 IETF Trust and the persons identified as the 62 document authors. All rights reserved. 64 This document is subject to BCP 78 and the IETF Trust's Legal 65 Provisions Relating to IETF Documents 66 (http://trustee.ietf.org/license-info) in effect on the date of 67 publication of this document. Please review these documents 68 carefully, as they describe your rights and restrictions with respect 69 to this document. Code Components extracted from this document must 70 include Simplified BSD License text as described in Section 4.e of 71 the Trust Legal Provisions and are provided without warranty as 72 described in the Simplified BSD License. 74 Table of Contents 76 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 77 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 78 3. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 3 79 4. Background . . . . . . . . . . . . . . . . . . . . . . . . . 4 80 5. Proposed Solution . . . . . . . . . . . . . . . . . . . . . . 5 81 5.1. Aggressive Negative Caching . . . . . . . . . . . . . . . 5 82 5.2. NSEC . . . . . . . . . . . . . . . . . . . . . . . . . . 5 83 5.3. NSEC3 . . . . . . . . . . . . . . . . . . . . . . . . . . 6 84 5.4. Wildcard . . . . . . . . . . . . . . . . . . . . . . . . 6 85 5.5. Consideration on TTL . . . . . . . . . . . . . . . . . . 7 86 6. Update to RFC 4035 . . . . . . . . . . . . . . . . . . . . . 7 87 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 88 8. Security Considerations . . . . . . . . . . . . . . . . . . . 7 89 9. Implementation Status . . . . . . . . . . . . . . . . . . . . 8 90 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 8 91 11. Change History . . . . . . . . . . . . . . . . . . . . . . . 8 92 11.1. Version draft-fujiwara-dnsop-nsec-aggressiveuse-01 . . . 9 93 11.2. Version draft-fujiwara-dnsop-nsec-aggressiveuse-02 . . . 9 94 11.3. Version draft-fujiwara-dnsop-nsec-aggressiveuse-03 . . . 9 95 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 96 12.1. Normative References . . . . . . . . . . . . . . . . . . 10 97 12.2. Informative References . . . . . . . . . . . . . . . . . 10 98 Appendix A. Detailed implementation idea . . . . . . . . . . . . 11 99 Appendix B. Side effect: mitigation of random subdomain attacks 11 100 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 102 1. Introduction 104 A DNS negative cache currently exists, and is used to cache the fact 105 that a name does not exist. This method of negative caching requires 106 exact matching; this leads to unnecessary additional lookups, which 107 have negative implications for DoS survivability, increases latency, 108 leads to extra resource utilization on both authoritative and 109 recursive servers, and decreases privacy by leaking queries. 111 This document updates RFC 4035 to allow recursive resolvers to use 112 NSEC/NSEC3 resource records to aggressively cache negative answers. 113 This would allow such resolvers to respond with NXDOMAIN immediately 114 if the name in question falls into a range expressed by a NSEC/NSEC3 115 resource record already in the cache. 117 Aggressive Negative Caching was first proposed in Section 6 of DNSSEC 118 Lookaside Validation (DLV) [RFC5074] in order to find covering NSEC 119 records efficiently. 121 Section 3 of [I-D.vixie-dnsext-resimprove] "Stopping Downward Cache 122 Search on NXDOMAIN" and [I-D.ietf-dnsop-nxdomain-cut] proposed 123 another approach to use NXDOMAIN information effectively. 125 2. Terminology 127 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 128 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 129 document are to be interpreted as described in RFC 2119 [RFC2119]. 131 Many of the specialized terms used in this document are defined in 132 DNS Terminology [RFC7719]. 134 The key words "Closest Encloser" and "Source of Synthesis" in this 135 document are to be interpreted as described in[RFC4592]. 137 "Closest Encloser" is also defined in NSEC3 [RFC5155], as is "Next 138 closer name". 140 3. Problem Statement 142 The current DNS negative cache caches negative (non-existent) 143 information, and requires an exact match in most instances [RFC2308]. 145 Assume that the (DNSSEC signed) "example.com" zone contains: 147 apple.example.com IN A 192.0.2.1 149 elephant.example.com IN A 192.0.2.2 151 zebra.example.com IN A 192.0.2.3 153 If a recursive resolver gets a query for cat.example.com, it will 154 query the example.com authoritative servers and will get back an NSEC 155 (or NSEC3) record starting that there are no records between apple 156 and elephant. The recursive resolver then knows that cat.example.com 157 does not exist; however, it (currently) does not use the fact that 158 the proof covers a range (apple to elephant) to suppress queries for 159 other labels that fall within this range. This means that if the 160 recursive resolvers gets a query for ball.example.com (or 161 dog.example.com) it will once again go off and query the example.com 162 servers for these names. 164 Apart from wasting bandwidth, this also wastes resources on the 165 recursive server (it needs to keep state for outstanding queries), 166 wastes resources on the authoritative server (it has to answer 167 additional questions), increases latency (the end user has to wait 168 longer than necessary to get back an NXDOMAIN answer), can be used by 169 attackers to cause a DoS (see additional resources), and also has 170 privacy implications (e.g: typos leak out further than necessary). 172 4. Background 174 DNSSEC [RFC4035] and [RFC5155] both provide "authenticated denial of 175 existence"; this is a cryptographic proof that the queried for name 176 does not exist, accomplished by providing a (DNSSEC secured) record 177 containing the names which appear alphabetically before and after the 178 queried for name. In the example above, if the (DNSSEC validating) 179 recursive server were to query for lion.example.com it would receive 180 a (signed) NSEC/NSEC3 record stating that there are no labels between 181 "elephant" and "zebra". This is a signed, cryptographic proof that 182 these names are the ones before and after the queried for label. As 183 lion.example.com falls within this range, the recursive server knows 184 that lion.example.com really does not exist. This document specifies 185 that this NSEC/NSEC3 record should be used to generate negative 186 answers for any queries that the recursive server receives that fall 187 within the range covered by the record (for the TTL for the record). 189 [RFC4035]; Section 4.5 states: 191 For a zone signed with NSEC, it would be possible to use the 192 information carried in NSEC resource records to indicate the non- 193 existence of a range of names. However, such use is discouraged by 194 Section 4.5 of RFC4035. It is recommended that readers read RFC4035 195 in its entirety for a better understanding. At the root of the 196 concern is that new records could have been added to the zone during 197 the TTL of the NSEC record, and that generating negative responses 198 from the NSEC record would hide these. We believe this 199 recommendation can be relaxed because lookups for the specific name 200 could have come in during the normal negative cache time and so 201 operators should have no expectation that an added name would work 202 immediately. We think that the TTL of the NSEC record is the 203 authoritative statement of how quickly a name can start working 204 within a zone. 206 5. Proposed Solution 208 5.1. Aggressive Negative Caching 210 Section 4.5 of [RFC4035] shows that "In theory, a resolver could use 211 wildcards or NSEC RRs to generate positive and negative responses 212 (respectively) until the TTL or signatures on the records in question 213 expire. However, it seems prudent for resolvers to avoid blocking 214 new authoritative data or synthesizing new data on their own. 215 Resolvers that follow this recommendation will have a more consistent 216 view of the namespace". 218 This document relaxes this this restriction, as follows: 220 +--------------------------------------------------------------+ 221 | Once the records are validated, DNSSEC enabled full-service | 222 | resolvers MAY use NSEC/NSEC3 resource records to generate | 223 | negative responses until their effective TTLs or signatures | 224 | for those records expire. | 225 +--------------------------------------------------------------+ 227 If the full-service resolver's cache has sufficient information to 228 validate the query, the full-service resolver MAY use NSEC/NSEC3/ 229 wildcard records aggressively. Otherwise, the full-service resolver 230 MUST fall back to send the query to the authoritative DNS servers. 232 If the query name has the matching NSEC/NSEC3 RR proving the 233 information requested does not exist, the full-service resolver may 234 respond with a NODATA (empty) answer. 236 5.2. NSEC 238 If a full-service resolver implementation supports aggressive 239 negative caching, then it SHOULD support aggressive use of NSEC and 240 enable it by default. It SHOULD provide a configuration switch to 241 disable aggressive use of NSEC and allow it to be enabled or disabled 242 for specific zones. 244 The validating resolver needs to check the existence of an NSEC RR 245 matching/covering the source of synthesis and an NSEC RR covering the 246 query name. 248 If the full-service resolver's cache contains an NSEC RR covering the 249 source of synthesis and the covering NSEC RR of the query name, the 250 full-service resolver may respond with NXDOMAIN error immediately. 252 5.3. NSEC3 254 NSEC3 aggressive negative caching is more difficult. If the zone is 255 signed with NSEC3, the validating resolver needs to check the 256 existence of non-terminals and wildcards which derive from query 257 names. 259 If the full-service resolver's cache contains an NSEC3 RR matching 260 the closest encloser, an NSEC3 RR covering the next closer name, and 261 an NSEC3 RR covering the source of synthesis, it is possible for the 262 full-service resolver to respond with NXDOMAIN immediately. 264 If a covering NSEC3 RR has Opt-Out flag, the covering NSEC3 RR does 265 not prove the non-existence of the domain name and the aggressive 266 negative caching is not possible for the domain name. 268 A full-service resolver implementation MAY support aggressive use of 269 NSEC3. If it does aggressive use of NSEC3, it SHOULD provide a 270 configuration switch to disable aggressive use of NSEC3 and allow it 271 to be enabled or disabled for specific zones. 273 5.4. Wildcard 275 The last paragraph of RFC 4035 Section 4.5 discusses aggressive use 276 of a cached deduced wildcard (as well as aggressive use of NSEC) and 277 recommends that it is not relied upon. 279 Just like the case for the aggressive use of NSEC discussed in this 280 draft, we revise this recommendation. As long as the full-service 281 resolver knows a name would not exist without the wildcard match, it 282 can answer a query for that name using the cached deduced wildcard, 283 and it may be justified for performance and other benefits. (Note 284 that, so far, this is orthogonal to "when aggressive use (of NSEC) is 285 enabled"). 287 Furthermore, when aggressive use of NSEC is enabled, the aggressive 288 use of cached deduced wildcard will be more effective. 290 A full-service resolver implementation MAY support aggressive use of 291 wildcards. It SHOULD provide a configuration switch to disable 292 aggressive use of wildcards. 294 5.5. Consideration on TTL 296 The TTL value of negative information is especially important, 297 because newly added domain names cannot be used while the negative 298 information is effective. Section 5 of RFC 2308 states that the 299 maximum number of negative cache TTL value is 3 hours (10800). It is 300 RECOMMENDED that full-service resolvers limit the maximum effective 301 TTL value of negative responses (NSEC/NSEC3 RRs) to this same value. 303 6. Update to RFC 4035 305 Section 4.5 of [RFC4035] shows that "In theory, a resolver could use 306 wildcards or NSEC RRs to generate positive and negative responses 307 (respectively) until the TTL or signatures on the records in question 308 expire. However, it seems prudent for resolvers to avoid blocking 309 new authoritative data or synthesizing new data on their own. 310 Resolvers that follow this recommendation will have a more consistent 311 view of the namespace". 313 (If approved, ) The paragraph is updated as follows: 315 +--------------------------------------------------------------+ 316 | Once the records are validated, DNSSEC enabled full-service | 317 | resolvers MAY use wildcards and NSEC/NSEC3 resource records | 318 | to generate (positive and) negative responses until their | 319 | effective TTLs or signatures for those records expire. | 320 +--------------------------------------------------------------+ 322 7. IANA Considerations 324 This document has no IANA actions. 326 8. Security Considerations 328 Newly registered resource records may not be used immediately. 329 However, choosing suitable TTL value and negative cache TTL value 330 (SOA MINIMUM field) will mitigate the delay concern, and it is not a 331 security problem. 333 It is also suggested to limit the maximum TTL value of NSEC / NSEC3 334 resource records in the negative cache to, for example, 10800 seconds 335 (3hrs), to mitigate this issue. Implementations which comply with 336 this proposal are recommended to have a configurable maximum value of 337 NSEC RRs in the negative cache. 339 Aggressive use of NSEC / NSEC3 resource records without DNSSEC 340 validation may cause security problems. It is highly recommended to 341 apply DNSSEC validation. 343 9. Implementation Status 345 Unbound has aggressive negative caching code in its DLV validator. 346 The author implemented NSEC aggressive caching using Unbound and its 347 DLV validator code. 349 10. Acknowledgments 351 The authors gratefully acknowledge DLV [RFC5074] author Samuel Weiler 352 and Unbound developers. Valuable comments were provided by Alexander 353 Dupuy, Olafur Gudmundsson, Pieter Lexis, Bob Harold, Tatuya JINMEI, 354 Shumon Huque, Mark Andrews, Casey Deccio, Bob Harold, Stephane 355 Bortzmeyer and Matthijs Mekking. 357 11. Change History 359 RFC Editor: Please remove this section prior to publication. 361 -00 to -01: 363 o Comments from DNSOP meeting in Berlin. 365 o Changed intended status to Standards Track (updates RFC 4035) 367 o Added a section "Updates to RFC 4035" 369 o Some language clarification / typo / cleanup 371 o Cleaned up the TTL section a bit. 373 o Removed Effects section, Additional proposal section, and pseudo 374 code. 376 o Moved "mitigaton of random subdomain attacks" to Appendix. 378 From draft-fujiwara-dnsop-nsec-aggressiveuse-03 -> draft-ietf-dnsop- 379 nsec-aggressiveuse 381 o Document adopted by DNSOP WG. 383 o Adoption comments 385 o Changed main purpose to performance 386 o Use NSEC3/Wildcard keywords 388 o Improved wordings (from good comments) 390 o Simplified pseudo code for NSEC3 392 o Added Warren as co-author. 394 o Reworded much of the problem statement 396 o Reworked examples to better explain the problem / solution. 398 11.1. Version draft-fujiwara-dnsop-nsec-aggressiveuse-01 400 o Added reference to DLV [RFC5074] and imported some sentences. 402 o Added Aggressive Negative Caching Flag idea. 404 o Added detailed algorithms. 406 11.2. Version draft-fujiwara-dnsop-nsec-aggressiveuse-02 408 o Added reference to [I-D.vixie-dnsext-resimprove] 410 o Added considerations for the CD bit 412 o Updated detailed algorithms. 414 o Moved Aggressive Negative Caching Flag idea into Additional 415 Proposals 417 11.3. Version draft-fujiwara-dnsop-nsec-aggressiveuse-03 419 o Added "Partial implementation" 421 o Section 4,5,6 reorganized for better representation 423 o Added NODATA answer in Section 4 425 o Trivial updates 427 o Updated pseudo code 429 12. References 430 12.1. Normative References 432 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 433 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 434 RFC2119, March 1997, 435 . 437 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 438 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998, 439 . 441 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 442 Rose, "Protocol Modifications for the DNS Security 443 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 444 . 446 [RFC4592] Lewis, E., "The Role of Wildcards in the Domain Name 447 System", RFC 4592, DOI 10.17487/RFC4592, July 2006, 448 . 450 [RFC5074] Weiler, S., "DNSSEC Lookaside Validation (DLV)", RFC 5074, 451 DOI 10.17487/RFC5074, November 2007, 452 . 454 [RFC5155] Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS 455 Security (DNSSEC) Hashed Authenticated Denial of 456 Existence", RFC 5155, DOI 10.17487/RFC5155, March 2008, 457 . 459 [RFC7719] Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS 460 Terminology", RFC 7719, DOI 10.17487/RFC7719, December 461 2015, . 463 12.2. Informative References 465 [I-D.ietf-dnsop-nxdomain-cut] 466 Bortzmeyer, S. and S. Huque, "NXDOMAIN really means there 467 is nothing underneath", draft-ietf-dnsop-nxdomain-cut-03 468 (work in progress), May 2016. 470 [I-D.vixie-dnsext-resimprove] 471 Vixie, P., Joffe, R., and F. Neves, "Improvements to DNS 472 Resolvers for Resiliency, Robustness, and Responsiveness", 473 draft-vixie-dnsext-resimprove-00 (work in progress), June 474 2010. 476 Appendix A. Detailed implementation idea 478 o Previously, cached negative responses were indexed by QNAME, 479 QCLASS, QTYPE, and the setting of the CD bit (see RFC 4035, 480 Section 4.7), and only queries matching the index key would be 481 answered from the cache. With aggressive negative caching, the 482 validator, in addition to checking to see if the answer is in its 483 cache before sending a query, checks to see whether any cached and 484 validated NSEC record denies the existence of the sought 485 record(s). Using aggressive negative caching, a validator will 486 not make queries for any name covered by a cached and validated 487 NSEC record. Furthermore, a validator answering queries from 488 clients will synthesize a negative answer whenever it has an 489 applicable validated NSEC in its cache unless the CD bit was set 490 on the incoming query. (Imported from Section 6 of [RFC5074]). 492 o Implementing aggressive negative caching suggests that a validator 493 will need to build an ordered data structure of NSEC and NSEC3 494 records for each signer domain name of NSEC / NSEC3 records in 495 order to efficiently find covering NSEC / NSEC3 records. Call the 496 table as NSEC_TABLE. (Imported from Section 6.1 of [RFC5074] and 497 expanded.) 499 o The aggressive negative caching may be inserted at the cache 500 lookup part of the full-service resolvers. 502 o If errors happen in aggressive negative caching algorithm, 503 resolvers MUST fall back to resolve the query as usual. "Resolve 504 the query as usual" means that the full-resolver resolve the query 505 in Recursive-mode as if the full-service resolver does not 506 implement aggressive negative caching. 508 Appendix B. Side effect: mitigation of random subdomain attacks 510 Random sub-domain attacks (referred to as "Water Torture" attacks or 511 NXDomain attacks) send many queries for non-existent information to 512 full-service resolvers. Their query names consist of random prefixes 513 and a target domain name. The negative cache does not work well, and 514 thus targeted full-service resolvers end up sending queries to 515 authoritative DNS servers of the target domain name. 517 The aggressive negative caching is one of possible countermeasures to 518 random subdomain attacks. If the full-service resolver supports 519 aggressive negative caching and the target domain name is signed with 520 NSEC/NSEC3 (without Opt-Out), the aggressive negative caching is one 521 of countermeasures of random subdomain attacks. 523 However, attackers can set the CD bit to their attack queries. The 524 CD bit disables signature validation and the aggressive negative 525 caching will be of no use. 527 Authors' Addresses 529 Kazunori Fujiwara 530 Japan Registry Services Co., Ltd. 531 Chiyoda First Bldg. East 13F, 3-8-1 Nishi-Kanda 532 Chiyoda-ku, Tokyo 101-0065 533 Japan 535 Phone: +81 3 5215 8451 536 Email: fujiwara@jprs.co.jp 538 Akira Kato 539 Keio University/WIDE Project 540 Graduate School of Media Design, 4-1-1 Hiyoshi 541 Kohoku, Yokohama 223-8526 542 Japan 544 Phone: +81 45 564 2490 545 Email: kato@wide.ad.jp 547 Warren Kumari 548 Google 549 1600 Amphitheatre Parkway 550 Mountain View, CA 94043 551 US 553 Email: warren@kumari.net