This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: Tools & Utilities

Set up your firewall with Firewall Builder

By Ben Martin on August 14, 2008 (9:00:00 AM)

Share    Print    Comments   

Firewall Builder (fwbuilder) is a graphical application that can help you to configure IP traffic filtering. It can compile the filtering policy you define into many specifications, including iptables and various languages used by Cisco and Linksys routers. Separating the actual policy you define and the implementation in this way should let you change what hardware is running your firewall without having to redefine your policy for that platform.

Packages for fwbuilder are available in the Ubuntu Hardy and Fedora 9 repositories. fwbuilder is packaged as a 1-Click install for openSUSE 10.3, but not for version 11 as yet. In this article I'll build from source on a 64-bit Fedora 9 machine using fwbuilder version 2.1.19. fwbuilder is shipped as two tarballs: libfwbuilder and fwbuilder. You have to install the library first. Install the two packages using the normal ./configure; make; sudo make install procedure. I found the below warning during configuration; if you get it, you can ignore it.

Running qmake: /usr/lib64/qt-3.3/bin/qmake WARNING: icns.path is not defined: install target not created

When you start fwbuilder, you'll see the window shown behind the new firewall dialog in the screenshot below. By right-clicking on the Firewalls item in the tree view you can create a new firewall. If you choose to enable firewall templates and create an iptables firewall, you will see the dialog window shown. Because fwbuilder has a selection of firewalls that are identical or close to what many users will want to use, it makes getting started much simpler.

Template 1, shown in the screenshot, supports a dynamic IP address assigned by your ISP and a local fixed private subnet on a second network interface of the server. Template 2 is similar to template 1 but is designed for the server to be a DHCP server for your local network. Template 3 is designed for setting up a demilitarized zone (DMZ) subnet by having three network interfaces on the server -- one facing the Internet with a static IP address, a local private subnet, and a DMZ subnet that is accessible from the Internet.

The fourth item on the list, host fw template 1, simply protects a single host, only allowing incoming SSH access. While the policy for this sort of firewall is simple, having it in the list allows laptop users to install a firewall quickly. The linksys firewall template is designed specifically to run on Linksys routers, while the c36xx is an example for Cisco routers. The web server template allows HTTP and SSH traffic for the server that is running the firewall.

The firewall rules for Template 1 are shown in the screenshot below. As you click on each cell in the grid in the top of the window, the bottom pane changes to allow you to edit the data in that cell. Instead of simply entering a TCP connection type and a port number, the template firewall offers the SSH service as an option in the tree view on the left side, which is what this rule is using to define where the connection is destined. The service that the template refers to is part of the system definitions and is read-only, allowing you to see the details in the pane but not edit them. If you are running SSH on a custom port, you can either edit the system catalog for SSH or right-click it in the left tree view in the standard (system) catalog and select "Duplicate/Place in library User" to create a personal copy of the service. The drop-down list just above the tree view on the left lets you select either the standard (system) or user catalog.

When you have your own copy of the SSH service port definition you are free to edit it. To use your version of the SSH service definition, you can drag and drop it from the left tree view into the service cell of a rule for your firewall. Although this all works well, one user interface issue here is that both the definition in the standard (system) catalog and your user catalog for the SSH service have the same name. That means that if you drag your user SSH service into the service cell, you will see two SSH entries in that cell and have no indication that one is your personal catalog version while the other is the standard (system) catalog version. This is easy to work around by renaming your user catalog SSH service definition.

When you click on the firewall itself in the left tree or any cell in the grid showing the firewall policy in the top of the window, you can edit both the host and firewall settings. In the host settings you will find options to set the paths of specific tools on the machine, override various TCP settings such as the FIN and keep-alive timeouts, as well as turn on Explicit Congestion Notification (ECN), timestamps, and SYN cookies. More general host options include turning on kernel antispoofing support, whether source routing should be ignored, and how to treat various ICMP packets. The template 1 firewall does not explicitly change any of these settings from their defaults.

Clicking on the firewall in the left tree and clicking on the "Firewall settings..." button in the Firewall details section of the window lets you to set global options such as limits on the number of packets that are logged in a given interval, add a prolog and epilog to the generated firewall rules for handy tweaking, and specify various system paths that might need to be changed for custom installations. You can specify how to reject packets (which ICMP message to send back), say whether packets that are not associated with a known connection should be dropped by default, and specify whether shown established and related connections should be accepted before the first firewall rule is executed.

The NAT tab allows you to set up how the source and destination addresses of IP traffic are changed as it moved through the server. To have the server modify these addresses you set up a collection of rules and drag the network interface from the tree list in the left pane into the source and/or destination in the grid for a rule. NAT rules can be configured to be effective for source, destination, and service. They modify the connection source and destination address or change the port that the connection is finally sent to.

As shown in the screenshot below, the network interfaces are given descriptive names and shown in the left pane underneath the current firewall (here generated with template 1). You can of course modify the names and which network interface is associated with them and add new interfaces as needed. In the screenshot, any attempt to connect to myssh service on the Internet will have the source of the connection translated so that it appear that the connection originated from the firewall machine.

A particularly useful feature of fwbuilder is the ability to see all the uses of a service in your firewall and NAT policy. When you right-click on a service in the left side tree view or in the grid in the top of the window, you can select "Where used" to bring up a pane in the bottom of the window that allows you to jump to any rule in the NAT or firewall that references the service. This lets you audit what is able to connect to a service and see whether any NAT is being performed to allow that service to be used.

