All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eric Poulin" <epoulin@onepost.net>
To: netfilter@lists.netfilter.org
Subject: Output Chain Problem...
Date: Fri, 18 Jun 2004 08:44:14 -0400	[thread overview]
Message-ID: <005d01c45531$f6f4bfd0$800101df@lvl.digidyne.ca> (raw)

Good Day,

    I'm trying to harden a bit my firewall, who as been working perfectly in
the last 2 years. However, on of the chain I have never played with was the
OUTPUT chain. I never though that there could be a security breach with the
Default policy set to "ACCEPT" on it, but it goes against security "best
practices".

    Now, packet flow through a chain from top to bottom, and will hit the
Default Policy if no rules are match... My first test was to put those rules
in my output chain(That was completly empty before).

iptables -A OUTPUT -p ALL -s 127.0.0.1 -j ACCEPT
iptables -A OUTPUT -p ALL -s 192.168.0.0/24 -j ACCEPT
iptables -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT

    After this, I did try to set the Default policy to drop... Strangely, I
lost my ssh connection(but as expected, all my NAT rules continued to work
perfectly). So I changed the policy to accept again, and decided to log
every packet hitting the bottom of the chain(Without results, so I have
added a general ACCEPT rule for testing):

Chain OUTPUT (policy ACCEPT 19 packets, 2060 bytes)
    pkts      bytes target     prot opt in     out     source
destination
       0        0 ACCEPT     all  --  *      *       127.0.0.1
0.0.0.0/0
    2410   327840 ACCEPT     all  --  *      *       192.168.0.0/24
0.0.0.0/0
       2      128 ACCEPT     all  --  *      *       0.0.0.0/0
0.0.0.0/0          state NEW,RELATED,ESTABLISHED
       0        0 ACCEPT     all  --  *      *       0.0.0.0/0
0.0.0.0/0
       0        0 LOG        all  --  *      *       0.0.0.0/0
0.0.0.0/0          LOG flags 0 level 4 prefix `Output:'

    To my surprise, nothing seems to hit my LOG rule, and even the overall
ACCEPT rule... But again, as soon as I change the default policy to DROP, I
can't communicate with the box.

    Any idea? I must be missing something reallly obvious...

Eric



             reply	other threads:[~2004-06-18 12:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18 12:44 Eric Poulin [this message]
2004-06-18 13:02 ` Output Chain Problem Antony Stone
2004-06-18 13:28   ` Eric Poulin
2004-06-18 14:49     ` Antony Stone
2004-06-18 15:47       ` Output Chain Problem... (nfcan: addressed to exclusive sender for this address) Jim Laurino
2004-06-18 15:49       ` Jim Laurino

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='005d01c45531$f6f4bfd0$800101df@lvl.digidyne.ca' \
    --to=epoulin@onepost.net \
    --cc=netfilter@lists.netfilter.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.