Bv9ARM.ch07.html revision d510e8695ebcce64e515ce756b1cfe8fc3e531ef
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews>BIND 9 Security Considerations</TITLE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsNAME="GENERATOR"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCONTENT="Modular DocBook HTML Stylesheet Version 1.61
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTITLE="BIND 9 Administrator Reference Manual"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsREL="PREVIOUS"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTITLE="BIND 9 Configuration Reference"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTITLE="Troubleshooting"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCLASS="chapter"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsBGCOLOR="#FFFFFF"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntTEXT="#000000"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntLINK="#0000FF"
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox UserVLINK="#840084"
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic UpdaterALINK="#0000FF"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCLASS="NAVHEADER"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCELLPADDING="0"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCELLSPACING="0"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsALIGN="center"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews>BIND 9 Administrator Reference Manual</TH
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsVALIGN="bottom"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsALIGN="center"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntVALIGN="bottom"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsALIGN="right"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntVALIGN="bottom"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="chapter"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>Chapter 7. <SPAN
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="acronym"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> 9 Security Considerations</A
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>Table of Contents</B
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsHREF="Bv9ARM.ch07.html#Access_Control_Lists"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews>Access Control Lists</A
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
b2f07642fd712c8fda81a116bcdde229ab291f33Tinderbox UserCLASS="command"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsUNIX servers)</A
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntHREF="Bv9ARM.ch07.html#dynamic_update_security"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews>Dynamic Update Security</A
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="sect1"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="sect1"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntNAME="Access_Control_Lists"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>7.1. Access Control Lists</A
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>Access Control Lists (ACLs), are address match lists that
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Useryou can set up and nickname for future use in <B
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>allow-notify</B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews>allow-query</B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>allow-recursion</B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>blackhole</B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>allow-transfer</B
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>Using ACLs allows you to have finer control over who can access
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Useryour nameserver, without cluttering up your config files with huge
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userlists of IP addresses.</P
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="emphasis"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews>good idea</I
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> to use ACLs, and to
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntcontrol access to your server. Limiting access to your server by
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Useroutside parties can help prevent spoofing and DoS attacks against
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Useryour server.</P
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>Here is an example of how to properly apply ACLs:</P
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="programlisting"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> // Set up an ACL named "bogusnets" that will block RFC1918 space,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt// which is commonly used in spoofing attacks.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsacl bogusnets { 0.0.0.0/8; 1.0.0.0/8; 2.0.0.0/8; 192.0.2.0/24; 224.0.0.0/3; 10.0.0.0/8; 172.16.0.0/12; 192.168.0.0/16; };
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt// Set up an ACL called our-nets. Replace this with the real IP numbers.
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User allow-query { our-nets; };
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt allow-recursion { our-nets; };
d3ddafd7469d1f3430ccd1b0fe0d13ccbbaf5debTinderbox User blackhole { bogusnets; };
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt allow-query { any; };
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>This allows recursive queries of the server from the outside
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntunless recursion has been previously disabled.</P
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>For more information on how to use ACLs to protect your server,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCLASS="emphasis"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> advisory at
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntHREF="ftp://ftp.auscert.org.au/pub/auscert/advisory/AL-1999.004.dns_dos"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntTARGET="_top"
c247e3f281613fabe1af362e9f3157e35ebbe52cMark Andrews>ftp://ftp.auscert.org.au/pub/auscert/advisory/AL-1999.004.dns_dos</A
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserNAME="AEN4177"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserUNIX servers)</A
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>On UNIX servers, it is possible to run <SPAN
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCLASS="acronym"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="emphasis"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> environment
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews>) by specifying the "<TT
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="option"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntoption. This can help improve system security by placing <SPAN
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="acronym"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunta "sandbox," which will limit the damage done if a server is compromised.</P
395c95214142142854509945adf3293c0270e1c5Tinderbox User>Another useful feature in the UNIX version of <SPAN
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="acronym"
395c95214142142854509945adf3293c0270e1c5Tinderbox Userability to run the daemon as a nonprivileged user ( <TT
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="option"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="replaceable"
395c95214142142854509945adf3293c0270e1c5Tinderbox UserWe suggest running as a nonprivileged user when using the <B
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> feature.</P
395c95214142142854509945adf3293c0270e1c5Tinderbox User>Here is an example command line to load <SPAN
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="acronym"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox User>, and to run <B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="userinput"
395c95214142142854509945adf3293c0270e1c5Tinderbox UserNAME="AEN4200"
395c95214142142854509945adf3293c0270e1c5Tinderbox User>7.2.1. The <B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> Environment</A
395c95214142142854509945adf3293c0270e1c5Tinderbox User>In order for a <B
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox User> environment to
395c95214142142854509945adf3293c0270e1c5Tinderbox Userwork properly in a particular directory
395c95214142142854509945adf3293c0270e1c5Tinderbox User(for example, <TT
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="filename"
395c95214142142854509945adf3293c0270e1c5Tinderbox Useryou will need to set up an environment that includes everything
c0cbdeedb5e119c640f098da1851cb1b9adcc739Tinderbox UserCLASS="acronym"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> needs to run.
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="acronym"
395c95214142142854509945adf3293c0270e1c5Tinderbox User>'s point of view, <TT
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="filename"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntthe root of the filesystem. You will need to adjust the values of options like
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>directory</B
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox User> Unlike with earlier versions of BIND, you will typically
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="emphasis"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> need to compile <B
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox Userstatically nor install shared libraries under the new root.
395c95214142142854509945adf3293c0270e1c5Tinderbox UserHowever, depending on your operating system, you may need
395c95214142142854509945adf3293c0270e1c5Tinderbox Userto set up things like
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="filename"
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="filename"
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="filename"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="filename"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="sect2"
395c95214142142854509945adf3293c0270e1c5Tinderbox UserNAME="AEN4218"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>7.2.2. Using the <B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>Prior to running the <B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User> utility (to change file access and
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntmodification times) or the <B
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="command"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntto which you want <SPAN
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="acronym"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Userto write. Note that if the <B
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User> daemon is running as a
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox Usernonprivileged user, it will not be able to bind to new restricted ports if the
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntserver is reloaded.</P
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserNAME="dynamic_update_security"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>7.3. Dynamic Update Security</A
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>Access to the dynamic
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntupdate facility should be strictly limited. In earlier versions of
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="acronym"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> the only way to do this was based on the IP
395c95214142142854509945adf3293c0270e1c5Tinderbox Useraddress of the host requesting the update, by listing an IP address or
395c95214142142854509945adf3293c0270e1c5Tinderbox Usernetwork prefix in the <B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox User>allow-update</B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> zone option.
395c95214142142854509945adf3293c0270e1c5Tinderbox UserThis method is insecure since the source address of the update UDP packet
395c95214142142854509945adf3293c0270e1c5Tinderbox Useris easily forged. Also note that if the IP addresses allowed by the
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>allow-update</B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt> option include the address of a slave
395c95214142142854509945adf3293c0270e1c5Tinderbox Userserver which performs forwarding of dynamic updates, the master can be
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunttrivially attacked by sending the update to the slave, which will
395c95214142142854509945adf3293c0270e1c5Tinderbox Userforward it to the master with its own source IP address causing the
395c95214142142854509945adf3293c0270e1c5Tinderbox Usermaster to approve it without question.</P
395c95214142142854509945adf3293c0270e1c5Tinderbox User>For these reasons, we strongly recommend that updates be
395c95214142142854509945adf3293c0270e1c5Tinderbox Usercryptographically authenticated by means of transaction signatures
395c95214142142854509945adf3293c0270e1c5Tinderbox User(TSIG). That is, the <B
395c95214142142854509945adf3293c0270e1c5Tinderbox UserCLASS="command"
395c95214142142854509945adf3293c0270e1c5Tinderbox User>allow-update</B
395c95214142142854509945adf3293c0270e1c5Tinderbox User> option should
395c95214142142854509945adf3293c0270e1c5Tinderbox Userlist only TSIG key names, not IP addresses or network
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntprefixes. Alternatively, the new <B
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="command"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>update-policy</B
395c95214142142854509945adf3293c0270e1c5Tinderbox Useroption can be used.</P
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt>Some sites choose to keep all dynamically updated DNS data
395c95214142142854509945adf3293c0270e1c5Tinderbox Userin a subdomain and delegate that subdomain to a separate zone. This
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntway, the top-level zone containing critical data such as the IP addresses
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntof public web and mail servers need not allow dynamic update at
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserCLASS="NAVFOOTER"
61ab11c0ec845606f85452b2c9f2e223772aae00Tinderbox UserCELLPADDING="0"
61ab11c0ec845606f85452b2c9f2e223772aae00Tinderbox UserCELLSPACING="0"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntALIGN="center"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCLASS="acronym"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User> 9 Configuration Reference</TD
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox UserALIGN="center"
659d063f23a35d77ad5826e6556d3137672bb937Tinderbox User>Troubleshooting</TD