1 Network Working Group                                           J. Damas   
    2 Request for Comments: 5358                                           ISC   
    3 BCP: 140                                                        F. Neves   
    4 Category: Best Current Practice                              Registro.br   
    5                                                             October 2008   
    6                                                                            
    7                                                                            
    8       Preventing Use of Recursive Nameservers in Reflector Attacks         
    9                                                                            
   10 Status of This Memo                                                        
   11                                                                            
   12    This document specifies an Internet Best Current Practices for the      
   13    Internet Community, and requests discussion and suggestions for         
   14    improvements.  Distribution of this memo is unlimited.                  
   15                                                                            
   16 Abstract                                                                   
   17                                                                            
   18    This document describes ways to prevent the use of default configured   
   19    recursive nameservers as reflectors in Denial of Service (DoS)          
   20    attacks.  It provides recommended configuration as measures to          
   21    mitigate the attack.                                                    
   22                                                                            
   23 Table of Contents                                                          
   24                                                                            
   25    1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . . . 2   
   26    2.  Document Terminology  . . . . . . . . . . . . . . . . . . . . . 2   
   27    3.  Problem Description . . . . . . . . . . . . . . . . . . . . . . 2   
   28    4.  Recommended Configuration . . . . . . . . . . . . . . . . . . . 4   
   29    5.  Security Considerations . . . . . . . . . . . . . . . . . . . . 5   
   30    6.  Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . 5   
   31    7.  References  . . . . . . . . . . . . . . . . . . . . . . . . . . 5   
   32      7.1.  Normative References  . . . . . . . . . . . . . . . . . . . 5   
   33      7.2.  Informative References  . . . . . . . . . . . . . . . . . . 6   
   34                                                                            
   35                                                                            
   36                                                                            
   37                                                                            
   38                                                                            
   39                                                                            
   40                                                                            
   41                                                                            
   42                                                                            
   43                                                                            
   44                                                                            
   45                                                                            
   46                                                                            
   47                                                                            
   48                                                                            
   49                                                                            
   50                                                                            
   51                                                                            
   52 Damas & Neves            Best Current Practice                  [Page 1]   

   53 RFC 5358        Preventing Rec. NS in Reflector Attacks     October 2008   
   54                                                                            
   55                                                                            
   56 1.  Introduction                                                           
   57                                                                            
   58    Recently, DNS [RFC1034] has been named as a major factor in the         
   59    generation of massive amounts of network traffic used in Denial of      
   60    Service (DoS) attacks.  These attacks, called reflector attacks, are    
   61    not due to any particular flaw in the design of the DNS or its          
   62    implementations, except that DNS relies heavily on UDP, the easy        
   63    abuse of which is at the source of the problem.  The attacks have       
   64    preferentially used DNS due to common default configurations that       
   65    allow for easy use of open recursive nameservers that make use of       
   66    such a default configuration.                                           
   67                                                                            
   68    In addition, due to the small query-large response potential of the     
   69    DNS system, it is easy to yield great amplification of the source       
   70    traffic as reflected traffic towards the victims.                       
   71                                                                            
   72    DNS authoritative servers that do not provide recursion to clients      
   73    can also be used as amplifiers; however, the amplification potential    
   74    is greatly reduced when authoritative servers are used.  It is also     
   75    impractical to restrict access to authoritative servers to a subset     
   76    of the Internet, since their normal operation relies on them being      
   77    able to serve a wide audience; hence, the opportunities to mitigate     
   78    the scale of an attack by modifying authoritative server                
   79    configurations are limited.  This document's recommendations are        
   80    concerned with recursive nameservers only.                              
   81                                                                            
   82    In this document we describe the characteristics of the attack and      
   83    recommend DNS server configurations that specifically alleviate the     
   84    problem described, while pointing to the only real solution: the        
   85    wide-scale deployment of ingress filtering to prevent use of spoofed    
   86    IP addresses [BCP38].                                                   
   87                                                                            
   88 2.  Document Terminology                                                   
   89                                                                            
   90    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",     
   91    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this    
   92    document are to be interpreted as described in [RFC2119].               
   93                                                                            
   94 3.  Problem Description                                                    
   95                                                                            
   96    Because most DNS traffic is stateless by design, an attacker could      
   97    start a DoS attack in the following way:                                
   98                                                                            
   99    1.  The attacker starts by configuring a record on any zone he has      
  100        access to, normally with large RDATA and Time to Live (TTL).        
  101                                                                            
  102                                                                            
  103                                                                            
  104                                                                            
  105                                                                            
  106                                                                            
  107 Damas & Neves            Best Current Practice                  [Page 2]   

  108 RFC 5358        Preventing Rec. NS in Reflector Attacks     October 2008   
  109                                                                            
  110                                                                            
  111    2.  Taking advantage of clients on non-BCP38 networks, the attacker     
  112        then crafts a query using the source address of their target        
  113        victim and sends it to an open recursive nameserver.                
  114                                                                            
  115    3.  Each open recursive nameserver proceeds with the resolution,        
  116        caches the record, and finally sends it to the target.  After       
  117        this first lookup, access to the authoritative nameservers is       
  118        normally no longer necessary.  The record will remain cached at     
  119        the open recursive nameserver for the duration of the TTL, even     
  120        if it's deleted from the zone.                                      
  121                                                                            
  122    4.  Cleanup of the zone might, depending on the implementation used     
  123        in the open recursive nameserver, afford a way to clean the         
  124        cached record from the open recursive nameserver.  This would       
  125        possibly involve queries luring the open recursive nameserver to    
  126        lookup information for the same name that is being used in the      
  127        amplification.                                                      
  128                                                                            
  129    Because the characteristics of the attack normally involve a low        
  130    volume of packets amongst all the kinds of actors besides the victim,   
  131    it's unlikely any one of them would notice their involvement based on   
  132    traffic pattern changes.                                                
  133                                                                            
  134    Taking advantage of an open recursive nameserver that supports EDNS0    
  135    [RFC2671], the amplification factor (response packet size / query       
  136    packet size) could be around 80.  With this amplification factor, a     
  137    relatively small army of clients and open recursive nameservers could   
  138    generate gigabits of traffic towards the victim.                        
  139                                                                            
  140    With the increasing length of authoritative DNS responses derived       
  141    from deployment of DNSSEC [RFC4033] and NAPTR resource records as       
  142    used in ENUM services, authoritative servers will eventually be more    
  143    useful as actors in this sort of amplification attack.                  
  144                                                                            
  145    Even if this amplification attack is only possible due to non-          
  146    deployment of BCP38, it is easier to leverage because of historical     
  147    reasons.  When the Internet was a much closer-knit community, some      
  148    nameserver implementations were made available with default             
  149    configurations that, when used for recursive nameservers, made the      
  150    server accessible to all hosts on the Internet.                         
  151                                                                            
  152    For years this was a convenient and helpful configuration, enabling     
  153    wider availability of services.  As this document aims to make          
  154    apparent, it is now much better to be conscious of one's own            
  155    nameserver services and focus the delivery of services on the           
  156    intended audience of those services -- be they a university campus,     
  157    an enterprise, or an ISP's customers.  The target audience also         
  158    includes operators of small networks and private server managers who    
  159                                                                            
  160                                                                            
  161                                                                            
  162 Damas & Neves            Best Current Practice                  [Page 3]   

  163 RFC 5358        Preventing Rec. NS in Reflector Attacks     October 2008   
  164                                                                            
  165                                                                            
  166    decide to operate nameservers with the aim of optimising their DNS      
  167    service, as these are more likely to use default configurations as      
  168    shipped by implementors.                                                
  169                                                                            
  170 4.  Recommended Configuration                                              
  171                                                                            
  172    In this section we describe the Best Current Practice for operating     
  173    recursive nameservers.  Following these recommendations would reduce    
  174    the chances of any given recursive nameserver being used for the        
  175    generation of an amplification attack.                                  
  176                                                                            
  177    The generic recommendation to nameserver operators is to use the        
  178    means provided by the implementation of choice to provide recursive     
  179    name lookup service to only the intended clients.  Client               
  180    authorization can usually be done in several ways:                      
  181                                                                            
  182    o  IP address based authorization.  Use the IP source address of the    
  183       DNS queries and filter them through an Access Control List (ACL)     
  184       to service only the intended clients.  This is easily applied if     
  185       the recursive nameserver's service area is a reasonably fixed IP     
  186       address range that is protected against external address spoofing,   
  187       usually the local network.                                           
  188                                                                            
  189    o  Incoming interface based selection.  Use the incoming interface      
  190       for the query as a discriminator to select which clients are to be   
  191       served.  This is of particular applicability for SOHO (Small         
  192       Office, Home Office) devices, such as broadband routers that         
  193       include embedded recursive nameservers.                              
  194                                                                            
  195    o  TSIG [RFC2845] or SIG(0) [RFC2931] signed queries to authenticate    
  196       the clients.  This is a less error prone method that allows server   
  197       operators to provide service to clients who change IP address        
  198       frequently (e.g., roaming clients).  The current drawback of this    
  199       method is that very few stub resolver implementations support TSIG   
  200       or SIG(0) signing of outgoing queries.  The effective use of this    
  201       method implies, in most cases, running a local instance of a         
  202       caching nameserver or forwarder that will be able to TSIG sign the   
  203       queries and send them on to the recursive nameserver of choice.      
  204                                                                            
  205    o  For mobile users, use a local caching nameserver running on the      
  206       mobile device or use a Virtual Private Network to a trusted          
  207       server.                                                              
  208                                                                            
  209    In nameservers that do not need to be providing recursive service,      
  210    for instance servers that are meant to be authoritative only, turn      
  211    recursion off completely.  In general, it is a good idea to keep        
  212    recursive and authoritative services separate as much as practical.     
  213    This, of course, depends on local circumstances.                        
  214                                                                            
  215                                                                            
  216                                                                            
  217 Damas & Neves            Best Current Practice                  [Page 4]   

  218 RFC 5358        Preventing Rec. NS in Reflector Attacks     October 2008   
  219                                                                            
  220                                                                            
  221    Even with all these recommendations, network operators should           
  222    consider deployment of ingress filtering [BCP38] in routers to          
  223    prevent use of address spoofing as a viable course of action.  In       
  224    situations where more complex network setups are in place, "Ingress     
  225    Filtering for Multihomed Network" [BCP84] maybe a useful additional     
  226    reference.                                                              
  227                                                                            
  228    By default, nameservers SHOULD NOT offer recursive service to           
  229    external networks.                                                      
  230                                                                            
  231 5.  Security Considerations                                                
  232                                                                            
  233    This document does not create any new security issues for the DNS       
  234    protocol, it deals with a weakness in implementations.                  
  235                                                                            
  236    Deployment of SIG(0) transaction security [RFC2931] should consider     
  237    the caveats with SIG(0) computational expense as it uses public key     
  238    cryptography rather than the symmetric keys used by TSIG [RFC2845].     
  239    In addition, the identification of the appropriate keys needs similar   
  240    mechanisms as those for deploying TSIG or, alternatively, the use of    
  241    DNSSEC [RFC4033] signatures (RRSIGs) over the KEY RRs if published in   
  242    DNS.  This will in turn require the appropriate management of DNSSEC    
  243    trust anchors.                                                          
  244                                                                            
  245 6.  Acknowledgments                                                        
  246                                                                            
  247    The authors would like to acknowledge the helpful input and comments    
  248    of Joe Abley, Olafur Gudmundsson, Pekka Savola, Andrew Sullivan, and    
  249    Tim Polk.                                                               
  250                                                                            
  251 7.  References                                                             
  252                                                                            
  253 7.1.  Normative References                                                 
  254                                                                            
  255    [RFC1034]  Mockapetris, P., "Domain names - concepts and facilities",   
  256               STD 13, RFC 1034, November 1987.                             
  257                                                                            
  258    [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate          
  259               Requirement Levels", BCP 14, RFC 2119, March 1997.           
  260                                                                            
  261    [RFC2671]  Vixie, P., "Extension Mechanisms for DNS (EDNS0)",           
  262               RFC 2671, August 1999.                                       
  263                                                                            
  264    [RFC2845]  Vixie, P., Gudmundsson, O., Eastlake, D., and B.             
  265               Wellington, "Secret Key Transaction Authentication for DNS   
  266               (TSIG)", RFC 2845, May 2000.                                 
  267                                                                            
  268                                                                            
  269                                                                            
  270                                                                            
  271                                                                            
  272 Damas & Neves            Best Current Practice                  [Page 5]   

  273 RFC 5358        Preventing Rec. NS in Reflector Attacks     October 2008   
  274                                                                            
  275                                                                            
  276    [RFC2931]  Eastlake, D., "DNS Request and Transaction Signatures        
  277               (SIG(0)s)", RFC 2931, September 2000.                        
  278                                                                            
  279    [RFC4033]  Arends, R., Austein, R., Larson, M., Massey, D., and S.      
  280               Rose, "DNS Security Introduction and Requirements",          
  281               RFC 4033, March 2005.                                        
  282                                                                            
  283 7.2.  Informative References                                               
  284                                                                            
  285    [BCP38]    Ferguson, P. and D. Senie, "Network Ingress Filtering:       
  286               Defeating Denial of Service Attacks which employ IP Source   
  287               Address Spoofing", BCP 38, RFC 2827, May 2000.               
  288                                                                            
  289    [BCP84]    Baker, F. and P. Savola, "Ingress Filtering for Multihomed   
  290               Networks", BCP 84, RFC 3704, March 2004.                     
  291                                                                            
  292 Authors' Addresses                                                         
  293                                                                            
  294    Joao Damas                                                              
  295    Internet Systems Consortium, Inc.                                       
  296    950 Charter Street                                                      
  297    Redwood City, CA  94063                                                 
  298    US                                                                      
  299                                                                            
  300    Phone: +1 650 423 1300                                                  
  301    EMail: Joao_Damas@isc.org                                               
  302    URI:   http://www.isc.org/                                              
  303                                                                            
  304                                                                            
  305    Frederico A. C. Neves                                                   
  306    NIC.br / Registro.br                                                    
  307    Av. das Nacoes Unidas, 11541, 7                                         
  308    Sao Paulo, SP  04578-000                                                
  309    BR                                                                      
  310                                                                            
  311    Phone: +55 11 5509 3511                                                 
  312    EMail: fneves@registro.br                                               
  313    URI:   http://registro.br/                                              
  314                                                                            
  315                                                                            
  316                                                                            
  317                                                                            
  318                                                                            
  319                                                                            
  320                                                                            
  321                                                                            
  322                                                                            
  323                                                                            
  324                                                                            
  325                                                                            
  326                                                                            
  327 Damas & Neves            Best Current Practice                  [Page 6]   

  328 RFC 5358        Preventing Rec. NS in Reflector Attacks     October 2008   
  329                                                                            
  330                                                                            
  331 Full Copyright Statement                                                   
  332                                                                            
  333    Copyright (C) The IETF Trust (2008).                                    
  334                                                                            
  335    This document is subject to the rights, licenses and restrictions       
  336    contained in BCP 78, and except as set forth therein, the authors       
  337    retain all their rights.                                                
  338                                                                            
  339    This document and the information contained herein are provided on an   
  340    "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS   
  341    OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND   
  342    THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS    
  343    OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF   
  344    THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED      
  345    WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.      
  346                                                                            
  347 Intellectual Property                                                      
  348                                                                            
  349    The IETF takes no position regarding the validity or scope of any       
  350    Intellectual Property Rights or other rights that might be claimed to   
  351    pertain to the implementation or use of the technology described in     
  352    this document or the extent to which any license under such rights      
  353    might or might not be available; nor does it represent that it has      
  354    made any independent effort to identify any such rights.  Information   
  355    on the procedures with respect to rights in RFC documents can be        
  356    found in BCP 78 and BCP 79.                                             
  357                                                                            
  358    Copies of IPR disclosures made to the IETF Secretariat and any          
  359    assurances of licenses to be made available, or the result of an        
  360    attempt made to obtain a general license or permission for the use of   
  361    such proprietary rights by implementers or users of this                
  362    specification can be obtained from the IETF on-line IPR repository at   
  363    http://www.ietf.org/ipr.                                                
  364                                                                            
  365    The IETF invites any interested party to bring to its attention any     
  366    copyrights, patents or patent applications, or other proprietary        
  367    rights that may cover technology that may be required to implement      
  368    this standard.  Please address the information to the IETF at           
  369    ietf-ipr@ietf.org.                                                      
  370                                                                            
  371                                                                            
  372                                                                            
  373                                                                            
  374                                                                            
  375                                                                            
  376                                                                            
  377                                                                            
  378                                                                            
  379                                                                            
  380                                                                            
  381                                                                            
  382 Damas & Neves            Best Current Practice                  [Page 7]   
  383                                                                            

The IETF is responsible for the creation and maintenance of the DNS RFCs. The ICANN DNS RFC annotation project provides a forum for collecting community annotations on these RFCs as an aid to understanding for implementers and any interested parties. The annotations displayed here are not the result of the IETF consensus process.

This RFC is included in the DNS RFCs annotation project whose home page is here.