

Use the right rules in your firewall

How should an administrator determine what rules to set up in a particular firewall?

The best way to go about setting up your rules is to document your requirements in detail. For host firewalls, I tend to identify three types of rules -- incoming traffic flow rules, outgoing traffic flow rules and defensive rules.

Incoming and outgoing traffic flow rules are the traffic flows used by your applications and operating system. You should document their source, destination, ports and any other useful characteristics about them. Lay them out in tables or in a spreadsheet to allow you to better visual and keep track of them. You should also try to "lock" down your rules. If it is possible to limit the source or destination of traffic flow, then do so. For example, if you only need to access two DNS servers then you can write rules to ensure traffic on port 53 can only go to those DNS servers.

Defensive rules consist of rules designed to counter known network-based attacks, scanning and other forms of malicious traffic. There are a variety of these available to you. Many of them are documented in various iptables scripts or sites online. These include rules to counteract network and port scans, SYN/ACK attacks, SYN flooding and other types of malicious traffic. These change on a regular basis so you need to keep up with current attacks and counters. You also need to extensively test these sorts of rules. In the past, badly coded applications have occasionally behaved like attack or scanning tools and had their traffic blocked by these types of rules.

This was last published in August 2005

Dig Deeper on Linux system security best practices

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.


Please create a username to comment.