FIREWALLS MADE EASY

A low-cost Linux firewall targeting SMB sites running Windows can be a great time-saver for Linux-savvy sites as well.

   
 
by Jack Fegreus

September 28, 2004
   

 

 

 

 

Even the CIA gets cracked. If crackers in search of notoriety can break into a CIA site, what does that say for small- to medium-sized business sites? Internet pollution worsens by the day and each new virus, worm, and network denial of service attack puts every business at risk. Nonetheless, what has really put the pressure on corporate IT is a torrent of e-mails offering "Italian Rolex" watches, "cheap OEM softwares [sic]" and "enhancement" drugs, which have all been redirected and often forged to appear as internal.

It certainly seems that Internet scofflaws are partying wildly on some remote island. Meanwhile, those who are trying to do legitimate business on the Web are left coping with a growing list of privacy regulations to make sure that the data they do acquire does not fall into the hands of the scofflaws. Worse yet, there is no magic bullet of a solution universally favored by end user to address these issues.

For IT, there is only grudging acceptance that global computing is inherently insecure. As a result, SMB sites have delved deeper into arcane security solutions, and, without the kind of staff expertise that's standard at large IT sites, SMB sites in turn struggle with an IT security conundrum. The more secure a system becomes, the more intrusive security becomes—intrusion that is universally disdained by end users.

Balancing security concerns and ease of use is no mean feat. An excellent starting point is the Site Security Handbook from the Network Working Group, which is also working on a User's Guide to Internet Security. Also of interest are documents rfc1244 and rfc1281, which describe how to create a network security policy, with detailed examples. 

 

         
 

OPENBENCH LABS SCENARIO

UNDER EXAMINATION: Linux Firewall

WHAT WE TESTED
NetMAX FireWall ProSuite 5
Built on Red Hat Linux 9
Remote (Web) and local administration
Stateful firewall using IP tables
Port Forwarding (IP address mapping)
Internet connection sharing via masquerading and NAT
Web proxy and cache server
DHCP client and server
APC UPS Support

HOW WE TESTED
HP Pavilion
800MHz CPU
256MB RAM

KEY FINDINGS
Completely automated fast installation
Supports multiple virtual addresses and virtual host names
Menus greatly simplify the creation of rules for Iptables
Web proxy/cache server provides an easy way to block pop-up Web ads
No intrusion detection systems

 

Addressing SMB needs along with those rogue departments in large organizations that can never seem to wait for IT, NetMAX has stepped up to provide a line of easy-to-use business-ready Linux servers. The NetMAX server idea is to make the power, reliability, and flexibility of Linux available to sites lacking a lot of IT experience and resources.

The biggest roadblock in Linux marketing has historically been the dearth of expertise in running Linux systems at SMB sites. These are often Windows-only system sites. To address that hurdle, NetMAX focuses on shielding the administrator from the complexities of the underlying Linux operating system using simplified step-by-step Web-based menus to set-up and manage both Linux and related applications that make up a particular "Internet appliance."

 

 

 

 

 

There are three foundation packages and two add-on "Powerpacks" in the software offerings from NetMax. Released early this month, all of the the new version 5 Internet appliance servers are built on Red Hat Linux v 9.0. The three foundation servers are the NetMAX FireWall ProSuite, VPN Server Suite, which includes the FireWall ProSuite, and Professional Suite, which provides file sharing, e-mail, Web, and firewall services. The two Powerpacks are the NetMAX E-Commerce Powerpack, which adds e-commerce features to Apache including a shopping cart, and E-Mail Powerpack, which adds global Spam screening at the e-mail server before mail is delivered to user inboxes.

NetMAX does not, however, stop at software. All of the NetMAX software packages can also be bought pre-installed on HP servers.

In this first look at such offerings from NetMAX, we examine the most fundamental of Internet security appliances: NetMAX FireWall ProSuite 5, which facilitates setting up a firewall, router, and a proxy/cache server on top of Red Hat Linux 9. The foundation on which NetMAX rests is the combination of the kernel (both 2.4.x and 2.6.x) space netfilter project,  and Iptables, which is the user space tool for runtime configuration of the firewall subsystem.

