idnits 2.17.00 (12 Aug 2021) /tmp/idnits13283/draft-fujiwara-dnsop-nsec-aggressiveuse-02.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (October 19, 2015) is 2406 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Unused Reference: 'RFC6891' is defined on line 388, but no explicit reference was found in the text == Outdated reference: draft-ietf-dnsop-dns-terminology has been published as RFC 7719 Summary: 0 errors (**), 0 flaws (~~), 3 warnings (==), 1 comment (--). 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 Intended status: Informational A. Kato 5 Expires: April 21, 2016 Keio/WIDE 6 October 19, 2015 8 Aggressive use of NSEC/NSEC3 9 draft-fujiwara-dnsop-nsec-aggressiveuse-02 11 Abstract 13 While DNS highly depends on cache, its cache usage of non-existence 14 information was limited to exact matching. This draft proposes the 15 aggressive use of a NSEC/NSEC3 resource record, which is able to 16 express non-existence of range of names authoritatively. With this 17 proposal, shorter latency to many of negative responses is expected 18 as well as some level of mitigation of random sub-domain attacks 19 (referred to as "Water Torture" attacks). It is also expected that 20 non-existent TLD queries to Root DNS servers will decrease. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at http://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on April 21, 2016. 39 Copyright Notice 41 Copyright (c) 2015 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents 46 (http://trustee.ietf.org/license-info) in effect on the date of 47 publication of this document. Please review these documents 48 carefully, as they describe your rights and restrictions with respect 49 to this document. Code Components extracted from this document must 50 include Simplified BSD License text as described in Section 4.e of 51 the Trust Legal Provisions and are provided without warranty as 52 described in the Simplified BSD License. 54 Table of Contents 56 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 57 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 58 3. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 3 59 4. Proposed Solution: Aggressive Negative Caching . . . . . . . 4 60 5. Possible side effect . . . . . . . . . . . . . . . . . . . . 5 61 6. The CD Bit . . . . . . . . . . . . . . . . . . . . . . . . . 6 62 6.1. Detecting random subdomain attacks . . . . . . . . . . . 6 63 7. Additional proposals . . . . . . . . . . . . . . . . . . . . 6 64 7.1. Another option . . . . . . . . . . . . . . . . . . . . . 6 65 7.2. Aggressive negative caching flag idea . . . . . . . . . . 6 66 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 67 9. Security Considerations . . . . . . . . . . . . . . . . . . . 7 68 10. Implementation Considerations . . . . . . . . . . . . . . . . 7 69 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 70 12. Change History . . . . . . . . . . . . . . . . . . . . . . . 7 71 12.1. Version 01 . . . . . . . . . . . . . . . . . . . . . . . 8 72 12.2. Version 02 . . . . . . . . . . . . . . . . . . . . . . . 8 73 13. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 74 13.1. Normative References . . . . . . . . . . . . . . . . . . 8 75 13.2. Informative References . . . . . . . . . . . . . . . . . 9 76 Appendix A. Aggressive negative caching from RFC 5074 . . . . . 9 77 Appendix B. Detailed implementation idea . . . . . . . . . . . . 10 78 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 80 1. Introduction 82 While negative (non-existence) information of DNS caching mechanism 83 has been known as DNS negative cache [RFC2308], it requires exact 84 matching in most cases. Assume that "example.com" zone doesn't have 85 names such as "a.example.com" and "b.example.com". When a full- 86 service resolver receives a query "a.example.com" , it performs a DNS 87 resolution process, and eventually gets NXDOMAIN and stores it into 88 its negative cache. When the full-service resolver receives another 89 query "b.example.com", it doesn't match with "a.example.com". So it 90 will send a query to one of the authoritative servers of 91 "example.com". This was because the NXDOMAIN response just says 92 there is no such name "a.example.com" and it doesn't tell anything 93 for "b.example.com". 95 Section 5 of [RFC2308] seems to show that negative answers should be 96 cached only for the exact query name, and not (necessarily) for 97 anything below it. 99 Recently, DNSSEC [RFC4035] [RFC5155] has been practically deployed. 100 Two types of resource record (NSEC and NSEC3) are used for authentic 101 non-existence. For a zone signed with NSEC, it may be possible to 102 use the information carried in NSEC resource records to indicate that 103 the range of names where no valid name exists. Such use is 104 discouraged by Section 4.5 of RFC 4035, however. 106 This document proposes to make a minor change to RFC 4035 and the 107 full-service resolver can use NSEC/NSEC3 resource records 108 aggressively. 110 Aggressive Negative Caching was first proposed in Section 6 of DNSSEC 111 Lookaside Validation (DLV) [RFC5074] in order to find covering NSEC 112 records efficiently. Unbound [UNBOUND] has aggressive negative 113 caching code in its DLV validator. Unbound TODO file contains "NSEC/ 114 NSEC3 aggressive negative caching". 116 Section 3 of [I-D.vixie-dnsext-resimprove] ("Stopping Downward Cache 117 Search on NXDOMAIN") proposed another approach to use NXDOMAIN 118 information effectively. 120 2. Terminology 122 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 123 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 124 document are to be interpreted as described in RFC 2119 [RFC2119]. 126 Many of the specialized terms used in this specification are defined 127 in DNS Terminology [I-D.ietf-dnsop-dns-terminology]. 129 3. Problem Statement 131 Random sub-domain attacks (referred to as "Water Torture" attacks or 132 NXDomain attacks) send many non-existent queries to full-service 133 resolvers. Their query names consist of random prefixes and a target 134 domain name. The negative cache does not work well and target full- 135 service resolvers result in sending queries to authoritative DNS 136 servers of the target domain name. 138 When number of queries is large, the full-service resolvers drop 139 queries from both legitimate users and attackers as their outstanding 140 queues are filled up. 142 For example, BIND 9.10.2 [BIND9] full-service resolvers answer 143 SERVFAIL and Unbound 1.5.2 full-service resolvers drop most of 144 queries under 10,000 queries per second attack. 146 The countermeasures implemented at this moment are rate limiting and 147 disabling name resolution of target domain names. 149 4. Proposed Solution: Aggressive Negative Caching 151 If the target domain names are DNSSEC signed, aggressive use of NSEC/ 152 NSEC3 resource records mitigates the problem. 154 Section 4.5 of [RFC4035] shows that "In theory, a resolver could use 155 wildcards or NSEC RRs to generate positive and negative responses 156 (respectively) until the TTL or signatures on the records in question 157 expire. However, it seems prudent for resolvers to avoid blocking 158 new authoritative data or synthesizing new data on their own. 159 Resolvers that follow this recommendation will have a more consistent 160 view of the namespace". 162 To reduce non-existent queries sent to authoritative DNS servers, it 163 is suggested to relax this restriction as follows: 165 +--------------------------------------------------------------+ 166 | DNSSEC enabled full-service resolvers MAY use | 167 | NSEC/NSEC3 resource records to generate negative responses | 168 | until their effective TTLs or signatures on the records | 169 | in question expire. | 170 +--------------------------------------------------------------+ 172 If the full-service resolver's cache have enough information to 173 validate the query, the full-service resolver MAY use NSEC/NSEC3/ 174 wildcard records aggressively. Otherwise, the full-service resolver 175 MUST fall back to send the query to the authoritative DNS servers. 177 Necessary information to validate are wildcards which match the query 178 name, covering NSEC/NSEC3 of the wildcards, and covering NSEC/NSEC3 179 of (parts of) the query name. 181 If the zone has a wildcard and it is in the full-service resolver's 182 cache, the full-service resolver MAY generate positive responses 183 based on the information associated with the wildcard in the cache. 185 This approach is effective for DNSSEC signed zones with NSEC or 186 NSEC3, except zones with NSEC3 Opt-Out. To identify signing types of 187 the zone, validating resolvers need to build special cache of NSEC 188 and NSEC3 resource records for each signer domain name. When a query 189 name is not in the cache, find closest enclosing NS RRset in the 190 cache. The owner of this NS RRset may be the longest signer domain 191 name of the query name. If the NSEC/NSEC3 cache of the signer domain 192 name is empty, the aggressive negative caching is not possible. 193 Otherwise, there is at least one NSEC or NSEC3 resource records. The 194 record shows the signing type. If the resource record is NSEC3 and 195 with Opt-Out, the aggressive negative caching is not possible. 197 When the query name has a matching NSEC resource records in the cache 198 and there is no wildcard in the zone which the query name matches 199 with, the full-service resolver is allowed to respond with NXDOMAIN 200 error immediately. 202 NSEC3 aggressive negative caching is more difficult. If the zone is 203 signed with NSEC3, the validating resolver need to check the 204 existence of each label from the query name. If a label is not exist 205 in the zone, and there is no matching wildcard in the zone, the full- 206 service resolver is allowed to respond with NXDOMAIN error 207 immediately. 209 This function needs care on the TTL value of negative information 210 because newly added domain names cannot be used while the negative 211 information is effective. RFC 2308 states the maximum number of 212 negative cache TTL value is 10800 (3 hours). So the full-service 213 resolver SHOULD limit the maximum effective TTL value of negative 214 responses (NSEC/NSEC3 RRs) to 10800 (3 hours). It is reasonably 215 small but still effective for the purpose of this document as it can 216 eliminate significant amount of DNS attacks with randomly generated 217 names. 219 The same discussion is also applicable to wildcards. If a query name 220 is covered by a NSEC or a NSEC3 resource record in the cache and 221 there is a covering wildcard, the full-service resolver MAY use 222 wildcards to generate positive responses while wildcard and NSEC/ 223 NSEC3 resource records in the cache are effective. 225 5. Possible side effect 227 Aggressive use of NSEC/NSEC3 resource records may decrease queries to 228 Root DNS servers. 230 People may generate many typos in TLD, and they will result in 231 unnecessary DNS queries. Some implementations leak non-existent TLD 232 queries whose second level domain are different each other. Well 233 observed TLDs are ".local" and ".belkin". With this proposal, it is 234 possible to return NXDOMAIN immediately to such queries without 235 further DNS recursive resolution process. It may reduces round trip 236 time, as well as reduces the DNS queries to corresponding 237 authoritative servers, including Root DNS servers. 239 6. The CD Bit 241 The CD bit disables signature validation. It is one of the basic 242 functions of DNSSEC protocol and it SHOULD NOT be changed. However, 243 attackers may set the CD bit to their attack queries and the 244 aggressive negative caching will be of no use. 246 Ignoring the CD bit function may break the DNSSEC protocol. 248 This draft proposes that the CD bit may be ignored to support 249 aggressive negative caching when the full-service resolver is under 250 attacks with CD bit set. 252 6.1. Detecting random subdomain attacks 254 Full-service resolvers should detect conditions under random 255 subdomain attacks. When they are under attacks, their outstanding 256 queries increase. If there are some destination addresses whose 257 outstanding queries are many, they may contain attack target domain 258 names. Existing countermeasures may implement attack detection. 260 7. Additional proposals 262 There are additional proposals to the aggressive negative caching. 264 7.1. Another option 266 The proposed technique is applicable to zones where there is a NSEC 267 record to each owner name in the zone even without DNSSEC signed. 268 And it is also applicable to full-service resolvers without DNSSEC 269 validation. Full-service resolvers can set DNSSEC OK bit in query 270 packets and they will cache NSEC/NSEC3 resource records. They can 271 apply aggressive use of NSEC/NSEC3 resource records without DNSSEC 272 validation. 274 It is highly recommended to sign the zone, of course, and it is 275 recommended to apply DNSSEC validation of NSEC record prior to cache 276 it in the negative cache. 278 7.2. Aggressive negative caching flag idea 280 Authoritative DNS servers that dynamically generate NSEC records 281 normally generate minimally covering NSEC Records [RFC4470]. 282 Aggressive negative caching does not work with minimally covering 283 NSEC records. DNS operators don't want zone walking and zone 284 information leaks. They prefer NSEC resource records with narrow 285 ranges. When there is a flag that show a full-service resolver 286 support the aggressive negative caching and a query have the 287 aggressive negative caching flag, authoritative DNS servers can 288 generate NSEC resource records with wider range under random 289 subdomain attacks. 291 However, changing range of minimally covering NSEC Records may be 292 implemented by detecting attacks. Authoritative DNS servers can 293 answer any range of minimally covering NSEC Records. 295 8. IANA Considerations 297 This document has no IANA actions. 299 9. Security Considerations 301 Newly registered resource records may not be used immediately. 302 However, choosing suitable TTL value will mitigate the problem and it 303 is not a security problem. 305 It is also suggested to limit the maximum TTL value of NSEC resource 306 records in the negative cache to, for example, 10800 seconds (3hrs), 307 to mitigate the issue. Implementations which comply with this 308 proposal is suggested to have a configurable maximum value of NSEC 309 RRs in the negative cache. 311 Aggressive use of NSEC/NSEC3 resource records without DNSSEC 312 validation may cause security problems. 314 10. Implementation Considerations 316 Unbound has aggressive negative caching code in its DLV validator. 317 The author implemented NSEC aggressive caching using Unbound and its 318 DLV validator code. 320 11. Acknowledgments 322 The authors gratefully acknowledge DLV [RFC5074] author Samuel Weiler 323 and Unbound developers. Olafur Gudmundsson and Pieter Lexis proposed 324 aggressive negative caching flag idea. Valuable comments were 325 provided by Bob Harold, Tatuya JINMEI, Shumon Huque, Mark Andrews, 326 and Casey Deccio. 328 12. Change History 330 This section is used for tracking the update of this document. Will 331 be removed after finalize. 333 12.1. Version 01 335 o Added reference to DLV [RFC5074] and imported some sentences. 337 o Added Aggressive Negative Caching Flag idea. 339 o Added detailed algorithms. 341 12.2. Version 02 343 o Added reference to [I-D.vixie-dnsext-resimprove] 345 o Added considerations for the CD bit 347 o Updated detailed algorithms. 349 o Moved Aggressive Negative Caching Flag idea into Another Option. 351 13. References 353 13.1. Normative References 355 [I-D.ietf-dnsop-dns-terminology] 356 Hoffman, P., Sullivan, A., and K. Fujiwara, "DNS 357 Terminology", draft-ietf-dnsop-dns-terminology-05 (work in 358 progress), September 2015. 360 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 361 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 362 RFC2119, March 1997, 363 . 365 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 366 NCACHE)", RFC 2308, DOI 10.17487/RFC2308, March 1998, 367 . 369 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 370 Rose, "Protocol Modifications for the DNS Security 371 Extensions", RFC 4035, DOI 10.17487/RFC4035, March 2005, 372 . 374 [RFC4470] Weiler, S. and J. Ihren, "Minimally Covering NSEC Records 375 and DNSSEC On-line Signing", RFC 4470, DOI 10.17487/ 376 RFC4470, April 2006, 377 . 379 [RFC5074] Weiler, S., "DNSSEC Lookaside Validation (DLV)", RFC 5074, 380 DOI 10.17487/RFC5074, November 2007, 381 . 383 [RFC5155] Laurie, B., Sisson, G., Arends, R., and D. Blacka, "DNS 384 Security (DNSSEC) Hashed Authenticated Denial of 385 Existence", RFC 5155, DOI 10.17487/RFC5155, March 2008, 386 . 388 [RFC6891] Damas, J., Graff, M., and P. Vixie, "Extension Mechanisms 389 for DNS (EDNS(0))", STD 75, RFC 6891, DOI 10.17487/ 390 RFC6891, April 2013, 391 . 393 13.2. Informative References 395 [BIND9] Internet Systems Consortium, Inc., "Name Server Software", 396 2000, . 398 [I-D.vixie-dnsext-resimprove] 399 Vixie, P., Joffe, R., and F. Neves, "Improvements to DNS 400 Resolvers for Resiliency, Robustness, and Responsiveness", 401 draft-vixie-dnsext-resimprove-00 (work in progress), June 402 2010. 404 [UNBOUND] NLnet Labs, "Unbound DNS validating resolver", 2006, 405 . 407 Appendix A. Aggressive negative caching from RFC 5074 409 Imported from Section 6 of [RFC5074]. 411 Previously, cached negative responses were indexed by QNAME, QCLASS, 412 QTYPE, and the setting of the CD bit (see RFC 4035, Section 4.7), and 413 only queries matching the index key would be answered from the cache. 414 With aggressive negative caching, the validator, in addition to 415 checking to see if the answer is in its cache before sending a query, 416 checks to see whether any cached and validated NSEC record denies the 417 existence of the sought record(s). 419 Using aggressive negative caching, a validator will not make queries 420 for any name covered by a cached and validated NSEC record. 421 Furthermore, a validator answering queries from clients will 422 synthesize a negative answer whenever it has an applicable validated 423 NSEC in its cache unless the CD bit was set on the incoming query. 425 Imported from Section 6.1 of [RFC5074]. 427 Implementing aggressive negative caching suggests that a validator 428 will need to build an ordered data structure of NSEC records in order 429 to efficiently find covering NSEC records. Only NSEC records from 430 DLV domains need to be included in this data structure. 432 Appendix B. Detailed implementation idea 434 Section 6.1 of [RFC5074] is expanded as follows. 436 Implementing aggressive negative caching suggests that a validator 437 will need to build an ordered data structure of NSEC and NSEC3 438 records for each signer domain name of NSEC / NSEC3 records in order 439 to efficiently find covering NSEC / NSEC3 records. Call the table as 440 NSEC_TABLE. 442 The aggressive negative caching may be inserted at the cache lookup 443 part of the full-service resolvers. 445 If errors happen in aggressive negative caching algorithm, resolvers 446 MUST fall back to resolve the query as usual. "Resolve the query as 447 usual" means that the full-resolver resolve the query in Recursive- 448 mode as if the full-service resolver does not implement aggressive 449 negative caching. 451 To implement aggressive negative caching, resolver algorithm near 452 cache lookup will be changed as follows: 454 QNAME = the query name; 455 if (QNAME name entry exists in the cache) { 456 resolve the query as usual; 457 // if RRSet (query name and query type) exists in the cache, 458 // the resolver responds the RRSet from the cache 459 // Otherwise, the resolver needs to iterate the query. 460 } 462 // Find closest enclosing NS RRset in the cache. 463 // The owner of this NS RRset will be a suffix of the QNAME 464 // - the longest suffix of any NS RRset in the cache. 465 SIGNER = closest enclosing NS RRSet of QNAME in the cache; 467 // Check the SOA RR of the SIGNER 468 if (SOA RR of SIGNER does not exist in the cache 469 or SIGNER zone is not signed or not validated) { 470 Resolve the query as usual; 471 } 473 if (SIGNER zone does not have NSEC_TABLE) { 474 Resolve the query as usual; 476 } 478 if (SIGNER zone is signed with NSEC) { 479 // NSEC mode 480 if (covering NSEC RR of QNAME at SIGNER zone 481 doesn't exist in the cache) { 482 Resolve the query as usual. 483 } 485 TEST = Find the closest encloser domain name of QNAME and 486 the covering NSEC RR of QNAME 488 if (*.TEST name entry exists in the cache) { 489 the resolver can generate positive response 490 // synthesize the wildcard *.TEST 491 } 492 if covering NSEC RR of "*.TEST" at SIGNER zone exists 493 in the cache { 494 the resolver can generate negative response; 495 } 496 // Lack of information 497 } else 498 if (SIGNER zone is signed with NSEC3 and does not use Opt-Out) { 499 // NSEC3 mode 501 TEST = SIGNER; 502 while (TEST != QNAME) { 503 // if any error happens in this loop, break this loop 504 UPPER = TEST; 505 add a label from the QNAME to the start of TEST; 506 // TEST = label.UPPER 507 if (TEST name entry exist in the cache) { 508 continue; // need to check rest of QNAME 509 } 510 if (covering NSEC3 of TEST exist in the cache) { 511 // (non-)terminal name TEST does not exist 512 if (*.UPPER name entry exist in the cache) { 513 // TEST does not exist and *.UPPER exist 514 the resolver can generate positive response; 515 } else 516 if (covering NSEC3 of *.UPPER exist in the cache) { 517 // TEST does not exist and *.UPPER does not exist 518 the resolver can generate negative response; 519 } 520 break; // Lack of information 521 } else 522 if (NSEC3 of TEST does not exist in the cache) { 523 break; // Lack of information 525 } 526 // TEST label exist, then need to check rest of QNAME 527 } 528 // Lack of information, need to resolve the query as usual 529 } 530 Resolve the query as usual 532 Authors' Addresses 534 Kazunori Fujiwara 535 Japan Registry Services Co., Ltd. 536 Chiyoda First Bldg. East 13F, 3-8-1 Nishi-Kanda 537 Chiyoda-ku, Tokyo 101-0065 538 Japan 540 Phone: +81 3 5215 8451 541 Email: fujiwara@jprs.co.jp 543 Akira Kato 544 Keio University/WIDE Project 545 Graduate School of Media Design, 4-1-1 Hiyoshi 546 Kohoku, Yokohama 223-8526 547 Japan 549 Phone: +81 45 564 2490 550 Email: kato@wide.ad.jp