Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Maximilian Wilhelm <max@rfc2324.org>
To: netfilter discussion list <netfilter@vger.kernel.org>
Subject: Re: safely apply new rulesets: iptables-apply
Date: Wed, 5 Mar 2008 11:37:08 +0100	[thread overview]
Message-ID: <20080305103707.GA9740@outback.rfc2324.org> (raw)
In-Reply-To: <20080304231606.GA16376@piper.oerlikon.madduck.net>

Am Wednesday, den  5 March hub martin f krafft folgendes in die Tasten:

Hi!

> You probably now the feeling, that cold and hot rush of adrenaline
> after you've typed "iptables-restore < new-ruleset" and didn't get to
> see the shell prompt again: you've just locked yourself out of
> a machine that’s potentially far away, and you feel like vandalism,
> or screaming on the top of your lungs, or whatever.

> I've had that feelings once too many and ended up writing
> iptables-apply[0] with a docbook manpage[1].

> 0. http://svn.madduck.net/pub/sbin/base/iptables-apply
> 1. http://svn.madduck.net/pub/sbin/base/iptables-apply.dbk

> iptables-apply is a simple shell script which applies the new
> ruleset and then prompts whether you like it. If you've locked
> yourself out, you cannot answer the prompt, and if you don't, the
> script rolls back the ruleset. Nice and simple.

Oh well, that's a different approach to my version :)
While hacking on a firewall management framework, I build such a
thing, tooo.

It works a bit different but does basicly the same thing.

My idea was to create a 'token' when the rules have been loaded, wait
for 
$TIME and if the token still exists (as in has no been deleted,
because
it was impossible) revert the ruleset to the old one.

Maybe this is also interesting for others:

 * http://files.rfc2324.org/projects/alff/agent/alff-cat has to be installed
   on the firewalls (config files in the same directory)
 * I push rules to my machines using Alff but basicly a
   cat $rules_file | ssh -l root -x $firewall "alff-cat -" should work.

My scripts still use shell scripts with iptables command in them, as I did
not finish the conversion to iptables-restore...

Just my 0,02 EUR

Greetz from frosty Zurich
Max
-- 
	Follow the white penguin.

  reply	other threads:[~2008-03-05 10:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-04 23:16 safely apply new rulesets: iptables-apply martin f krafft
2008-03-05 10:37 ` Maximilian Wilhelm [this message]
2008-03-05 11:42   ` martin f krafft
2008-03-05 11:46     ` martin f krafft
2008-03-05 11:56       ` 'queue' on 64-bit Scott MacKay
2008-03-05 12:59         ` martin f krafft
2008-03-09 16:45 ` safely apply new rulesets: iptables-apply Jan Engelhardt
2008-03-10 11:02   ` martin f krafft
2008-03-11 18:54     ` Jan Engelhardt
2008-03-11 19:00       ` martin f krafft
2008-03-11 19:30         ` Jan Engelhardt
2008-03-11 20:29           ` martin f krafft
2008-04-04  6:32             ` martin f krafft
2008-04-10 10:29               ` Jan Engelhardt
2008-04-10 13:34                 ` martin f krafft
2008-04-10 13:44                   ` martin f krafft
2008-04-16 21:56       ` Martijn Lievaart
2008-04-17  8:05         ` martin f krafft
2008-04-17 10:12           ` Покотиленко Костик

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080305103707.GA9740@outback.rfc2324.org \
    --to=max@rfc2324.org \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox