Slashdot Mirror


Linux Firewalls

David Martinjak writes "Linux Firewalls, authored by Michael Rash and published by No Starch Press, covers five main topics: traditional packet filtering with iptables, port scan detection, snort rule translation, port knocking, and log visualization. At first I considered only skimming the chapters regarding iptables packet filtering. I have a good amount of experience with iptables, and have been running it for several years. Thankfully I decided to give the first chapter a good read. Right from the start, the book presented valuable information and pulled me in." Read on for the rest of David's review. Linux Firewalls author Michael Rash pages 336 publisher No Starch Press rating 9 reviewer David Martinjak ISBN 1-59327-141-7 summary Linux Firewalls discusses the technical details of the iptables firewall and the Netfilter framework that are built into the Linux kernel. The chapters about iptables packet filtering are crucial for any reader new to networking or firewall administration. Experienced users might pick up a tip or two, as well. Linux Firewalls contained a wealth of knowledge about packet structure in addition to a solid explanation of iptables usage. I was rather impressed by the variety of information presented in the early chapters. The book of course detailed the syntax and logistics of iptables, but also provided detailed examples of attacks at the network, transport, and application layers.

Packet filtering was followed by port scan detection. When I first started using GNU/Linux, one application in my toolbox was PortSentry. PortSentry was designed to counter-act port scans, and minimized the amount of information that could be discovered from a scan. I lost track of PortSentry for some reason, but was glad to have almost re-discovered it in a new form. PSAD is the Port Scan Attack Detector and was developed by the book's author, Michael Rash, along with contributions from the open source community.

PSAD was created as a lightweight network intrusion detection component. The book explained how PSAD can quickly react to port scans by analyzing iptables log entries; and effectively reduce the surface area exposed to the attacker. The differences between PSAD and PortSentry were also enumerated, which showed several advantages for using PSAD.

Linux Firewalls did a fantastic job of detailing how to install and configure PSAD. This seems to be par for the course with No Starch Press as each book I have read from them was meticulous with regards to installation and configuration specifics. Additionally, the topics of installing and configuring the book's other two main applications, fwsnort and fwknop, were also properly addressed.

I don't want to give away too much of the material in Linux Firewalls; so I will just say that the chapters on fwsnort, fwknop, and log visualization were all on par with the earlier sections of the book. The information did not let up at any point — there were useful examples and details throughout each chapter. Additionally, there was a good amount of consistency with regard to how the chapters progressed, and the type of information that was presented along the way. All together, Linux Firewalls was an impressive read.

There were no real disappointments with this book. The reading did get a bit tedious at times with regard to configuration specifics, but it was only due to the depth of helpful explanation. Had I been working with the applications while reading (instead of just reading), the content would have been much more relevant. In the end, however, the variety resulted in a rather impressive and enjoyable book. The coverage of psad, fwsnort, and fwknop were welcomed additions. Each of the central topics were thoroughly explained in an informative, yet engaging manner. Essentially, I did not want to stop reading.

The netfilter/iptables software is licensed under the GNU General Public License, and can be found at http://netfilter.org. The psad, fwsnort, and fwknop applications are licensed under the GNU General Public License Version 2, and can be downloaded from http://cipherdyne.org.

The publisher hosts a Web page which contains an online copy of the table of contents, portions of reviews, links to purchase the electronic and print versions of the book, and a sample chapter ("Chapter 10: Deploying fwsnort") in PDF format.

David Martinjak is a programmer, GNU/Linux addict, and the director of 2600 in Cincinnati, Ohio. He can be reached at david.martinjak@gmail.com.

You can purchase Linux Firewalls from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

