From: Patrick McHardy <kaber@trash.net>
To: John Lange <john.lange@open-it.ca>
Cc: netfilter-develop <netfilter-devel@lists.netfilter.org>
Subject: Re: iptables --log-uid patch for 2.6
Date: Wed, 08 Dec 2004 18:07:25 +0100 [thread overview]
Message-ID: <41B734CD.6010903@trash.net> (raw)
In-Reply-To: <1102486259.2214.2276.camel@ws102.darkcore.net>
John Lange wrote:
>Thanks for response Patrick.
>
>One small note...
>
>I believe there is a limitation to this approach that makes it tricky
>for blocking outbound packets. I hope you have a work-around.
>
>Specifically, there is no way to allow packets that have no UID set such
>as packets generated directly by the kernel.
>
>The following rules were designed to block users from (accidentally)
>installing spam relays on their web accounts (bad CGI scripts for
>example).
>
>I hope this example makes some sense:
>
>e.g.
>
># first allow root (this allows root, but NOT the kernel!)
>iptables -A OUTPUT -p ALL -m owner --uid-owner 0 -j ACCEPT
>
># allow anyone in the mail group
>iptables -A OUTPUT -p tcp -m owner --gid-owner 102 --dport 25 -j ACCEPT
>
>iptables -A OUTPUT -p tcp --dport 25 -j LOG --log-uid
>iptables -A OUTPUT -p tcp --dport 25 -j DROP
>
>----
>
>Packets generated directly by the kernel (like RST packets) have no UID
>set and therefore get blocked....
>
>
I have a patch that lets you match "--owner" or "! --owner", this
should be enough. I'm going to merge it some time soon. You can
also use connection tracking, this should catch packets generated
by the kernel.
Regards
Patrick
next prev parent reply other threads:[~2004-12-08 17:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-28 18:55 iptables --log-uid patch for 2.6 John Lange
2004-12-08 4:33 ` Patrick McHardy
2004-12-08 6:10 ` John Lange
2004-12-08 17:07 ` Patrick McHardy [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-11-27 22:30 John Lange
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=41B734CD.6010903@trash.net \
--to=kaber@trash.net \
--cc=john.lange@open-it.ca \
--cc=netfilter-devel@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.