Snort: Planning IDS for Your Enterprise

There was a time when IT professionals questioned the need for an intrusion detection system (IDS). Most people then thought that a firewall was adequate protection against malicious attacks. Security has now evolved to a point where there is a widespread awareness in the IT community regarding the need for IDS. One such IDS is Snort. Snort is a free, small, highly configurable and portable networ
Running Snort

Snort can be run as a packet sniffer, packet logger and as an NIDS. When Snort is run as a packet sniffer, TCP/UDP/ICMP header information and application data is dumped on the standard output:

# Snort -vd

As a packet logger, Snort logs application and protocol header information to /var/log/today.log:

# Snort -dev -l /var/log/today.log

As an NIDS, Snort listens on the le0 interface and uses /etc/Snort.rules as its configuration file and runs Snort in dæmon mode:

# Snort -D -i le0 -c /etc/Snort.rules

Snort does not evaluate the rules in the order that they appear in the Snort rules file. All actions specified in the Snort rules file are evaluated in the order of Alert, Pass and Log by default. If you wish to change this order to Pass, Alert, Log, use the -o command-line flag. The -A option specifies the alert mode. There are four choices here: full, fast, none and unsock. The full, fast and none options are rather obvious. The unsock option provides Snort the ability to write to UNIX sockets where a program listening on that socket may process the alerts. Details of these options are available in the Snort man pages. With Snort alert modes, you will have the ability to specify the detail that you wish to view in your alert messages.

Be sure to validate your snort configuration. To validate, we must revisit the IDS policy. A few rules of thumb to validate your IDS are provided. Based on the IDS policy, you could launch specific tests and observe logs and alerts. For our policy listed above, we could launch Telnet, FTP and finger. You could use tools such as a scanner. Publicly available scanners, such as nmap, are good ones. Commercial scanners such as Cybercop from Network Associates and ISS scanner from Internet Security Systems can help you automate the process as well. Netcat, available from, is another great utility. Finally, you could use several scripts written for script kiddies to launch attacks against your own infrastructure. However, tread cautiously, as running those scripts implies that you trust those scripts. Listing 2 shows a few sample alerts. It shows three common attacks: IIS Unicode attack, SYN/FIn Scan and a portscan.

Listing 2. Common Snort Alerts


First it was the sophisticated hacker, then came the script kiddy and distributed denial of service (DOS) attacks. Today's IT infrastructure and business assets are under constant threat of unauthorized access. Firewalls were the primary mechanism to shield against attacks on corporate assets during the early 1990s. Modern security architectures are increasingly including IDSes. Snort provides a very cost effective alternative to commercial IDSes.

Once compiled and installed, Snort can be run as a sniffer, packet logger and a network based IDS. Snort is easy to configure and provides multiple output modules for alerting and logging. Plugin modules developed by the Snort community further enhance Snort's ability. If you were able to get Snort up and running, watch your logs and alerts to gain insight into the type of traffic captured by Snort!


Nalneesh Gaur is a Technical Solutions Engineer with Digital Island in Dallas, Texas. He works with Fortune 500 companies to provide them with solutions in the area of content delivery and web hosting.


Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

Upcoming Webinar
8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
11am CDT, April 29th
Moderated by Linux Journal Contributor Mike Diehl

Sign up now

Sponsored by Skybot