19 of 91 comments (clear)

  1. Sounds like an awesome book by tjstork · · Score: 2, Interesting

    I'm completely clueless about how Linux firewalls work. Is this suitable for noobies or is there an O'Reilly title out there for me?

    --
    This is my sig.
    1. Re:Sounds like an awesome book by Curmudgeonlyoldbloke · · Score: 2, Informative

      You could do worse than start here:

      http://www.cse.msu.edu/~minutsil/iptables.html

    2. Re:Sounds like an awesome book by Anonymous Coward · · Score: 4, Funny

      I agree. He should leave this forum in which firewall books are being discussed, and then search the internet for people's opinions about their favorite firewall books. Maybe he could find a forum somewhere in which firewall books are being discussed instead of wasting time in this forum where firewall books are being discussed.

  2. iptables by caluml · · Score: 5, Funny

    fw ~ # iptables -I INPUT -j DROP
    Connection timed out
    myhost $
    It's all the firewall I need! (Who here hasn't messed up iptables while remote, anyway?)
    1. Re:iptables by Tmack · · Score: 4, Funny

      fw ~ # iptables -I INPUT -j DROP
      Connection timed out
      myhost $
      It's all the firewall I need! (Who here hasn't messed up iptables while remote, anyway?)

      Its more fun to mess it up on purpose...

      Tm

      --
      Support TBI Research: http://www.raisinhope.org
    2. Re:iptables by Anomolous+Cowturd · · Score: 3, Informative

      $ at now + 5 minutes
      warning: commands will be executed using /bin/sh
      > # put some undo commands here
      > # get them right!
      > ^D

      $ # risky stuff here

      then you can use atq and atrm to cancel the undo, assuming you didn't screw up.

      --
      Software patents delenda est.
    3. Re:iptables by asamad · · Score: 2, Informative

      screen is also your friend

      screen 0
      sleep 180 ; {undo stuff here}

      screen 1
      scary stuff here

  3. Re:Good book by Finallyjoined!!! · · Score: 2, Insightful

    I'm already a firewall admin, mostly iptables with a bit of CheckPoint/Nokia thrown in, this looks like it could be a good purchase. Thanks {:^)

    --
    If I had an Ass, I'd call it Fanny Bottom, then I could slap my Ass; Fanny Bottom, on the Arse.
  4. OpenBSD PF Firewalls by Anonymous Coward · · Score: 5, Informative

    No Starch Press also has a new book out on firewalling with PF. IMO, PF is better and much more intuitive when building rulesets than Linux firewalls.

    1. Re:OpenBSD PF Firewalls by Homology · · Score: 4, Informative

      No Starch Press also has a new book out on firewalling with PF. IMO, PF is better and much more intuitive when building rulesets than Linux firewalls.

      I've been using OpenBSD PF for years and is much better than iptables. There is also a nice, up-to-date User's Guide available as well.

    2. Re:OpenBSD PF Firewalls by Penguinisto · · Score: 3, Insightful
      I'd just like to chuck in a general agreement here. PF is hella flexible, and while "ipf -fa -F /etc/ipf.conf" is nowhere near as intuitive as "/etc/init.d/iptables reload", the ruleset syntax is IMHO superior by miles, and much easier for a newbie to grok. I lost count of how many times I was tempted to try to hunt down a pre-compiled binary for the thing in Linux.

      (somebody had to have ported the thing by now... if not, damn that'd be an idea...)

      /P

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
  5. Portsentry a good idea? by Oriumpor · · Score: 3, Interesting

    Why has this package (which was last updated over 4 years ago) according to the sf project page become a staple of perimiter defense in many reference books, but hasn't been updated in almost 5 years?

    I've used it where I thought it a good idea in the past, but if knowledge of it's existence is apparent to attackers, it becomes a tool for DoS (through spoofing.) Wouldn't a snort+netfilter IPS solution make more sense?

    1. Re:Portsentry a good idea? by eipgam · · Score: 2, Informative

      There's no reason that age or frequency of update alone, without any other considerations, should prevent use of a piece of software.

    2. Re:Portsentry a good idea? by SpaFF · · Score: 4, Informative

      Uhm, if you read the article it appears that the author is advocating using psad (which is actively maintained) instead of portsentry.

      --
      -----BEGIN GEEK CODE BLOCK----- Version: 3.12 GIT d? s: a-- C++++ UL++++ P++ L+++ E- W++ N o-- K- w--- O- M+ V PS+ P
    3. Re:Portsentry a good idea? by ajayrockrock · · Score: 2, Insightful


      Portsentry was made by Psionic. They were bought out by Cisco in 2002. So Cisco pretty much hired the main developer and that eventually killed the project. The code was open source but obviously a community never really formed around it other then people wondering what happened to it. I welcome the alternative, PSAD, and am planning on to give it a test drive...

      --Ajay

    4. Re:Portsentry a good idea? by coryking · · Score: 2, Insightful

      Actually, it is the first consideration I have. I don't use software whose development seems to be dead. The first thing I look at on a website is "Last Updated $NOW - (ONE YEAR)". If it hasn't been touched in a year, I keep right on movin'...

  6. Strange... by $RANDOMLUSER · · Score: 2, Funny

    Most of my fireballs have involved Windows.

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
  7. OMG, Spoiler Alert!!1!! by Selanit · · Score: 4, Funny

    The reviewer wrote:

    I don't want to give away too much of the material in Linux Firewalls; so I will just say ...

    I totally stopped reading right there. Jeez man, don't spoil the technical manual! The suspense is all I read for!

    ^_^;

  8. Re:OpenBSD PF Firewalls for Linux by Anonymous Coward · · Score: 2, Insightful

    Yeah, when can we get OpenBSD PF on Linux? Seriously.

    I've been using PF on FreeBSD and IPF before that. I really think both are a lot simpler to understand than IPTables, which, quite frankly, is a disaster to administer.