Bv9ARM.ch07.html revision b4556ecdbc3cad55e1c85ce32b73b7bcd39e43dc
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - Copyright (C) 2004-2015 Internet Systems Consortium, Inc. ("ISC")
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - Copyright (C) 2000-2003 Internet Software Consortium.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - Permission to use, copy, modify, and/or distribute this software for any
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - purpose with or without fee is hereby granted, provided that the above
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - copyright notice and this permission notice appear in all copies.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
ef6648a7917a74b386ded70f1d799becd7b74386ugaston - PERFORMANCE OF THIS SOFTWARE.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<!-- $Id$ -->
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<title>Chapter�7.�BIND 9 Security Considerations</title>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<meta name="generator" content="DocBook XSL Stylesheets V1.71.1">
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<link rel="start" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<link rel="up" href="Bv9ARM.html" title="BIND 9 Administrator Reference Manual">
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<link rel="prev" href="Bv9ARM.ch06.html" title="Chapter�6.�BIND 9 Configuration Reference">
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<link rel="next" href="Bv9ARM.ch08.html" title="Chapter�8.�Troubleshooting">
d81f6d00c343633159fc5ea08599d145135612c0ludovicp<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<tr><th colspan="3" align="center">Chapter�7.�<acronym class="acronym">BIND</acronym> 9 Security Considerations</th></tr>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<a accesskey="p" href="Bv9ARM.ch06.html">Prev</a>�</td>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<td width="20%" align="right">�<a accesskey="n" href="Bv9ARM.ch08.html">Next</a>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<a name="Bv9ARM.ch07"></a>Chapter�7.�<acronym class="acronym">BIND</acronym> 9 Security Considerations</h2></div></div></div>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<dt><span class="sect1"><a href="Bv9ARM.ch07.html#Access_Control_Lists">Access Control Lists</a></span></dt>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<dt><span class="sect1"><a href="Bv9ARM.ch07.html#id2607424"><span><strong class="command">Chroot</strong></span> and <span><strong class="command">Setuid</strong></span></a></span></dt>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<dt><span class="sect2"><a href="Bv9ARM.ch07.html#id2607573">The <span><strong class="command">chroot</strong></span> Environment</a></span></dt>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<dt><span class="sect2"><a href="Bv9ARM.ch07.html#id2607633">Using the <span><strong class="command">setuid</strong></span> Function</a></span></dt>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<dt><span class="sect1"><a href="Bv9ARM.ch07.html#dynamic_update_security">Dynamic Update Security</a></span></dt>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<div class="titlepage"><div><div><h2 class="title" style="clear: both">
ef6648a7917a74b386ded70f1d799becd7b74386ugaston<a name="Access_Control_Lists"></a>Access Control Lists</h2></div></div></div>
ef6648a7917a74b386ded70f1d799becd7b74386ugaston Access Control Lists (ACLs) are address match lists that
ef6648a7917a74b386ded70f1d799becd7b74386ugaston you can set up and nickname for future use in
ef6648a7917a74b386ded70f1d799becd7b74386ugaston <span><strong class="command">allow-notify</strong></span>, <span><strong class="command">allow-query</strong></span>,
ef6648a7917a74b386ded70f1d799becd7b74386ugaston <span><strong class="command">allow-query-on</strong></span>, <span><strong class="command">allow-recursion</strong></span>,
ef6648a7917a74b386ded70f1d799becd7b74386ugaston <span><strong class="command">blackhole</strong></span>, <span><strong class="command">allow-transfer</strong></span>,
ef6648a7917a74b386ded70f1d799becd7b74386ugaston <span><strong class="command">match-clients</strong></span>, etc.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston Using ACLs allows you to have finer control over who can access
ef6648a7917a74b386ded70f1d799becd7b74386ugaston your name server, without cluttering up your config files with huge
ef6648a7917a74b386ded70f1d799becd7b74386ugaston lists of IP addresses.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston It is a <span class="emphasis"><em>good idea</em></span> to use ACLs, and to
ef6648a7917a74b386ded70f1d799becd7b74386ugaston control access to your server. Limiting access to your server by
ef6648a7917a74b386ded70f1d799becd7b74386ugaston outside parties can help prevent spoofing and denial of service
ef6648a7917a74b386ded70f1d799becd7b74386ugaston (DoS) attacks against your server.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston ACLs match clients on the basis of up to three characteristics:
ef6648a7917a74b386ded70f1d799becd7b74386ugaston 1) The client's IP address; 2) the TSIG or SIG(0) key that was
ef6648a7917a74b386ded70f1d799becd7b74386ugaston used to sign the request, if any; and 3) an address prefix
ef6648a7917a74b386ded70f1d799becd7b74386ugaston encoded in an EDNS Client Subnet option, if any.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston Here is an example of ACLs based on client addresses:
ef6648a7917a74b386ded70f1d799becd7b74386ugaston// Set up an ACL named "bogusnets" that will block
ef6648a7917a74b386ded70f1d799becd7b74386ugaston// RFC1918 space and some reserved space, which is
ef6648a7917a74b386ded70f1d799becd7b74386ugaston// commonly used in spoofing attacks.
ef6648a7917a74b386ded70f1d799becd7b74386ugastonacl bogusnets {
ef6648a7917a74b386ded70f1d799becd7b74386ugaston// Set up an ACL called our-nets. Replace this with the
ef6648a7917a74b386ded70f1d799becd7b74386ugaston// real IP numbers.
ef6648a7917a74b386ded70f1d799becd7b74386ugaston allow-query { our-nets; };
ef6648a7917a74b386ded70f1d799becd7b74386ugaston allow-recursion { our-nets; };
ef6648a7917a74b386ded70f1d799becd7b74386ugaston blackhole { bogusnets; };
ef6648a7917a74b386ded70f1d799becd7b74386ugaston type master;
ef6648a7917a74b386ded70f1d799becd7b74386ugaston allow-query { any; };
ef6648a7917a74b386ded70f1d799becd7b74386ugaston This allows authoritative queries for "example.com" from any
ef6648a7917a74b386ded70f1d799becd7b74386ugaston address, but recursive queries only from the networks specified
ef6648a7917a74b386ded70f1d799becd7b74386ugaston in "our-nets", and no queries at all from the networks
ef6648a7917a74b386ded70f1d799becd7b74386ugaston specified in "bogusnets".
ef6648a7917a74b386ded70f1d799becd7b74386ugaston In addition to network addresses and prefixes, which are
<span><strong class="command">geoip [<span class="optional">db <em class="replaceable"><code>database</code></em></span>] <em class="replaceable"><code>field</code></em> <em class="replaceable"><code>value</code></em></strong></span>
used, otherwise the full description must be used (e.g.
and searches for region (i.e., state or province) can be
<a name="id2607424"></a><span><strong class="command">Chroot</strong></span> and <span><strong class="command">Setuid</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="id2607573"></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="id2607633"></a>Using the <span><strong class="command">setuid</strong></span> Function</h3></div></div></div>