Netfilter provides hooks inside the Linux kernel to register callback functions within the network stack. Each time a packet traverses one of these respective hooks, the requisite callback function is triggered. Iptables is a generic table structure for the definition of rulesets. Each rule within an IP table consists of a number of classifiers and a target action to be taken if the classifier triggers a match. In this way, the framework created by netfilter and Iptables enables stateful (IPv4 and IPv6) and stateless (IPv6) packet filtering. In addition the framework provides for destination and source network address translation (NAT) and network port translation (NAPT).

Nonetheless, writing scripts for rules in Iptables is a complex task that is definitely not something to be left for experimentation by amateurs. The first law of firewall script writing is to insure that any permission not explicitly given is implicitly denied. Even when equipped with the most user-friendly tool available, anyone charged with building a firewall needs to know how packet filtering works and what potential security holes might violate that first law. To jumpstart the process, an excellent place to start is the Linux Firewalls book by Robert L. Ziegler, published by New Riders.

The NetMAX FireWall ProSuite 5, which is geared for small-to-medium-sized businesses, goes a long way to filling the void in firewalls that are easy to configure and manage. The preferred method of interacting with NetMAX is via the Web-based GUI. It is possible to use a direct command line interface on the server; however, it is very likely that doing so will break one of the GUI's configuration files.

 
       
 

Helping to simplify the basic configuration of the firewall is the fact that NetMAX starts with the Red Hat Linux 9.0 distribution. Red Hat has historically been one of the most flexible and robust of all Linux distributions when it comes to configuring network devices. For example, the ability to easily assign multiple virtual IP addresses to each Ethernet NIC is an extremely powerful capability when combined with NAT and masquerading in a multi Web hosting scenario.

During the installation of NetMAX the first Ethernet NIC discovered (eth0) will be presented for initial configuration. All other NICs will be installed but neither configured nor enabled. Typically, two or three NICs will be used in the firewall to create network zones based on levels of allowed network access: the external or firewall connection; the internal network, which is usually given permission to access outside services, but protected from incoming traffic; and a DMZ, where servers are configured to provide limited access to outside clients for various Web and e-mail services.

 

The firewall accepts any number of network interfaces. More importantly, NetMAX is very robust in reporting about each NIC (mouse over image). In addition to the working status of the NIC, NetMAX reports on packets sent and received, errors encountered, the routing table created for that network, the address assigned via DHCP, and on the DNS menu, all discovered domain name servers on the network.

 
     
 

Configuration and debugging of the firewall are aided significantly by all of the network details that NetMAX reports on each NIC. For our tests, we used a broadband cable modem to connect the lab network to the Internet. This configuration is complicated by the fact that no details of the external cable provider's network are published. This decision is as much a marketing as security issue. The operative assumption is that virtually all Internet connections will be made using a Windows machine by a naive home user. As a result, the only help available from the cable company is a wizard-based utility that runs on Windows.

How serious of a problem is that Windows-only marketing decision? In truth, it is far more of a nuisance than it is a problem. Nonetheless, NetMAX goes a long way toward demystifying what lies on the other side of that cable modem, which makes solving the rare connectivity crisis far more tractable.

At this point, it would seem time to tackle the problem of configuring rules for the firewall. For many if not most network scenarios, this would absolutely be the case. The one exception comes when a site plans on having a DMZ. Named after the infamous concept of a demilitarized zone surrounding hostile boarders, a DMZ is a separate network for servers that will be accessed from systems on the public side of the firewall. These systems will provide such common services as e-mail, file distribution, and Web access.

 
         
 

Configuring these servers on a separate network makes it easier to create the necessary firewall rules to instantiate the DMZ. The idea is to isolate these servers, which will be more vulnerable to attack from the site's desktop and server systems, which need to be as secure as possible and not accessible in any fashion from the outside world. If the DMZ is compromised, making it an isolated network is an easy way to prevent crackers from hopping on to the secure internal network.

There is nothing in the NetMAX menu system to make it easier to configure a DMZ in the traditional way of using separate network addresses. Typically this is done in a firewall by declaring each NIC as an internal, external, or DMZ interface. In turn, this designation changes how the firewall deals and reports on the devices on each network. As demonstrated by the reports on devices discovered on our cable provider's network, NetMAX treats each NIC in the same manner.

