2.9 Isolate BIND with chroot'ed Subdirectory

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

Information

The chroot() system call causes an application to run with limited file system access so that a subdirectory becomes the root directory for the application environment. When this is done, the application is ??????ailed????? and no longer has access to the entire file structure but is limited to the given subdirectory.

Rationale:

Although there are ways that a chroot jail can be broken, most methods require that a process be running as root in order to escape. Since BIND should be run as a different user than root, a chroot is an effective defense, to limit access to sensitive system configuration files. In the event that BIND has a vulnerability that allows code execution, the attack will not have access to the real system files such as /etc/password, but will be limited to the files placed in the chroot subdirectory.

Solution

Perform the following:

- Stop the named service and install the bind-chroot package to provide the chroot directories.

# systemctl stop named.service
# yum install bind-chroot

- Edit the /etc/sysconfig/named configuration file to have a line similar to the one shown below that sets the ROOTDIR environment variable.

ROOTDIR="/var/named/chroot"

- Move all the configuration files and any master zone files into their respective directions under the subdirectory /var/named/chroot/??
- It may be helpful to create symbolic links from a couple of system /etc files such as /etc/named.conf and /etc/rndc.key to the real files in the chroot-ed subdirectory, so that utilities like rndc will work as expected. Do not create symbolic links or hard links from inside the chroot to external resources! Instead use symbolic links to point from the outside resources into the chroot.
- Restart the named service and test the configuration.

# systemctl start named.service

Default Value:

The BIND service is not chroot'ed by default.

3 Restricting Queries

Recommendations in this section pertain to configurable access control mechanisms that are available in ISC BIND to restrict queries.

See Also

https://benchmarks.cisecurity.org/downloads/show-single/?file=bind.300

Item Details

Category: ACCESS CONTROL

References: 800-53|AC-6

Plugin: Unix

Control ID: 7fca9b0326bedc1cd8d1bb7223f0130891e7c2c2b32ae4cb112309fd29008857