Handling firewalls

ANALYSIS
In the process of filtering Internet traffic, all firewalls have some type of logging feature that documents how the firewall handled various types of traffic. These logs can provide valuable information, but they can also be difficult to monitor and manage on a consistent basis. In this article, I'll try to cover the essentials of firewall logging:
  • What to log
  • Where to log
  • Alerts and notifications
  • What data is valuable?
What to log
As a general principle, you should log all inbound connections. This is the first step in auditing your firewall rules to verify that you've correctly configured that part of your firewall. Regardless of whether a connection succeeds or fails, you should know who is trying to connect to your internal systems. It does no good to deny services and stand blindly by while someone beats at your network door. As for outbound connections, this is a security policy and legal issue. You should identify any high-profile targets for attacks and any systems that should not originate outbound connections from inside your network (e.g., Web servers, SQL servers, etc.) and log all of their traffic regardless of success or failure. Also, your organisation can be held legally responsible for employee activities while browsing the Web. Therefore, it is essential to monitor Web usage and control access to restricted sites (e.g., porn, hacking, hate groups, etc.). You should also log all rejected connections. This would be traffic that appears to be from another IP space that originates from inside your network. This is usually a good indication that someone has decided to hack on company time or a system has been compromised. Finally, if your firewall is software-based, you should audit every system and application failure and every success and failure of security. If your firewall becomes compromised, this might be the only clue as to when and how the event happened. Where to log
Your log files will typically be stored on the firewall itself, but they should be moved either automatically or manually to another secure location on your network on a set schedule. These logs should then be written to some type of backup media (tape or CD, for example) and stored in a secure location for analysis in the event of an attack or a physical disaster. Leaving the logs on your firewall is an invitation for an attacker to tamper with them, or even worse, to flood the logs and cause the system to halt. The attacker may not gain access to the system (most firewalls fail to a closed position and don't allow traffic), but this is a crude form of denial of service (DoS). Alerts and notifications
Alerts and notifications can be configured in a variety of ways and for a variety of events. Most firewalls support automatic alert notification, but deciding how to be notified and what should trigger an alert is something that should be covered in your security policy. The most commonly used notification methods are as follows:
  • Audio notification:This plays an audio alert on the firewall system. It can be useful if an IT professional sits near the firewall itself.
  • Mail notification:This e-mails the text of the log file to designated individuals. Typically, this is done in clear text and can be extremely useful information for attackers if it is sent over a public network.
  • Pager notification:This approach transmits a message to a designated paging device. This is extremely useful for organisations that aren't staffed 24 hours a day.
  • Client notification:This launches a client program. Like a net send message, this is useful only if the recipient is logged on and is looking at his or her computer screen.
  • SNMP notification:This sends an SNMP trap containing alert messages to network management stations. If you run a NOC or a central monitoring facility, this will probably be your primary method of notification.

At a minimum, alerts should be triggered by the following events:
  • Unsuccessful user and host login attempts: This helps you see who is trying to compromise your security.
  • Firewall rules being modified or disabled: This shows you who is trying to circumvent your security.
  • Successful logins to the firewall system: See when someone is logging into the firewall.
  • Critical events: This includes system reboots, system failures, etc.
  • Significant data events: You should know when your system is being probed and when it is under a concerted attack.

What data is valuable?
Probes to ports that have no application services running on them: Before hackers install backdoor Trojan horse programs, they determine which ports you're already using for another service. If you see a lot of probes to suspicious ports (Doshelp.com maintains a fairly up-to-date list of Trojan ports), look up the port and find out what they're doing and verify that you're protected. Unsuccessful access attempts to your firewall and/or other high-profile systems: If you notice repeated unsuccessful attempts to access your firewall and other systems from one IP address (or group of IP addresses), then you might want to write a rule to drop all connections from that IP space (making sure that the IP address isn't being spoofed). IP addresses of the connections that are being rejected and dropped: If the IP address is spoofed, you won't be able to find the owner. Otherwise, you should resolve the domain using a "Who Is" database, contact the owner, and find out why someone from their IP space is trying to attack your systems. Suspicious outbound connections: Outbound connections coming from internal servers such as your Web servers could be an indication that a hacker is using your systems to launch attacks against other organisations or individuals. External packets with internal IP addresses:Packets with a source address internal to your network that originate from outside your network indicate that a hacker is spoofing your internal addresses to attempt to gain access to your internal network. Final word
If you read the log files every day, you'll know what connections are typical and what connections are out of the ordinary for your network. If you notice strange events and don't know what to make of them, go to the Web and research the events and/or search through your firewall vendor's FAQ to establish whether you should take any action. If your initial research comes up empty, then you should contact your firewall vendor's tech support or get in touch with a security consultant.

Have your say instantly in the Tech Update forum. Find out what's where in the new Tech Update with our Guided Tour. Let the editors know what you think in the Mailroom.

Post your comment

In order to post a comment you need to be registered and logged in.

You can also log in with Facebook. Log in or create your ZDNet UK account below

  • Login

Will not be displayed with your comment

By signing up for this service, you indicate that you agree to our Terms and Conditions and have read and understood our Privacy Policy. Questions about membership? Find the answers in the Community FAQ

Get ZDNet UK's daily newsletter

Enter your email address to sign up

ZDNet UK Live

BrownieBoy

@Jack, > Works really well for thieves.... Nice attempt to deflect the argument by tossing in a point that's totally irrelevant, even it were...

9 hours ago by BrownieBoy on AMD Ultrathins to challenge Intel Ultrabooks
bootlegger

Make that 13 people now - I got refused today at Manchester airport. I thought I was up to date on this legislation - I knew of the EU ruling from...

12 hours ago by bootlegger on UK airport body scans will not be opt out
tinycg

Don't forget to check out apps like GoodReader or SlideShark either, they're indispensible for people on the go in presentation situations. Best...

14 hours ago by tinycg on Four top iPad apps for people on the move
TerryRK

Well it seems there is something a number of us agree on. Why is the Ubuntu Unity launcher so ugly? I thought perhaps it was something to do with...

19 hours ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
Freebies202

Duplicate comments are not made intentionally. Its very good to know that now you are keeping check on this problem because sometimes a commenter...

1 day ago by Freebies202 on Microsoft fixes blog comments, speeds up blogs with open source
kevinmchapman

"the very significant number of users" and "many (most) of us" - you have no evidence for these statements. It is a fact that most users are saying...

2 days ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
Marg Menzies Harrison

Another grammar faux pas is the improper use of "you". When sitting down down in a restaurant, for example, I get cringe when the waitress...

2 days ago by Marg Menzies Harrison via Facebook on 10 flagrant grammar mistakes that make you look stupid
zdnetukuser

And NOW, folks, for Canonical's next trick... Kubuntu is late. Here's a pencil. Draw your own conclusions. cf.:...

2 days ago by zdnetukuser on Linux Minterface
Moley

@kevinmchapman. The discussion here reflects the very significant number of users who really do like the traditional menu system and who wish to...

2 days ago by Moley on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

Er, no... It is an efficient means of finding the application/file/setting you need in one place. The icons are a simply a fallback for when you...

2 days ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

Isn't the provision of a text based search an admission by the developers that the mass of icons approach does not work? I don't need to use a...

2 days ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
kevinmchapman

"Unity and GNOME 3 both abandon the old text-based cascading menus in favour of a graphical icon-driven system." Point truly missed. Both use a...

2 days ago by kevinmchapman on A tale of two distros: Ubuntu and Linux Mint
TerryRK

whs001 - Thank you, I'm glad you liked the article. I absolutely agree with you on your first point. I should perhaps have made it clearer that...

2 days ago by TerryRK on A tale of two distros: Ubuntu and Linux Mint
Dennis Nilsson

If we allow corporate interest to dictate the way our government circumvents due process against foreign entities then we should accept the same...

2 days ago by Dennis Nilsson via Facebook on ACTA stumbles in Germany
GHar123

I totally dislike pirating of works, I fear that artists will be deterred from creating works if they think that they are going to get ripped off....

2 days ago by GHar123 on ACTA stumbles in Germany
JCB33

How dare film makers, artists or anybody that invests in creativity stop us pirating their works for free. I want to be able to walk into my local...

2 days ago by JCB33 on ACTA stumbles in Germany
Moley

@GrueMaster. I prefer horses for courses rather than one size fits all. I, and I suspect most other computer users, do not really wish to have...

2 days ago by Moley on A tale of two distros: Ubuntu and Linux Mint
greycynic

The product that scares me every time I have to use it is the Office 2007 version of Excel. The first bug that I found was applying the median...

2 days ago by greycynic on Ten flawed products that derail productivity
GrueMaster

Nice review and very informative. One thing I'd like to add (in reply to whs001's 1st question), the main reason to have the same interface from...

2 days ago by GrueMaster on A tale of two distros: Ubuntu and Linux Mint
Frederick Wrigley

I'be been using Mint 12 since the RC came out, and I am far more happy with the Cinnamon, the Mate, and, yes (with extensions), theGnome 3...

2 days ago by Frederick Wrigley via Facebook on A tale of two distros: Ubuntu and Linux Mint