BRIDGING FIREWALLS
Why a bridging firewall?
Excellent question.

Firstly, we needed a firewall. Having a network directly accessible by the world in general is suicide. Our network is filled with a diverse array of machines, of different eras, operating systems and versions. We can't keep up with the security patches on everything and while we try to, some things slip through the cracks. We get sucessfully hacked about once every six months which is a pretty poor record, plus there are countless attacks on the system. Sure, a firewall is not the be all and end all of security, but it would have stopped most of the attempts and on the attempts that were successful, it probably would have lessened the impact.

With firewalls, you have various options. If you are setting up a network from scratch, its easy, you can configure things around the firewall. However, our network is well established and has about six hundred machines sitting on it. None of us were keen on going around to every machine and reconfiguring it.

We do not handle our own gateways, they are handled by the University's Communication Services. While we can take over control of them if we need to, its much easier to leave that responsibility with UCS.

The solution was a nifty thing called a bridging firewall. The firewall itself is transparent on the network. It just sits in between two points on the network and does the firewalling. You don't need to change any network settings, don't need to reconfigure any machine and if something goes horribly wrong, you can pull the firewall out just by changing patch leads. This had a lot of appeal to me.


What hardware do I need?
Another big attraction of the bridging firewall is you don't need anything too special to run it on. Currently I've got three systems, two in production and one for testing. The testing machine is a Celeron 366Mhz, 64Mb RAM and a 10G disk. One of the production machines is a 400Mhz Pentium II, 128Mb RAM and a 4G HD; the other is a 1Ghz Celeron, 256Mb RAM and a 40G disk. Definately nothing out of the ordinary.

My production computers each have three network cards in it while my test system has two. I'm currently using Intel Pro 100 adaptors. When I started this, I tried the DEC Tulip cards, but I was running into problems them. The first one I tried was hardwired to 10Mb/s, half duplex, which is not good if you're after as much throughput as possible. The next card worked well, but the system locked up when the bridging code was loaded and I traced that back to the tulip module. It was easier to stop using the card rather than try to figure out where the problem was. Finally, I do have a 10Mb 3Com 3C590 NIC in one machine as a controller card, but more on that later.


And what software?
I'm using Linux. Redhat 7.1 on one machine and 7.3 on the other two. The firewalling code I'm using is IPTables, so if you want to use that, you'll need a kernel of at least 2.4 or later. My first production machine is still running 2.4.17 as that was the latest stable release at the time, but now I've moved up to version 2.4.18. On top of that, before you compile the kernel, you'll need to patch it with some code. But there is more on that later.




How do I get it working?
Ok, here is my little walk-through of installing the bridging firewall. It assumes you have a vague idea of linux, but you don't need an advanced understanding.



Putting it all together:
Lets assume your kernel works correctly and everything is hunky-dory. You now need to get your firewall working. This comes in three steps: Before we go any further, make sure you have the brctl tools compiled and installed on your system. They should be available from the
http://bridge.sourceforge.com page. I like to put the compiled files in /usr/local/sbin/ so they're in my path. Lets assume you've got the file which is called bridge-utils-0_9_5_tar.gz to uncompress and compile it type the following:


Conclusion:
Well, that is how I set up my firewall. Actually, we have more rules because we allow more things through, but you don't want to say what you allow and deny in a public forum. You don't want to make it too easy for someone to break in.

An important thing to remember, having a firewall is no guarentee of protection, sometimes a badly configured firewall can be more damaging than no firewall at all. I would recommend having a firewall as a step in your network. Make it a high step, so not everything gets past it, but don't assume that just because you've got one, you are now invincable. You still need good security policies and a healthy does of paranoia.

Keep logs and review them regularly. Fine, you've got a firewall in place, congradulations. After you've been hacked, you may decide to look over the logs and discover a methodical scanning of your network by your hacker. If you had looked sooner, you may have been able to protect it.

Trust no-one. In the example above, I allow everyone to connect out, this assumes I am an extremely trustworth person. What I would like to do is only allow certain IP addresses to connect out or maybe only allow certain ports out. That way, if you are hacked, the hacker may be able to get in, but not out again.

Put the firewall in a physically secure place. Great, you've got a firewall, but having it sitting in the open where anyone can get to it is not having it secure.

Pay attention to security bulletins and patches. This come out for all the time, for all operating systems. Not only should you try to keep your firewall patched to the latest stable secure release, but if there is a known security bug associated with port 412 filter that port, why let through a potential risk? That assumes you have legitimate use of port 412. This goes with trojans and backdoor programs as well. There are numerious sites out there listing port numbers of suspicious programs. I log anything that scans those port (then drop the packet) just so I have an idea of who is poking around my network.

Have a plan in place. Chances are, one day you will get hacked. What will you do if you are? How do you know which machines have been compromised? Who do you notify? How do you check the integrity of the system? Establish the answers to questions like this before you have to answer them, not while tech support is running around panicking.

Sleep, drink and be merry. With all this doom and gloom I'm preaching, you probably need to lighten up a little :)

Cheers, Ryan.



Links:

Here are some of the links I've found useful in building my firewall.

http://www.iptables.org/
center> The iptables home page. Go here for the latest updates in the iptables source or any patches you should be aware of.
http://www.iana.org/assignments/port-numbers
The official IANA [Internet Assigned Numbers Authority] port name/number assignments (very large list; approx 460k text file)
http://bridge.sourceforge.net/
The Sourceforge Bridge page. This is where to go to get any patches or latest releases. I highly recommend going here and reading everything they have before starting. You will need to go here to download the patches you need.
iptables-tutorial
A iptables tutorial (web form) there are also other formats available. A good, comprehensive guide.
Rusty's iptables how-to guide. Highly recommended reading.
http://www.bastille-linux.org/jay/
Jay's page on linux security in general
http://www.cs.princeton.edu/~jns/security/iptables/
A page similar to this one on firewalls. Why didn't I see this page before I started working on this one?
www.kernel.org
The linux kernel site. Go here to find the status of the latest kernel (but download it from a local mirror)
www.google.com
Google. A search engine, so you can look up anything you didn't understand




Back to Tech index
Back to main index