public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Timo Boettcher <spida@gmx.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user]  iptables example on Gentoo
Date: Sat, 10 Sep 2005 19:04:41 +0200	[thread overview]
Message-ID: <153940469.20050910190441@gmx.net> (raw)
In-Reply-To: <009401c5b54a$004d9920$0a00a8c0@butthead>

Hi Dave,


* Dave Nebinger <dnebinger@joat.com>, Friday, September 9, 2005, 4:23:07 PM:

>>> Dude, trying to use iptables directly was your first mistake.
>> no, it wasn't.
>>
>> I have written some "small" example script
>> http://forums.gentoo.org/viewtopic.php?p=377447
>> that (IMO) is quite modular...

> Yes, Timo, it is quite modular and quite thorough.  It represents a great
> job at developing a general set of rules.

> But I would raise the following issues:

> 1. FTP support: You've allowed for the active ftp protocols on ports 20 &
> 21, but what about passive?  This traffic will usually be on the higher
> ports (typically a range specified in the configuration for the ftp daemon).
> I do believe that if the ftp daemon tries to open a passive connection
> outbound it's going to get knocked off at the knees.
If I open a ftp-connection from the inside to a ftp-server on the
outside, it should get caught by the iptables-ftp-module and the
RELATED rule.

> 2. Measure the checks: The more checks that a packet goes through, the
> longer it will take to travel through the iptables stack.  Your script has a
> lot of checks in it.  Consider a pgp packet as it traverses all of the
> chains etc. that you've specified.  You're probably looking at 30+ checks at
> least (although I haven't counted each individual check, but I'm confident
> it is quite a large number).  That's a significant number of hops and means
> the packet is going to be hanging around on the box a lot longer than what
> it really should.
Yes, I have MANY checks. I have had no probleems while using this and
some newer versions of this script. However this seems to bee a
problem for users that get many small packets per time-unit... (think
p2p here). As you state below, this is no universal solution, but was
built to be easily reconfigurable.

> 3. No detail on why the checks are ordered in the way they are (is there an
> order?):  As #2 indicates, the increased number of checks that a packet
> needs to be pushed through means it will hang around on the box longer.
> Therefore they should be ordered to give priority to either a) heavily used
> ports or b) ports you want to have processed sooner rather than later.
There was no reason ;-). see above

> 4. No reason for accepting specific outbound traffic: I tend to prefer
> allowing all outbound traffic and filter on those ports that shouldn't be
> going outbound (i.e. dhcp responses, dns responses, ipp packets, windows
> networking stuff, known trojan/virus ports).  It greatly reduces the number
> of checks outbound traffic needs to go through.
I filter outbound for various reasons: generally, I like to know what
happens on my internal network. You can catch misconfigured software
some malware and some bad users with that.

> Obviously to improve the throughput you'd have to alter the script to use
> multiple ports on accept lines.  Once you start doing that, though, you lose
> the modularity that you've built into the script.
You are probably right in that.

> The point that needs to be made is that there is no 'one iptables script
> fits all'.  Each site, each box for that matter, has it's own set of
> services and it's own usage criteria.  To that end the iptables rules will
> (should) always vary from box to box, whether it is a server, a desktop, a
> gateway, or some combination of the three.
Of course.

> New users looking to get their boxen online grab scripts like this thinking
> they are going to secure it for them, yet they don't understand the nuances
> of the individual rules nor how they are grouped.  How many folks that grab
> the script are going to know what the teamspeak or pgp ports are for and
> whether they need them or not?  How many are going to know that they've
> exposed their system to incoming teamspeak packets, whether they have
> teamspeak or not?
Even more: They are exposing their box to ALL packets on the teamspeak
port.
But IMO, it's easier to learn than some gui-things, you don't have to
transfer it over network to your firewall-box (who has X on a
firewall??? :-) ) and its easy to reconfigure.

Thanks for the feedback. really.


 Timo

-- 
gentoo-user@gentoo.org mailing list



      reply	other threads:[~2005-09-10 17:19 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-06 17:22 [gentoo-user] iptables example on Gentoo James
2005-09-06 17:39 ` Dave Nebinger
2005-09-06 17:53   ` Holly Bostick
2005-09-06 18:25     ` [gentoo-user] " James
2005-09-06 19:04       ` Dave Nebinger
2005-09-06 20:00         ` James
2005-09-06 20:39           ` Dave Nebinger
2005-09-07  0:02         ` gentuxx
2005-09-07  1:20           ` W.Kenworthy
2005-09-07 13:08           ` Dave Nebinger
2005-09-07 17:06             ` James
2005-09-07 18:14               ` Holly Bostick
2005-09-07 19:11                 ` James
2005-09-07 19:53                   ` Dave Nebinger
2005-09-08 18:14                     ` James
2005-09-08 19:30                       ` kashani
2005-09-07 20:09                   ` Holly Bostick
2005-09-07 18:40               ` gentuxx
2005-09-07 19:29                 ` James
2005-09-07 19:56                   ` gentuxx
2005-09-07 20:49                     ` Dave Nebinger
2005-09-07 18:48               ` Dave Nebinger
2005-09-07 22:08                 ` James
2005-09-07 23:51                   ` gentuxx
2005-09-08  1:23                     ` James
2005-09-08  9:20                       ` Neil Bothwick
2005-09-08 17:43                         ` James
2005-09-08 16:19                           ` James
2005-09-08 16:42                           ` Dave Nebinger
2005-09-09  9:44                             ` Michael Kintzios
2005-09-09 13:38                               ` Dave Nebinger
2005-09-08 17:35                           ` Neil Bothwick
2005-09-09  0:52                       ` Jerry McBride
2005-09-07 23:52               ` Rumen Yotov
2005-09-07 18:48                 ` James
2005-09-07 19:44   ` [gentoo-user] " Bryan Whitehead
2005-09-08  1:34     ` [gentoo-user] " James
2005-09-08 15:37       ` Rumen Yotov
2005-09-09 11:19   ` [gentoo-user] " Timo Boettcher
2005-09-09 14:23     ` Dave Nebinger
2005-09-10 17:04       ` Timo Boettcher [this message]

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=153940469.20050910190441@gmx.net \
    --to=spida@gmx.net \
    --cc=gentoo-user@lists.gentoo.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