The purpose of this document is to describe the integration process for ThreatSTOP DNS Firewall into an existing BIND 9.8+ deployment. This document is written under the condition that you have an existing VM deployed with BIND 9.8+ installed and are looking to add ThreatSTOP protection to your existing network infrastructure.
Deploying and Configuring BIND
The following procedure will provide a default install of BIND (BIND 9.8.2 and greater). This has been shown to work in testing by ThreatSTOP resources, and should provide a working installation in your environment. After successfully deploying the installation and configuring logging you should be able to simply use this box as a drop-in replacement for your existing DNS server, and will automatically receive the ThreatSTOP protection policy you've chosen in the ThreatSTOP portal.
Download and Install BIND
To start we'll need to download and install BIND. To do this:
Login to your administrator account, and elevate your access level (if not already logged in and granted elevated privileges). To do this, login and enter:
Next we'll need to download and install BIND and it's utilities, this can be done with the command:For Debian based distros (Debian, Ubuntu, etc.):For Red Hat based distros (RHEL, CentOS, etc.)
Next we'll need to enable and start bind with the following command:For Debian based distros (Debian, Ubuntu, etc.):
sudo /usr/sbin/services restart namedFor Red Hat based distros (RHEL, CentOS, etc.)
Then verify that things went according to plan by checking the logs:
Check the installed version matches at least 9.8.2 for example:
Create directories and set permissions
To prepare for our incoming zone files we need to make a little room for them in the file system, to do this:
Make a directory for the zone files using the following command
Set permissions and ownership of the zone directory to BIND
Make a directory for the named log files using the following command:
Set permissions and ownership for the log file directory:
Edit BIND config files
Next we'll start configuring BIND itself, to do this we'll need a gather a few pieces of information, and drop them into the appropriate places in the configuration file. We'll need:
The device's internal IP address. You can gather this with the following command at the command prompt:For Debian based distros (Debian, Ubuntu, etc.)For Red Hat based distros (RHEL, CentOS 7+, etc.)
This will list all available network devices, note the inet address for the interface with which you want your other network devices to communicate.
CentOS 6.8 uses the
ifconfigcommand to gather network information.
We need the device's external IP address, you can get this using this command from the device:
The policy name for your device. Which is provided here for reference, and should also appear in the configuration data below in bold.
The secret key for your RPZ, this is provided by the ThreatSTOP Sales team during your sign-up.
Let's start editing the configuration files to get you up and running:
We need to start by editing /etc/named.conf to match the following:
The 192.0.2.0 address below will need to be replaced with the IP address gathered with the ifconfig command above.
Create /etc/named.conf.options using the command
vi /etc/named.conf.optionsthen edit it to match the following:
Create /etc/named.conf.local using the command
vi /etc/named.conf.localand then add the following:
The provided TSIG key is only valid for trial accounts and will change for paid accounts.
Set ownership on files:
Set named to start on boot:
setsebool to write the zone file to filesystem:
To test that your configuration is up and running you'll need to setup a temporary test policy in the ThreatSTOP portal. Any policy added to this list should have the RPZ behavior set to NXDOMAIN or DROP. After setting this: