Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "curby ." <curby.public@gmail.com>
To: Alexander Salmin <security.member@gmail.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Secure Firewall
Date: Fri, 12 Aug 2005 13:09:53 -0600	[thread overview]
Message-ID: <5d2f3791050812120926dc18a9@mail.gmail.com> (raw)
In-Reply-To: <393114f90508090624278c8414@mail.gmail.com>

On 8/9/05, Alexander Salmin <security.member@gmail.com> wrote:
> #1 --- 192.168.51.20 --- Should be able to access all internet.
> #2 --- 192.168.51.40 --- Should be able to access only websites (port 80,443).
> #3 --- 192.168.51.80 --- Should be able to access only websites (port 80,443).

Consider your reasons for restricting #2 and #3.  It is trivially easy
to get around port restrictions only (just run a ssh server on port 80
for example).

> This is how my non-working iptables-script looks like right now:
> -------------------------------------------------------------------------------------
> INT="eth0"
> EXT="eth1"
> IPTABLES=/sbin/iptables
> 
> $IPTABLES -F INPUT
> $IPTABLES -F OUTPUT
> $IPTABLES -F FORWARD
> $IPTABLES -F -t nat
> 
> $IPTABLES -P INPUT DROP
> $IPTABLES -P OUTPUT DROP
> $IPTABLES -P FORWARD DROP
> 
> $IPTABLES -A INPUT -i $INT -m state --state ESTABLISHED,RELATED -j ACCEPT
> $IPTABLES -A INPUT -i eth0 -p icmp -j ACCEPT
> $IPTABLES -A INPUT -p UDP --dport bootps -i $INT -j ACCEPT
> $IPTABLES -A INPUT -p UDP --dport domain -i $INT -j ACCEPT

Since you have no OUTPUT rules and OUTPUT drops by default, these
INPUT rules don't do anything useful.  You probably want to allow
ESTABLISHED,RELATED traffic in OUTPUT as well, for example.

> $IPTABLES -t nat -A POSTROUTING -s 192.168.51.20 -o $EXT -j MASQUERADE
> $IPTABLES -t nat -A POSTROUTING -s 192.168.51.40 -dport 80 -o $EXT -j MASQUERADE
> $IPTABLES -t nat -A POSTROUTING -s 192.168.51.80 -dport 80 -o $EXT -j MASQUERADE
> 
> $IPTABLES -A INPUT -j DROP
> -------------------------------------------------------------------------------------
 
Definitely add the FORWARD rules spooker talked about.  And consider
some more intelligent/"deep" traffic inspection if you want to
restrict some of your hosts.


      parent reply	other threads:[~2005-08-12 19:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 13:24 Secure Firewall Alexander Salmin
2005-08-11 13:29 ` Sp0oKeR
2005-08-12 19:09 ` curby . [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=5d2f3791050812120926dc18a9@mail.gmail.com \
    --to=curby.public@gmail.com \
    --cc=netfilter@lists.netfilter.org \
    --cc=security.member@gmail.com \
    /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