From: martin f krafft <madduck@madduck.net>
To: netfilter@vger.kernel.org
Subject: RFC 4890 (icmpv6 firewall recommendations) and ip6tables (was: ip6tables icmp conntracking on 2.6.18 vs 2.6.24)
Date: Fri, 4 Apr 2008 09:32:30 +0200 [thread overview]
Message-ID: <20080404073230.GA22259@piper.oerlikon.madduck.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0804031747120.18275@blackhole.kfki.hu>
[-- Attachment #1: Type: text/plain, Size: 3240 bytes --]
also sprach Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> [2008.04.03.1814 +0200]:
> In order to handle ICMPv6 in the best way I'd suggest to read
> rfc4890 titled Recommendations for Filtering ICMPv6 Messages in
> Firewalls, which even comes with a sample ip6tables script.
I read over that document and I am a bit dazzled at the complexity
of the resulting ip6tables ruleset after running the script. It does
certain things that I'd *hope* wouldn't be necessary because they
remind me of the patchwork that used to be packet filters in their
early days, blocking corner cases that nobody has thought of before.
It's 2008 now and ip6tables/netfilter is highly advanced, so when
I see stuff like this:
# Drop echo replies which have a multicast address as a destination
ip6tables -A icmpv6-filter -p icmpv6 -d ff00::/8 \
--icmpv6-type echo-reply -j DROP
I really scratch my head because either Linux should be dropping
such invalid messages itself, or at the very least, netfilter
should, and not even as part of --state INVALID dropping, since
those are invalid packets (if I understand this right) no matter
whether I am tracking state or not.
The next thing I really have to wonder about is why the author
iterates the error messages and for each, adds a rule like
ip6tables -A icmpv6-filter -m state -p icmpv6 \
-d $inner_prefix \
--state ESTABLISHED,RELATED
--icmpv6-type packet-too-big \
-j ACCEPT
for each.
This unnecessarily complicates the ruleset to the point an admin
will just lose track, I think. Why not just let a global --state
ESTABLISHED,RELATED rule accept those? I can hardly imagine a case
in which you don't want to ACCEPT ESTABLISHED,RELATED, and if you
do, you should be using NOTRACK, no?
Next, the script adds explicit DROP rules to the FORWARD chain for
most non-errors, like neighbor-solicitation and the like. Why? The
chain policy should be DROP and the ruleset limited to ACCEPTs, no?
I really wonder how this script made its way into an RFC. It's
hardly a recommendation, or well, it isn't a recommendation that's
built on any features in today's netfilter/ip6tables and general
kernel IP stack.
We're early enough in the IPv6 life-cycle that we can fix problems
at the core, rather than recommending rulesets with hundreds of
lines that guard against cases that should never happen anyway, or
rulesets which don't actually harness the power of the tools they
use.
I won't even mention stuff like typos, e.g. under "TIME EXCEEDED
ERROR MESSAGES" we find artifacts of copy-paste errors
("packet-too-big"). But then again, these days, ISO has lowered the
standards of, ha, "standards" anyway. But I won't mention it. :)
I still appreciate that you pointed out this RFC, Jozsef, it
contains a lot of good information and should be required reading
for any IPv6 firewall engineer. I hope you concur, however, that its
appendix B is useless.
--
martin | http://madduck.net/ | http://two.sentenc.es/
the images rushed around his mind and tried
to find somewhere to settle down and make sense.
-- douglas adams, "the hitchhiker's guide to the galaxy"
spamtraps: madduck.bogus@madduck.net
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-04-04 7:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-02 21:26 ip6tables icmp conntracking on 2.6.18 vs 2.6.24 martin f krafft
2008-04-02 21:44 ` Petr Pisar
2008-04-02 21:57 ` Jan Engelhardt
2008-04-02 22:05 ` martin f krafft
2008-04-03 8:18 ` martin f krafft
2008-04-03 9:29 ` Pascal Hambourg
2008-04-03 9:36 ` Nicolas KOWALSKI
2008-04-03 10:26 ` martin f krafft
2008-04-03 15:07 ` Pascal Hambourg
2008-04-03 15:23 ` martin f krafft
2008-04-03 23:00 ` Pascal Hambourg
2008-04-03 23:03 ` Pascal Hambourg
2008-04-04 8:50 ` martin f krafft
2008-04-04 16:19 ` Pascal Hambourg
2008-04-08 13:15 ` martin f krafft
2008-04-03 15:35 ` Nicolas KOWALSKI
2008-04-03 15:38 ` martin f krafft
2008-04-03 15:48 ` Nicolas KOWALSKI
2008-04-04 8:51 ` martin f krafft
2008-04-04 8:57 ` Nicolas KOWALSKI
2008-04-04 11:04 ` martin f krafft
2008-04-04 11:59 ` Nicolas KOWALSKI
2008-04-04 12:39 ` martin f krafft
2008-04-04 17:57 ` Nicolas KOWALSKI
2008-04-03 16:14 ` Jozsef Kadlecsik
2008-04-04 6:22 ` martin f krafft
2008-04-04 9:39 ` Jozsef Kadlecsik
2008-04-04 7:32 ` martin f krafft [this message]
2008-04-04 9:12 ` RFC 4890 (icmpv6 firewall recommendations) and ip6tables (was: ip6tables icmp conntracking on 2.6.18 vs 2.6.24) Jozsef Kadlecsik
2008-04-04 11:15 ` martin f krafft
2009-03-11 12:44 ` martin f krafft
2009-03-21 13:43 ` RFC 4890 (icmpv6 firewall recommendations) and ip6tables Chris Hills
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=20080404073230.GA22259@piper.oerlikon.madduck.net \
--to=madduck@madduck.net \
--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