public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Arne Fitzenreiter <arne_f@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH] firewall: Add proper logging prefix for conntrack INVALID hits
Date: Fri, 18 Feb 2022 07:57:04 +0100	[thread overview]
Message-ID: <ae96eb9906f2afb2b8a3bcd5aae61e42@ipfire.org> (raw)
In-Reply-To: <c9cdec8e-bec6-1793-2b8e-7a83e6f7d2d8@ipfire.org>

[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]

Hi Peter,

i ack that this fixes the empty loglines but i have seen an other 
problem with dropping all "invalid" packets.
The ICMP reject messages if something is not allowed has --ctstate 
INVALID and should processed.

Also i miss a switch to disable the logging.

Arne


Am 2022-02-17 21:16, schrieb Peter Müller:
> Fixes: #12778
> 
> Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
> ---
>  src/initscripts/system/firewall | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/initscripts/system/firewall 
> b/src/initscripts/system/firewall
> index fc355cd5d..2f4b4e30e 100644
> --- a/src/initscripts/system/firewall
> +++ b/src/initscripts/system/firewall
> @@ -119,9 +119,13 @@ iptables_init() {
>  	iptables -A FORWARD -p tcp -j BADTCP
> 
>  	# Connection tracking chains
> +	iptables -N CTINVALID
> +	iptables -A CTINVALID  -m limit --limit 10/second -j LOG
> --log-prefix "DROP_CTINVALID "
> +	iptables -A CTINVALID  -j DROP -m comment --comment "DROP_CTINVALID"
> +
>  	iptables -N CONNTRACK
>  	iptables -A CONNTRACK -m conntrack --ctstate ESTABLISHED -j ACCEPT
> -	iptables -A CONNTRACK -m conntrack --ctstate INVALID -j LOG_DROP
> +	iptables -A CONNTRACK -m conntrack --ctstate INVALID -j CTINVALID
>  	iptables -A CONNTRACK -p icmp -m conntrack --ctstate RELATED -j 
> ACCEPT
> 
>  	# Restore any connection marks

  reply	other threads:[~2022-02-18  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-17 20:16 Peter Müller
2022-02-18  6:57 ` Arne Fitzenreiter [this message]
2022-02-18  8:22   ` Michael Tremer

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=ae96eb9906f2afb2b8a3bcd5aae61e42@ipfire.org \
    --to=arne_f@ipfire.org \
    --cc=development@lists.ipfire.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