10.1 Address Match Lists and ACLs
Before we introduce the new features,
however, we'd better cover address match lists. BIND 8 and 9
use address match lists for nearly every security feature and for
some features that aren't security-related at all.
An address match list is a list (what else?) of terms that specifies
one or more IP addresses. The elements in the list can be individual
IP addresses, IP prefixes, or a named address match list (more on
those shortly). An IP
prefix has the format:
network in dotted-octet format/bits in netmask
For example, the network 15.0.0.0 with the network mask 255.0.0.0
(eight contiguous ones) would be written 15/8. Traditionally, this
would have been thought of as the "class A" network 15.
The network consisting of IP addresses 192.168.1.192 through
192.168.1.255, on the other hand, would be written 192.168.1.192/26
(network 192.168.1.192 with the netmask 255.255.255.192, which has 26
contiguous ones). Here's an address match list comprising those
two networks:
15/8; 192.168.1.192/26;
A named address match list is just that: an address match list with a
name. To be used within another address match list, a named address
match list must have been previously defined in named.conf
with an acl statement.
The acl statement has a simple syntax:
acl name { address_match_list; };
This just makes the name equivalent to that address match list from
now on. Although the name of the statement, acl,
suggests "
access control list," you can use the
named address match list anywhere an address match list is accepted,
including some places that don't have anything to do with
access control.
Any time you're going to use one or more of the same terms in a
few access control lists, it's a good idea to use an
acl statement to associate them with a name. You
can then refer to the name in the address match list. For example,
let's call 15/8 what it is: "HP-NET." And
we'll call 192.168.1.192/26 "internal":
acl "HP-NET" { 15/8; };
acl "internal" { 192.168.1.192/26; };
Now we can refer to these address match lists by name in other
address match lists. This not only cuts down on typing, but it makes
the resulting named.conf file more readable.
We prudently enclosed the names of our ACLs in quotes to avoid
collisions with words BIND reserves for
its own use. If you're sure your ACL names don't conflict
with reserved words, you don't need the quotes.
There are four predefined named address match lists:
- none
No IP addresses
- any
All IP addresses
- localhost
Any of the IP addresses of the local host
(i.e., the one running the name server)
- localnets
Any of the networks the local host has a
network interface on (found by using each network interface's
IP address and using the netmask to mask off the host bits in the
address)
|