This approach can be quite annoying for an administrator when first attempting to configure a DMZ; however, NetMAX does have its own unique and more intuitive solution to the problem. NetMAX has a means to define roles for servers within a domain and then to create rules based on those roles, not on network addresses.

 
In addition to assigning multiple virtual addresses to a device via its NIC, multiple hostnames can also be assigned to a device such as mail.open-mag.com or web.open-mag.com. This device can also be restricted form accessing other machines on that subnet. In turn, these machines can be assigned to a machine group (mouse over image) that represents a server role such as that of a Web server, e-mail server, or—as we created—NIS server.
 
     
 

To support the creation and use of roles for machines, NetMAX supports assigning multiple machine aliases to devices to give them more than one hostname. As a result, different hostnames can be used in conjunction with DNS registration to identify a server by the different purposes that it serves—web.open-mag.com or mail.open-mag.com. Once this is done, the final step to simplify firewall rule creation using NetMAX is to create machine groups such as Web servers or e-mail servers.

These machine groups represent all of the possible roles that could be assigned to a server at a particular site. Once the roles are assigned, NetMAX then makes it easy to create rules for these roles. That's because a menu entry can be created that generically references a role that in turn will generate dozens of rules for each network address of a server playing that role. It is important to note that all of the machine aliases and machine groups are explicitly tied to one or more network address. These addresses are what NetMAX will eventually use to create traditional rules in Iptables for the firewall.

 
       
 

In line with our first law of firewall scripting, NetMAX begins firewall configuration menus by identifying the kinds of traffic to be denied (dropped) by default on a particular domain. Certainly for the external (public) interface, the safest route is to deny all incoming traffic. Such a draconian approach, however, suffers from a serious drawback: It will take numerous exception rules to make the system usable.

Fortunately, NetMAX provides a number of options that can be combined to cover most of today's common access scenarios. For our test scenario, the lab is physically isolated from all production e-mail and web servers. That leaves us free to bias our choice of rules towards a high degree of security for all systems behind the firewall. We chose five deny options, created a server (machine group)  rule allowing external pinging of our NIS server, and added a custom rule to permit the firewall's NTP daemon to make time requests. These options created 89 special NetMAX rules, which in turn generated approximately 400 entries for Ipchains.

 
We began by choosing five deny access options, which in turn created 84 separate custom NetMAX rules. We also added a special rule to allow pinging of our locally defined machine group of NIS servers (mouse over image).
 
     
 

To script all of the entries for Iptables manually would have required us to know the complete list of protocols being used. In the case of an e-mail server, the list is going to include protocols like SMTP, POP, LDAP, and maybe HTTP for Web access. Next we would need to know the transport protocol: TCP or UDP for each e-mail protocol. Then we would need the port numbers on which our e-mail server listens for the appropriate transport protocols. At last, we would be ready to write the correct Iptables’ syntax that would allow each of these protocols to be accepted at the firewall and then routed to the e-mail server.

The NetMAX FireWall Suite can also be used to filter content of URLs. In particular, a blacklist of IP addresses can be created and all packets from these addresses will be dropped. This ability to filter URLs can be used to block annoying pop-up ad windows. For the most part, these bothersome advertisements are generated by specialized servers at URLs such as doubleclick.com and unicast.com. Using the Web proxy/cache server simplifies the work needed to block these URLs via the ability to block by domain name rather than IP address.

Getting that list of specialized advertising servers is made all the easier thanks to NetMAX's traffic report. This facility offers two reports which are essentially two different views of the same data. These reports can best be thought of as answering the questions: "What sites are being accessed by whom" and "who is hitting which sites." The former report is the best way to get at which sites it might be more useful to block, while the later report is unfortunately needed by many larger organizations to monitor potential employee abuse of the Internet.

Surprisingly NetMAX does not include an open source intrusion detection package such as Snort. In terms of operational utility, a traffic report is far more valuable; however, an intrusion detection report is often one of those check-off items that keep security auditors happy.

Priced at $231, the NetMAX FireWall ProSuite is quite a bargain and is a marvelous introduction to Linux for the prototypical Windows-only SMB site. At the same time, NetMAX FireWall ProSuite provides the sophisticated Linux site with a labor-saving and easy firewall that can be popped out of the box, loaded on a low-end server, and be up and running in an hour.