Slashdot Mirror


Linux Gets Dynamic Firewalls In Fedora 15

darthcamaro writes "Linux users have long relied on iptables for in-distro firewall setup. The upcoming Fedora 15 release changes that and introduces us to new dynamic firewall technology. 'Most Linux systems use IP tables type firewalls and the problem is that if you want to make a change to the firewall, it's hard to modify on the fly without reloading the entire firewall,' Fedora Project Leader Jared Smith said. 'Fedora 15 is really the first mainstream operating system to have a dynamic firewall where you can add or change rules and keep the firewall up and responding while you're making changes.'"

35 of 176 comments (clear)

  1. No comment? by Anonymous Coward · · Score: 4, Funny

    No comments yet, everyone's being raptured.

    1. Re:No comment? by drb226 · · Score: 2

      Slashdotters being raptured? I doubt it...

    2. Re:No comment? by davester666 · · Score: 4, Funny

      Why not? We're all virgin's who were tricked into viewing the goatse image.

      --
      Sleep your way to a whiter smile...date a dentist!
  2. First by Anonymous Coward · · Score: 5, Insightful

    Ehm, iptables doesnt need reloading. Add a rule and it works right away?

    1. Re:First by icebraining · · Score: 2

      Linux still doesn't need reboots; that doesn't mean they don't happen. I don't see where's the contradiction.

    2. Re:First by WuphonsReach · · Score: 2

      How they are saved depends on the distro. If you use something like Fedora before this, then whether using a gui or command line, you are effectively editing a file and then reload that file by restarting a sudo service. If you use something like gentoo, then it saves your firewall on shutdown or at your request.

      You can adjust the Fedora / RHEL / CentOS firewall on the fly with the iptables command. Yes you could just edit the save file and then reload the firewall, but it's always been possible to make firewall changes on-the-fly without doing a reload. It was just tedious, especially for long intricate chains. If you then want to make the changes permanent, you issue the save command.

      $ sudo service iptables save

      That saves the rules out to the /etc/sysconfig/iptables file (which is what gets loaded when you do "service iptables load").

      Frankly, this sounds more like UI changes for interacting with IPTables, and not a core change to how IPTables works.

      (Note: I'm speaking from experience with CentOS 5.x and RHEL 5.x, not Fedora.)

      --
      Wolde you bothe eate your cake, and have your cake?
    3. Re:First by gweihir · · Score: 2

      Yes, this is a system for those that do not get iptables. Seems, once again, network security is made ready to be given into the hands of the incompetent.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    4. Re:First by Malnar · · Score: 2

      Not true, it takes less than a second to read in a rule file by iptables-restore with over 20k rules. (Generated by iptables-save, not a file of a 20k iptables -A commands). The TCP sessions are not even reset so flows do not get broken. Changing a rule (well, a rule can't be changed, but you can insert a new rule above the current one and delete the old which is what most firewalls do anyways), does not disrupt anything either. The only "issue" is that rule changes are not saved to disk automatically, however it is trivial to write a 3 line bash script that would change a rule and save the whole ruleset (Again a VERY quick, non-disruptive process). This applies to all Linux distro's.

    5. Re:First by X0563511 · · Score: 2

      It works even better if you use IP Sets with it. Check it out... it's been around for a while, but seems to be little known.

      --
      For large sets, this will be our guide even unto death, for the LORD will work for each type of data it is applied to...
  3. reloading? by El_Muerte_TDS · · Score: 5, Insightful

    it's hard to modify on the fly without reloading the entire firewall

    It is? Then what have I been doing wrong for all these year?

    1. Re:reloading? by LordHatrus · · Score: 2, Interesting

      I believe what they're trying to say is that it's more akin to the Windows world of things - "Hey, this apache-thing is trying to bind to port 80... do you want to let it through the firewall?"

  4. Seriously? by The+O+Rly+Factor · · Score: 2, Interesting

    /sbin/service iptables save
    /sbin/service iptables restart

    You really CAN'T take the time out of your day to type that?

    1. Re:Seriously? by fnj · · Score: 2

      Oh, honest to God. Do we have to spell it out? So you make a bloody tinkertoy launcher on the desktop that says "restart firewall" and it runs the command line "sudo /sbin/service iptables restart." Takes about one minute to create. That is so simple even a monkey too stupid to learn anything can do it. Then you make more launchers to do other firewall tasks.

    2. Re:Seriously? by mcavic · · Score: 2

      Restarting iptables doesn't even hurt anything. I've done it with VPN users connected and talking over VOIP.

    3. Re:Seriously? by Runaway1956 · · Score: 2

      Why should someone even have to know such commands in the first place?

      How about an automotive analogy? If you can't parallel park, you can't claim to know how to drive. If you can't change a flat tire, you shouldn't be licensed to drive. If you can't walk around your vehicle to see if all the parts in the correct places, (lights, tires, bumpers, windows - basic shit like that) then you should be charged with reckless driving when the cop pulls you over for driving on a flat tire, and a broken turn signal.

      Just because you can have your car - or your computer - do things for you automagically shouldn't relieve you of the responsibility to UNDERSTAND THE SYSTEM!!

      --
      "Windows is like the faint smell of piss in a subway: it's there, and there's nothing you can do about it." - Charlie Br
    4. Re:Seriously? by AdamWill · · Score: 4, Informative

      Try reading the original feature page:

      http://fedoraproject.org/wiki/Features/DynamicFirewall

      the main benefit of this is not for manual changes, really. See 'Benefit to Fedora'. Hell, just read the whole thing. It makes it quite clear.

    5. Re:Seriously? by Runaway1956 · · Score: 2

      Elitest nerd bullshit? No - that is real world, real life, pragmatism. Many of you city folk have never been 100 miles from the nearest town, or garage, or service station. But, I have. Not only can I change a tire - I can, and have, changed a tire on an 18-wheeler. Now - you can do the math, if you like. ASSuming that a cell phone would work, I could have called a mechanic, and waited 2 to 4 hours for him to get there. Then, waited for him to change the tire. Then followed him to his garage where I could telephone the boss so that he could pay for the new tire, plus the repair, plus the service call. OR, I could just change the damned tire, and at the end of half an hour, I could drag my hot sweaty arse behind the wheel, and enjoy the air conditioning as I drove on my way.

      Oh - we were talking about computers. Same thing, really. I can pay someone hundreds of dollars (let's say Symantec) to keep my computer and/or network secure. And, I may just become the laughingstock of the world when I get hacked (like Sony, let's say). OR, I can make some attempt to understand how my computer and my network actually WORKS - then secure the damned thing.

      Remember - security is NOT a product - it is a PROCESS!!! Not even the most naive and ignorant of the US Marines would draw up a security plan, then call it "good enough". Nor would they "outsource" the job. Instead - the Marines constantly evaluate and reconsider all aspects of their security environment. It's a PROCESS.

      Oh - funny thing. I just watched the HNN broadcast. Some company logo in the background claims, "Security begins with trust". FFS - if I TRUST people, then there's no need for security, now is there? And, guess what - I don't trust that company, or any other, that much. I'll handle security for myself, thank you very much.

      --
      "Windows is like the faint smell of piss in a subway: it's there, and there's nothing you can do about it." - Charlie Br
    6. Re:Seriously? by MightyMartian · · Score: 2

      Save for the very simplest firewalls (like you'll find in your $29.99 Dlink) there are not a lot of ways to make things simpler. Advanced firewalls, whether iptables, Cisco IOS or whatever require knowledge of packets and protocols beyond just "redirect port 80 to my shiny new web server). Look at the Webmin for an example of a web-based config system that is actually more difficult than the command line, because the vast array of options has to be spelled out.

      Powerful utilities are by their very nature complex.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
  5. Dbus by vajorie · · Score: 2

    The apps can tell the firewall to open up a port for a period of time and then shut it back down.

    Woohoo!

  6. Whoa, you can dynamically open ports! by cras · · Score: 2

    The apps can tell the firewall to open up a port for a period of time and then shut it back down.

    I mean, it sounds almost like they could listen() a specific port, and once they're done with it, they could close() it! If all applications could always do this automatically, I think we could actually get rid of manual firewall configuration entirely!

    1. Re:Whoa, you can dynamically open ports! by MikeBabcock · · Score: 2

      I filter ports below 1024 because I don't necessarily want them listening to connections from just anyone.

      I have several machines with rules like "iptables -I INPUT -i eth0 -p tcp --dport 22 -s 10.14.3.0/24 -m state --state NEW --syn -j ACCEPT" so that SSH isn't even listening to everyone, just the subnet I want it to listen to.

      PS for the people who may reply, that usually looks like:

      iptables -I INPUT -i eth0 -j INPUT-LAN
      iptables -A INPUT-LAN -s 10.14.0.0/16 -j MARK --set-mark 2
      iptables -A INPUT-LAN -s 10.14.3.0/24 -j MARK --set-mark 3
      iptables -A INPUT-LAN -p tcp -m state --state NEW --syn -j INPUT-LAN-NEW
      iptables -A INPUT-LAN-NEW -p tcp --dport 22 -m mark --mark 3 -j ACCEPT
      iptables -A INPUT-LAN-NEW -p tcp --dport 80 -m mark --mark 2 -j ACCEPT
      iptables -A INPUT-LAN-NEW -p tcp --dport 3128 -m mark --mark 2 -j ACCEPT ... since doing the state check in each line gets unwieldy quickly. Also, MARK is a great way to not have to repeat subnets and other matches, assuming you're not using them differently in mangle for ipsec or something.

      --
      - Michael T. Babcock (Yes, I blog)
  7. OpenBSD by discore · · Score: 2, Informative

    "'Fedora 15 is really the first mainstream operating system to have a dynamic firewall where you can add or change rules and keep the firewall up and responding while you're making changing.'"

    What?

    http://www.openbsd.org/faq/pf/

    pf will always be better than iptables in every way.

    1. Re:OpenBSD by justsomebody · · Score: 4, Informative

      no need to get upset. author just worded it really badly. as most already said, iptables already had add/remove/save/restore, although i can see you get bonner every time you mention openbsd

      here is how this works
      - service/program starts and sends d-bus message "hey, i need xxx port to work (yes, i really meant classic pr0n port;)
      - user gets prompted and needs to validate decision trough authentication.
      - port is open
      - when software stops, it sends another d-bus message "close pr0n port"
      - port is closed

      this is not scenario which would be usable in any server environment. but for n00b user running something... might just be life saver not to get confused with bunch of for him too advanced howtos.

      --
      Signature Pro version 1.13.2-3 release 83.5 beta3try7 after-breakfast edition
  8. What's the point? by Anonymous Coward · · Score: 3, Insightful

    So an application can say hey I need a port open, please open a pinhole in the firewall.

    I don't get that. If you want applications to be free to open ports, why would you filter them in the first place? (and what does it mean to filter ports that are closed anyway?)

    I would say controlling such an ability in an application belongs to something that acts on bind(9) calls.

  9. Ignorant and misleading article. by sydb · · Score: 5, Informative

    This article is ignorant and misleading. The "new technology" is nothing to do with Linux, iptables rules are already dynamic, it's the Fedora management tooling that no longer wipes the entire set of rules and loads them afresh.

    The truth is here: http://fedoraproject.org/wiki/Features/DynamicFirewall

    --
    Yours Sincerely, Michael.
  10. OpenBSD's PF has been adaptive for years by badger.foo · · Score: 4, Informative
    The concept isn't very new or radical, but it will be interesting to see how their implementation behaves in real life.

    Over in OpenBSD land, PF has supported tables of IP addresses that can be manipulated on the fly for years (see eg these table samples. One common use is (courtesy of another useful adaptive feature called state tracking options) to detect and block bruteforcers (see eg this set of tutorial examples). In addition, the OpenBSD versions of dhcpd and bgpd as well as other applications are routinely set up to interact with your filtering config via tables.

    Another adaptive or dynamic feature is anchors, named sub-rulesets where applications such as a proxy (ftp-proxy for example) or relayd (the load balancer) can insert and delete rules as needed. You can manipulate rules inside anchors from the command line too, of course.

    My BSDCan slides has more material, as of course does The Book of PF, and never forget The PF docs as the authoritative source.

    --
    -- That grumpy BSD guy - http://bsdly.blogspot.com/
  11. Re:WTF?? by miknix · · Score: 5, Interesting

    Most Linux systems use IP tables type firewalls and the problem is that if you want to make a change to the firewall, it's hard to modify on the fly without reloading the entire firewall

    Can please someone explain me what's wrong with appending and deleting a firewall rule:

    $ iptables -A INPUT -p tcp --dport 80 -m state --state ESTABLISHED -j ACCEPT
    $ iptables -D INPUT 2

    where on earth does this need iptables to be restarted?

    if we want to save the firewall state:

    $ iptables-save > /root/ipt.state

    where /root/ipt.state is just a human readable file

    and then load the firewall state:

    $ iptables-restre < /root/ipt.state

    AFAIK this is not "restarting" iptables, just replacing the entire ruleset in one shot.
    Again, WTF?

  12. Re:Playing with dbus by Lennie · · Score: 2

    no, it takes down dbus and it might make some thing on your _desktop_ not work anymore (because I think that is what this is for). iptables is in the kernel, it is not effected.

    --
    New things are always on the horizon
  13. Ugh... bloatware by ka9dgx · · Score: 2

    I'm one of the token Windows system admins here... and even I know that this stuff is just bloatware.

    • dynfw is just a script to do a few things with iptables, its not new functionality.
    • OpenSCAP is just some tools to manage code signing, which is an attempt to enumerate goodness, and doesn't actually fix things by improving security.

    I thought they were talking about something new and useful... not just some hype... oh well... looks like they care catching up with uSoft in that department.

  14. Re:WinXP by jd · · Score: 2

    IPTables rules can not only be per-application, per-user and per-instance, or per any definable group thereof (intserv), the rules themselves can contain whatever conditions you like (including checks for packet labels, layer 7 checks, etc). The main question I have to ask is why Red Hat still uses IPTables rather than nf-HiPAC or nftables, the two competing replacement stacks. IPTables is long-in-the-tooth and can't compete on performance or flexibility with the alternatives, so extending IPTables' functionality (rather than switching to something that already provides the facility and spending those resources on development) seems pointless and a little naive.

    If you're going to spend developer time and dollars on a capability, always always always look 2-5 years ahead rather than 2-5 years behind.

    --
    It's a small world and it smells funny; I'd buy another if it wasn't for the money; Take back what I paid (SoM)
  15. Re:Long in the tooth... by gweihir · · Score: 2

    Professionals do not care about "sexy", they care about "works efficiently and reliably". Amateurs care about "sexy". I guess there are now enough Windows admins administrating (or trying to) Linux systems, that "sexy" becomes a factor...

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  16. This is an iptables wrapper, not reimplementation. by donscarletti · · Score: 2

    Bad summery. This just provides a high-level interface for exactly this kind of operation that iptables provides. Problem was, while iptables was dynamic, the high-tools that controlled it were not and tended to just dumbly write to a file then flush iptables current state and reload from that file, wasting iptables abilities. So this is just a new daemon to expose all of iptables functionality to configuration tools and uses an unmodified version of iptables to do all of the heavy lifting. One suspects the author of the summary did not know what iptables was, and assumed it referred to the configuration files that iptables uses.

    --
    When Argumentum ad Hominem falls short, try Argumentum ad Matrem
  17. Security hole? by dutchwhizzman · · Score: 2

    So basically, every application, evil or not, can now request ports to open on the firewall? You may as well run everything as root and turn off SELinux as well. It will not only make it easier for the user to make changes, but also make the local firewall no longer a restriction for evildoers.
    Yes, I know, "SELinux access restrictions are also planned." but that is security added as a feature later on, not designed into the main architecture of the daemon. Right now, it's a big leak and I'd disable it first thing after installation. Fedora/RedHat should do that as well, until it has proper security features.

    --
    I was promised a flying car. Where is my flying car?
  18. So is this like by AHuxley · · Score: 2

    http://en.wikipedia.org/wiki/Little_Snitch software outgoing firewall for Mac OS X
    "If an application or process attempts to establish an outgoing internet connection Little Snitch prevents the connection. A dialog is presented which allows one to deny or permit"?

    --
    Domestic spying is now "Benign Information Gathering"
  19. Re:Modern technology in Linux by Yfrwlf · · Score: 2

    Having drivers come with the kernel so that there is more "plug-n-play" out there is a wonderful feature, but no, these are problems that do affect everyone. There are lots of scenarios I can come up with where this feature would be great to have. One would be being able to use new hardware with an old stable kernel easily. Another would be for users to be able to share drivers easily with each other, instead of having to give noobs instructions on how to compile something. Yet another would be so that anyone could package a driver that works with a piece of hardware that works. Vendors would be able to do this for instance. Vendors could also give Linux support much more easily without having to go through an annoying compilation step.

    No matter how you look at it, that *feature* in Linux would be exactly that, it would give you more flexibility, require less upkeep, and make support much easier. Oh, that driver that came in that older kernel is crap? Here's this newer one that works, Grandma, just click on it to install. *That* is a feature, and there's no god damn technical reason why a standardized interface allowing for a more modularized kernel like that cannot be implemented. I'm all for open source drivers, but this isn't an open vs. closed argument, having this feature would help *everyone*, regardless of the license of the driver. Just saving the work of having to recompile all the drivers every time there is a kernel revision would be a nice feature. Save some electricity. Geezus.

    --
    Promote true freedom - support standards and interoperability.