Bv9ARM.ch07.html revision 66f25f2ceeb589e67efe7af2413baaa3426b0042
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington - Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - Copyright (C) 2000-2003 Internet Software Consortium.
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - Permission to use, copy, modify, and/or distribute this software for any
1633838b8255282d10af15c5c84cee5a51466712Bob Halley - purpose with or without fee is hereby granted, provided that the above
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence - copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15a44745412679c30a6d022733925af70a38b715David Lawrence - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15a44745412679c30a6d022733925af70a38b715David Lawrence - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15a44745412679c30a6d022733925af70a38b715David Lawrence - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15a44745412679c30a6d022733925af70a38b715David Lawrence - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15a44745412679c30a6d022733925af70a38b715David Lawrence - PERFORMANCE OF THIS SOFTWARE.
fda0ab6a96a7edb1acbde0c77ead0542979b0f24Bob Halley<!-- $Id: Bv9ARM.ch07.html,v 1.237 2010/12/26 01:14:08 tbox Exp $ -->
fda0ab6a96a7edb1acbde0c77ead0542979b0f24Bob Halley<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
fda0ab6a96a7edb1acbde0c77ead0542979b0f24Bob Halley<title>Chapter�7.�BIND 9 Security Considerations</title>
fda0ab6a96a7edb1acbde0c77ead0542979b0f24Bob Halley<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
7aacbd685b2107670e4179689abec9cb82d972abBob Halley<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
d8dcd6ad4617cc8d7df979bd62101fa9c4bac1bcBob Halley<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
7aacbd685b2107670e4179689abec9cb82d972abBob Halley<link rel="prev" href="Bv9ARM.ch06.html" title="Chapter�6.�BIND 9 Configuration Reference">
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<link rel="next" href="Bv9ARM.ch08.html" title="Chapter�8.�Troubleshooting">
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<table width="100%" summary="Navigation header">
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<tr><th colspan="3" align="center">Chapter�7.�<acronym class="acronym">BIND</acronym> 9 Security Considerations</th></tr>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<a accesskey="p" href="Bv9ARM.ch06.html">Prev</a>�</td>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch08.html">Next</a>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<div class="titlepage"><div><div><h2 class="title">
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<a name="Bv9ARM.ch07"></a>Chapter�7.�<acronym class="acronym">BIND</acronym> 9 Security Considerations</h2></div></div></div>
0d3119d4d1394adf61f5ab69ef3573993cde6fe3Michael Graff<dt><span class="sect1"><a href="Bv9ARM.ch07.html#Access_Control_Lists">Access Control Lists</a></span></dt>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<dt><span class="sect1"><a href="Bv9ARM.ch07.html#id2602042"><span><strong class="command">Chroot</strong></span> and <span><strong class="command">Setuid</strong></span></a></span></dt>
af0fce400bfa79289aae239c10ae7f4fb2be8fa6Bob Halley<dt><span class="sect2"><a href="Bv9ARM.ch07.html#id2602123">The <span><strong class="command">chroot</strong></span> Environment</a></span></dt>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<dt><span class="sect2"><a href="Bv9ARM.ch07.html#id2602183">Using the <span><strong class="command">setuid</strong></span> Function</a></span></dt>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<dt><span class="sect1"><a href="Bv9ARM.ch07.html#dynamic_update_security">Dynamic Update Security</a></span></dt>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<div class="titlepage"><div><div><h2 class="title" style="clear: both">
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence<a name="Access_Control_Lists"></a>Access Control Lists</h2></div></div></div>
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence Access Control Lists (ACLs) are address match lists that
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence you can set up and nickname for future use in <span><strong class="command">allow-notify</strong></span>,
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence <span><strong class="command">allow-query</strong></span>, <span><strong class="command">allow-query-on</strong></span>,
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence <span><strong class="command">allow-recursion</strong></span>, <span><strong class="command">allow-recursion-on</strong></span>,
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence <span><strong class="command">blackhole</strong></span>, <span><strong class="command">allow-transfer</strong></span>,
d2e9c94edbc8d9a32216e69ef812c00955a916e0Michael Graff Using ACLs allows you to have finer control over who can access
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence your name server, without cluttering up your config files with huge
1f5eafd61b4c4271dbcf9d9106a722148e51d5ebDavid Lawrence lists of IP addresses.
44215b932d4f0ce5257d794cb6f76b9282455eb1Mark Andrews It is a <span class="emphasis"><em>good idea</em></span> to use ACLs, and to
19e0a2c2d13500712564c59c5feb76f7f4209383Brian Wellington control access to your server. Limiting access to your server by
fcf28b759c65388e8875f2dbcf8eb5fa786b29ecAndreas Gustafsson outside parties can help prevent spoofing and denial of service (DoS) attacks against
19872fdfb75357354a83b74932f661d4b0b6e4ddAndreas Gustafsson Here is an example of how to properly apply ACLs:
0ffaee887ff5674b8c3bb0435ae838f641981706Mark Andrews// Set up an ACL named "bogusnets" that will block
7052e191ce63fdf063a977695718ff426a27628eMark Andrews// RFC1918 space and some reserved space, which is
19872fdfb75357354a83b74932f661d4b0b6e4ddAndreas Gustafsson// commonly used in spoofing attacks.
f6f4d7ee0f04474a13f4c28f1d05112325f3c8b0David Lawrenceacl bogusnets {
cd5a526372c715217370f7639dc56e6d48600329David Lawrence 0.0.0.0/8; 1.0.0.0/8; 2.0.0.0/8; 192.0.2.0/24;
0c33e418cb443ade8ed55f5433bc4d409c7af0b8David Lawrence// Set up an ACL called our-nets. Replace this with the
87cafc5e70f79f2586d067fbdd64f61bbab069d2David Lawrence// real IP numbers.
0c33e418cb443ade8ed55f5433bc4d409c7af0b8David Lawrence allow-query { our-nets; };
0c33e418cb443ade8ed55f5433bc4d409c7af0b8David Lawrence allow-recursion { our-nets; };
87cafc5e70f79f2586d067fbdd64f61bbab069d2David Lawrence blackhole { bogusnets; };
<a href="ftp://ftp.auscert.org.au/pub/auscert/advisory/AL-1999.004.dns_dos" target="_top">ftp://ftp.auscert.org.au/pub/auscert/advisory/AL-1999.004.dns_dos</a>
<a name="id2602042"></a><span><strong class="command">Chroot</strong></span> and <span><strong class="command">Setuid</strong></span>
the "<code class="option">-t</code>" option for <span><strong class="command">named</strong></span>.
ability to run the daemon as an unprivileged user ( <code class="option">-u</code> <em class="replaceable"><code>user</code></em> ).
We suggest running as an unprivileged user when using the <span><strong class="command">chroot</strong></span> feature.
Here is an example command line to load <acronym class="acronym">BIND</acronym> in a <span><strong class="command">chroot</strong></span> sandbox,
<span><strong class="command">/var/named</strong></span>, and to run <span><strong class="command">named</strong></span> <span><strong class="command">setuid</strong></span> to
<a name="id2602123"></a>The <span><strong class="command">chroot</strong></span> Environment</h3></div></div></div>
From <acronym class="acronym">BIND</acronym>'s point of view, <code class="filename">/var/named</code> is
like <span><strong class="command">directory</strong></span> and <span><strong class="command">pid-file</strong></span> to account
<span class="emphasis"><em>not</em></span> need to compile <span><strong class="command">named</strong></span>
<a name="id2602183"></a>Using the <span><strong class="command">setuid</strong></span> Function</h3></div></div></div>