Current version - 0.11.1
Introduction
Mason is a tool that interactively builds a firewall using Linux'
ipfwadm or ipchains firewalling. You leave mason running on the firewall
machine while you are making all the kinds of connections that you
want the firewall to support (and want it to block). Mason gives you
a list of firewall rules that exactly allow and block those connections.
Mason was specifically designed to make it possible for anyone with
the ability to generally find their way around a Linux system to build a
reasonably good packet filtering firewall for any and every system under their
control. It takes care of all the low level grunt work; all you need to do is
follow the instructions and be able to run all the TCP/IP applications that
need to be supported.
Features
Mason supports the following:
- It accepts any mix of ipchains or ipfwadm log entries as input.
- It can run on an ipfwadm or ipchains kernel.
- It can spit out ipfwadm or ipchains output.
- The above 3 are independent from each other; Mason can, for example, accept
ipchains and ipfwadm log entries, run on an ipfwadm host, and output ipchains rules.
- It will run on the firewall machine or on another machine, using the firewall's packet
logs as input.
- It can run as the traffic is flowing through the machine or be fed the firewall logs later.
- While there are some advantages to running as root, it can be run as a non-root user.
- Mason will put in a macro for dynamic IP addresses, usually for your ppp link.
- It supports any kind of interface that can carry TCP/IP traffic.
- It recognizes any protocol listed in /etc/services and commonly used icmp protocols.
- It automatically handles setups such as cable modem or satellite where the packets
go out on one interface and come back on another.
- It automatically handles masquerading on the firewall and the strange rules that can
require.
- It allows you to put in any rules you may know you need and fills in the rest, or just
builds the entire thing for you if you prefer. It can also be used after a firewall has
been created to fill in some new rules or new protocols.
- It automatically generalizes the firewall rules in the following ways:
- Any local IP addresses are converted to the corresponding local network. Special IP's
(0.0.0.0, 127.0.0.1, 255.255.255.255) are handled appropriately. Mason can also be
configured to leave these alone or convert addresses to hostnames. This gives you
the ability to either treat all machines in a subnet as having equal access rights or
create fine-grained access rules for individual servers, as you choose.
- Non-local IP's are converted to 0/0 (anywhere).
- Port numbers in /etc/services are converted to the corresponding service name.
- High port numbers are generalized to 1024:65535.
- The ack flag is set for all tcp connections except for ftp.
- The TOS (type Of Service) flag is set for ftp, ftp-data, ssh, snmp, and nntp.
- Each output line is commented to give you an idea of what it's for and allow for easy
grouping via sort.
- The rule policy can be changed on the fly without having to stop Mason.
- Because Mason is a shell script, it can run on any system with bash and basic GNU tools
(sed, awk, grep, etc.). Actually creating the firewall log entries, interactively building
the firewall, or implementing the finished firewall needs requires a Linux system with
appropriate kernel (generally 2.0.0 and up, including 2.1.x and the upcoming 2.2.x) with
firewalling and firewall packet logging built in.
- A rather extensive manual/howto/notes file covers operating
Mason and some issued associated with packet filtering firewalls. Good reading for anyone
trying to understand some of the more advanced topics in packet filtering firewalls.
Disclaimers
I've included a copy of the disclaimers. Like all GNU programs:
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Unfortunately, because this program is so deeply involved in the security of the systems
on which it is run, I need to add this disclaimer as well:
This program offers an aid to creating firewall rules. It offers
ABSOLUTELY NO intelligence in deciding what should be allowed or
disallowed. It has ABSOLUTELY NO ability to understand your security
policy and implement it. YOU are responsible for reviewing the rules and
massaging them to fit your needs.
While the documentation in mason.txt attempts to provide some
general guidelines on how to use Mason, please remember: the author has
no knowledge of what you want your firewall to do and has not tailored the
documentation or program to specially fit your needs. If there is ever a
discrepancy between your needs and the program output or your needs and
the documentation, the program and/or documentation are _dead_ _wrong_.
Downloading and installing
Here are the various versions available for download, most recent at the top.
Here's how to install:
- Download the above tar file to /usr/src
- cd /usr/src
- tar -xzvf mason-version.tar.gz
- cd mason-version
- make install
- Follow the quickstart section in mason.txt
Here are the individual files you can download. Note that all of the following
files are included in the latest version:
- COPYING The GNU General Public License.
- Makefile Used in packaging and distribution.
- Quickstart A step-by-step set of instructions for getting going with Mason
- TODO Future goals, current bugs, etc.
- baserules.sample A few possible rules for use as a starting point.
- firewall The boot time script for use in /etc/rc.d/init.d.
- index.html The Mason web page.
- mason The actual mason script.
- mason-0.11.0.spec The RPM spec file.
- mason-gui-text The rudimentary interface to running Mason and building a firewall.
- mason.lsm The Linux Software Map entry.
- mason.txt The primary documentation for the package. Hasn't been
updated to reflect the current state of the program yet. Try the Quickstart first.
- masonlib A library of functions used by a number of the other files.
- masonrc The main configuration file. There are intelligent defaults for all of these fields.
- namecache. Mason stores learned hostname/IP pairs (in /etc/hosts format) for quicker retrieval. Automatically created and populated.
- netcache. A cache of your routing table, used to group machines together. Automatically created and populated.
- overview Notes to myself about the call structure.
- mason_policy Allows you to change the policy for new rules on the fly. No longer used -
settable in the main configuration file, change activated by sending SIGUSR1 to mason (automatically done by mason-gui-text).
- ruleshell A wrapper around the rules you create that does a little housekeeping. No longer used
as well. Mason-gui-text takes this role now.
Additional resources
Author, credits, feedback, copyright
If you have comments, suggestions, problems, ideas, flames, patches, whatever, I'd like to hear them.
I'd even be interested in hearing where Mason fell short for your needs. My permanent email address is
wstearns@pobox.com. The permanent web site for the software is
http://www.pobox.com/~wstearns/mason/.
If you choose to send me actual mason firewall rules and choose to hide the IP addresses and/or
networks for security reason, that's fine, but please replace them with something that describes
their general use so I can make sense of them. For example:
cat myrules | sed -e 's@11.22.33.44/32@fw-outside@' \
-e 's@192.168.1.1/32@fw-inside@' \
-e 's@192.168.1.0/24@inside-net@' \
>myrules.mailable
- or something like that.
This page, the Mason script, and the other files in the Mason package are Copyright (c) 1998 by
William Stearns wstearns@pobox.com. They are
released under the GNU GPL, which is included in the package. If you did not recieve a
copy of this license, please contact the author for a copy (see the top of the Mason
script for contact information for the author and the Free Software Foundation).
William is also the author of
buildkernel, the automated Linux
kernel builder, and other minor shell scripts.
Thanks
Many thanks to Dave Stern, who has offered suggestions on how to improve Mason and helped
with beta testing early versions. Maybe someday I'll tell him they were prerelease versions... :-)
A special thank you to all the authors in the Linux movement. In a small way, the code I return to the
community is my way of paying back my incredible debt to the people who came before me.
As always, many thanks to my wife Debra, who has shown amazing patience with my Linux related projects.
Many thanks, my love.
Last edited: 3/3/99
Best viewed with something that can show web pages... <grin>