public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Bernhard Bitsch <bbitsch@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH v3 3/7] firewall: Fixes bug12981 - add if loop to log or not log dropped hostile traffic
Date: Mon, 22 Jan 2024 11:51:06 +0100	[thread overview]
Message-ID: <4e00a94f-6e95-413f-85e7-fc7b1df9e692@ipfire.org> (raw)
In-Reply-To: <20240121114553.5182-3-adolf.belka@ipfire.org>

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

Reviewed-by: Bernhard Bitsch <bbitsch(a)ipfire.org>

Am 21.01.2024 um 12:45 schrieb Adolf Belka:
> - This v3 version now has two if loops allowing logging of incoming drop hostile or
>     outgoing drop hostile or both or neither.
> - Dependent on the choice in optionsfw.cgi this loop will either log or not log the
>     dropped hostile traffic.
> 
> Fixes: bug12981
> Tested-by: Adolf Belka <adolf.belka(a)ipfire.org>
> Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
> ---
>   src/initscripts/system/firewall | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/src/initscripts/system/firewall b/src/initscripts/system/firewall
> index 50f2b3e02..840ae3150 100644
> --- a/src/initscripts/system/firewall
> +++ b/src/initscripts/system/firewall
> @@ -176,9 +176,18 @@ iptables_init() {
>   	iptables -A FORWARD -j HOSTILE
>   	iptables -A OUTPUT -j HOSTILE
>   
> -	iptables -N HOSTILE_DROP
> -	iptables -A HOSTILE_DROP -m limit --limit 10/second -j LOG --log-prefix "DROP_HOSTILE "
> -	iptables -A HOSTILE_DROP -j DROP -m comment --comment "DROP_HOSTILE"
> +	iptables -N HOSTILE_DROP_IN
> +	if [ "$LOGDROPHOSTILEIN" == "on" ]; then
> +		iptables -A HOSTILE_DROP_IN -m limit --limit 10/second -j LOG --log-prefix "DROP_HOSTILE "
> +	fi
> +	iptables -A HOSTILE_DROP_IN -j DROP -m comment --comment "DROP_HOSTILE"
> +
> +	iptables -N HOSTILE_DROP_OUT
> +	if [ "$LOGDROPHOSTILEOUT" == "on" ]; then
> +		iptables -A HOSTILE_DROP_OUT -m limit --limit 10/second -j LOG --log-prefix "DROP_HOSTILE "
> +	fi
> +	iptables -A HOSTILE_DROP_OUT -j DROP -m comment --comment "DROP_HOSTILE"
> +
>   
>   	# IP Address Blocklist chains
>   	iptables -N BLOCKLISTIN

  reply	other threads:[~2024-01-22 10:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21 11:45 [PATCH v3 1/7] optionsfw.cgi: Fix bug12981 - Add option " Adolf Belka
2024-01-21 11:45 ` [PATCH v3 2/7] rules.pl: Fixes bug12981 - Add in and out specific actions for drop hostile Adolf Belka
2024-01-22 10:48   ` Bernhard Bitsch
2024-01-21 11:45 ` [PATCH v3 3/7] firewall: Fixes bug12981 - add if loop to log or not log dropped hostile traffic Adolf Belka
2024-01-22 10:51   ` Bernhard Bitsch [this message]
2024-01-21 11:45 ` [PATCH v3 4/7] en.pl: Fixes bug12981 - adds english language input for choice of drop hostile logging Adolf Belka
2024-01-21 11:45 ` [PATCH v3 5/7] collectd.conf: Fix bug12981 - This creates in and out drop hostile data collection Adolf Belka
2024-01-21 11:45 ` [PATCH v3 6/7] graphs.pl: Fixes bug12981 - Creates in and outgoing drop hostile graph entries Adolf Belka
2024-01-21 11:45 ` [PATCH v3 7/7] optionsfw.cgi: Move Firewall Options Drop commands to before the logging section Adolf Belka
2024-01-22 13:43 ` [PATCH v3 1/7] optionsfw.cgi: Fix bug12981 - Add option to log or not log dropped hostile traffic Bernhard Bitsch

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=4e00a94f-6e95-413f-85e7-fc7b1df9e692@ipfire.org \
    --to=bbitsch@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