public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Rob Brewer <ipfire-devel@grantura.co.uk>
To: development@lists.ipfire.org
Subject: Re: Logging Locationblock packets [PATCH]
Date: Fri, 22 Nov 2024 16:04:51 +0000	[thread overview]
Message-ID: <vhqa33$59jr$3@tuscan4.grantura.co.uk> (raw)
In-Reply-To: <vhlq5n$3ugod$3@tuscan4.grantura.co.uk>

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

On Wed, 20 Nov 2024 23:08:39 -0000 (UTC), Rob Brewer wrote:

Sorry I got caught out by my editor's word wrap. I've now turned it off
so hopefully this will be OK.

Rob 

> OK - I have modified location-block.cgi to add an additional checkbox at
> the top of the page titled "Log dropped packets", very similar to
> ipblocklist.cgi. This adds a entry to the /var/ipfire/firewall/
> locationblock settings file ON or OFF.
>

/srv/web/ipfire/cgi-bin/location-block.cgi
=========================================================
62a63,69
> # Check if we want to disable logging.
> if (exists $cgiparams{'LOGGING_ENABLED'}) {
> $settings{'LOGGING_ENABLED'} = "on";
> } else {
> $settings{'LOGGING_ENABLED'} = "off";
> }
>
93a101
> my $logging;
97a106,111
> if ($settings{'LOGGING_ENABLED'} eq "on") {
> $logging = "checked='checked'";
> }
>
>
>
108a123,125
> <td width='50%' class='base'>$Lang::tr{'ipblocklist log'}
> <td><input type='checkbox' name='LOGGING_ENABLED' $logging></td>
> </tr>
====================================================================


> In /usr/lib/firewall/rules.pl I add an additional Iptables LOCATIONBLOCK
> log rule with the prefix 'LOCBLOCK-$location '. This is selectable from
> the Log dropped packets entry in the locationblock settings file.
>


/usr/lib/firewall/rules.pl
=====================================================================
76c76,77
<       "LOCATIONBLOCK_ENABLED" => "off"
---
> "LOCATIONBLOCK_ENABLED" => "off",
> "LOGGING_ENABLED" => "off",
719a721,725
>
> # add loggging if enabled from location-block.cgi
> if ($locationsettings{'LOGGING_ENABLED'} eq "on") {     
> run("$IPTABLES -A LOCATIONBLOCK -m set --match-set $location src -j LOG --log-prefix 'LOCBLOCK-$location '");
> }
=======================================================================
End of encapsulated message

  parent reply	other threads:[~2024-11-22 16:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-09 14:00 Logging Locationblock packets Rob Brewer
2024-11-19 17:10 ` Michael Tremer
2024-11-20 13:36   ` Rob Brewer
2024-11-20 14:13     ` Adolf Belka
2024-11-20 15:21     ` Michael Tremer
2024-11-20 23:08       ` Rob Brewer
2024-11-22 15:36         ` Logging Locationblock packets [PATCH] Rob Brewer
2024-11-22 16:04         ` Rob Brewer [this message]
2024-11-23  9:26         ` Logging Locationblock packets Michael Tremer
2024-11-23 14:36           ` Rob Brewer
2024-11-23 14:47             ` Adolf Belka
2024-11-25  9:49               ` 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='vhqa33$59jr$3@tuscan4.grantura.co.uk' \
    --to=ipfire-devel@grantura.co.uk \
    --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