Initial Configuration and Tuning

Spending some time pruning the rules and features that Snort uses pays dividends. Your decisions in this phase of tuning have the potential to make your life as an administrator much easier. Be careful, though. Mistakes at this point have serious consequences. There are some easy, low-risk things you can do, however. The suggestions below provide a place to start and will help address the majority of the sources of false positives. As an administrator is able to establish a baseline for what is "normal" for the way their network is used, further tuning and customization is possible. It should be mentioned that when you make changes to the snort.conf file or the rules, you must stop the Snort process and restart it for the changes to take effect.

Anyone who watches a network with a connection to the Internet will tell you that the volume of port-scanning traffic, worm-related attempted exploits, and scripted attacks against arbitrary ranges of addresses is constantly increasing. A Snort sensor watching this traffic generates many alerts—particularly the portscan components. While the alerts generated as a result of this traffic might be an indicator of the initial phazes of an attack, the usefulness of these alerts is questionable given their volume. Tracking down the source may be difficult, too—particularly if the system is located in another country. Sometimes the source is a worm-infected workstation sitting behind a shared IP address. While it might be possible to track the source to a particular organization, the work involved in notifying that organization of the infected system (and the time that you spend explaining how you noticed and how to find the offending system) is a drain on your resources.

When configured to monitor the Internet connection for an organization, many Snort preprocessor settings are vestigial and really only serve to generate false (or relatively low-value) alerts. Some of the preprocessors alert on packet anomalies that are not of significant concern when trying to detect attackers. Many of these alerts can be eliminated by making changes to the preprocessor options in the snort.conf file. (These alerts can be useful when the Snort sensor is being used for more than just intrusion detection.)

In Chapter 6, sensor placement strategies were discussed that can help manage the type of traffic the sensor watches. For instance, if the sensor is placed behind the firewall instead of on the public side, the firewall will de-fragment packets (fragmenting packets is a common IDS evasion technique). One of the most CPU-intensive preprocessors is the frag2 preprocessor, which rebuilds these fragmented packets. If the sensor is behind the firewall, this preprocessor can be disabled.

Below are some changes that can be made to the snort.conf file to eliminate many common false positives.

While the alerts that this preprocessor generates can be interesting when troubleshooting some web proxy server or network infrastructure problems, it is largely just noisy. It is best not to just disable the preprocessor, though. The suggestions in Chapter 5 shows how to tune this component for the web servers in your environment. The assistance it provides in allowing web traffic to be inspected is very valuable, but some network configurations result in thousands of false positives. To disable alerting for this preprocessor, add the no_alerts configuration to the line. The modified default line from snort.conf file is below:

preprocessor http_inspect_server: server default \
    profile all ports { 80 8080 8180 } oversize_dir_length 500 no_alerts

Here are some guidelines for tailoring your rule sets.

By default, the following rules are disabled (as mentioned in Chapter 7, you can disable a set of rules contained in a .rules file by using a # as the first character of the line or deleting the entire line in the snort.conf file). For most applications, it is best to leave these disabled.

# web-attacks.rules
# backdoor.rules
# shellcode.rules
# policy.rules
# porn.rules
# info.rules
# icmp-info.rules
# virus.rules
# chat.rules
# multimedia.rules
# p2p.rules

The following are sources of false positives and can be disabled in most deployments. Before disabling the misc.rules file, read through it. Some of the alerts provide warnings for suspected worm activity. You may elect to disable individual rules themselves, leaving the worm-related rules operational (see Section 9.3.2.2, below):

# icmp.rules
# misc.rules
# nntp.rules
# finger.rules

If you are not running a Coldfusion application server, disable the following rule set:

# web-coldfusion.rules

If you are not running FrontPage Extensions on any web servers in your environment, disable the following rule set:

# web-frontpage.rules

If you are not running PHP application services in your environment, disable the following rule set:

# web-php.rules

If you are not running an Oracle database in your environment, disable the following rule set:

# oracle.rules

If you are not running a mySQL database in your environment, disable the following rule set:

# mysql.rules

If you are not running a Microsoft SQL Server in your environment, disable the following rule set:

# sql.rules

If you do not have Unix systems in your environment, disable the following rule sets:

# rpc.rules
# rservices.rules
# x11.rules

If you do not have Microsoft Windows systems in your environment, disable the following rule set:

# netbios.rules

If you do not run an Apache web server in your environment, disable the following rule set:

# web-cgi.rules

If you do not run a Microsoft Internet Information Services (IIS) web server in your environment, disable the following rule set:

# web-iis.rules

The following rules sets are useful and result in false positives less often than most (keep these enabled in most environments):

exploit.rules
dos.rules
ddos.rules
attack-responses.rules