Defining rules that directly use services alone is often inconvenient, as there can be many services that work together to provide a desired functionality. fwbuilder lets you define "groups" that allow many individual service definitions to be considered as a single logical unit. For example, the Useful_ICMP group includes ICMP time exceeded messages, ping packets, and all ICMP unreachable packets. Groups allow a particular piece of server functionality to be defined as a single unit. The use of groups lets you edit more logical "functionality" units rather than having to remember each time exactly what services are used for a particular interaction you want to allow.

Having NAT and routing definitions in a single tool is convenient. It lets you set up how traffic flows, is mangled as it flows, and possibly denied in a single tool. The ability to set up a firewall using drag and drop and by copying network addresses and services from a grid, together with the templates shipped with fwbuilder, make this a very useful tool for quickly creating a packet filtering policy. The standard repository in the left tree view includes a nice selection of 192.168 and 172 and 10 private subnets, services and groups of services, and some time definitions, to allow the firewall rules to change during the week.

Wish list

Changing the color of the tree view on the left side when it is showing the user or system catalog is a great touch that allows you to keep track of which catalog you are viewing without much thought. Unfortunately, there are some areas where fwbuilder is not so user-friendly. For example, when you compile a firewall, if your policy is not 100% correct, error presentation requires you to remember which rule was causing the error, dismiss the compilation error dialog, and manually select that rule. It would be nice if fwbuilder made an attempt to parse the output and let you double-click the error message to jump directly to the offending rules, perhaps with the error message shown in an additional pane at the bottom of the window so you retain the context information. It would also be nice if, when you are planning to move a rule up only a few rows, you could right-click a rule and select Move Rule and then drag and drop the rule instead of having to manually enter the new rule number. Finally, when you install a firewall from fwbuilder, you are prompted for the user name and server to connect to for installation, and a connection is then made over SSH to that machine to install the firewall policy. It would also be nice to be able to simply export the iptables file for manual installation.

Ben Martin has been working on filesystems for more than 10 years. He completed his Ph.D. and now offers consulting services focused on libferris, filesystems, and search solutions.

Share    Print    Comments   

Comments

on Set up your firewall with Firewall Builder

Note: Comments are owned by the poster. We are not responsible for their content.

Set up your firewall with Firewall Builder

Posted by: Anonymous [ip: 76.74.207.42] on August 14, 2008 02:36 PM
Interesting. http://gufw.tuxfamily.org/index.html is a more desktop-friendly solution too.

#

Set up your firewall with Firewall Builder

Posted by: Anonymous [ip: 66.194.130.138] on August 14, 2008 03:10 PM
You can manually install/run the firewall using FWBuilder.
I just save my firewall and execute the *.fw script, which is just a bash script that creates the rules.

#

Set up your firewall with Firewall Builder

Posted by: Anonymous [ip: 204.153.155.151] on August 14, 2008 04:52 PM
"Finally, when you install a firewall from fwbuilder, you are prompted for the user name and server to connect to for installation, and a connection is then made over SSH to that machine to install the firewall policy. It would also be nice to be able to simply export the iptables file for manual installation."

If you "compile" the firewall without installing it, it creates the necessary shell script to do EXACTLY that. It even says how to do it in the instruction documents.

As someone who has been using Firewall Builder from the early days and wrote a white paper/book on building Linux based firewalls centered around Firewall Builder as the firewall rule management interface, I personally think that it is one of the best ones out there. Firewall Builder is fantastic for managing multiple firewalls or firewalls that are not local to the machine that you are working on. Such as dedicated firewall "appliances". It's not really intended to be a Zone Alarm replacement" or a "Windows Firewall replacement". More like a cross-platform replacement for true firewall management. One of the reasons that I chose it was due to it being object based like the CheckPoint FW1 interface is. In addition the one interface can be used to manage, at the same time, rule sets for many different port filtering technologies. It works with iptables, ipfw, pf, and PIX/ASA, all from the same GUI, and all at the same time.

GUFW is good if you're working with a local firewall on the machine that you are using to have a "Zone Alarm work-alike" or a "Windows Firewall work-alike".

#

Set up your firewall with Firewall Builder

Posted by: Anonymous [ip: 71.180.197.47] on August 14, 2008 07:09 PM
This looks like a very interesting program. However I have a problem in that I have no idea what to do with all the fire wall rules that you can apply, what are the implications of setting up a firewall in a certain way etc. I have no clue even as to what is going on with the simple firewalls that are available on windows and do not know if I should allow a program access to the internet or not. Does anyone know of any good books or websites that discuss firewall configuration, and network security issues written so a novice can understand what they are talking about? So far what I have found has been very confusing to me and appears to be directed at the security professionals. The result of my ignorance is that I seldom try to even have a firewall active on any of my pc's because I do not understand what they are trying to do, is seams that when ever I try to implement them my access to the internet becomes useless. I would really like to learn all I can about this but wish I knew were to start. Thanks for any suggestions y'all might be able to make.

#

Re: Set up your firewall with Firewall Builder

Posted by: Anonymous [ip: 204.153.155.151] on August 14, 2008 07:42 PM

Re(1): Set up your firewall with Firewall Builder

Posted by: Anonymous [ip: 71.180.197.47] on August 15, 2008 05:31 AM
Thanks tons, will be going there and studying what they have to say tomorrow morning. I guess I am not very good at Google searches as I am sure that had I worded my query correctly this site would have come up

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya