From: "Peter Müller" <peter.mueller@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH 05/11] firewall: Introduce DROP_HOSTILE
Date: Sat, 08 Jan 2022 11:39:45 +0100 [thread overview]
Message-ID: <28ee50cb-8eeb-535b-0b93-32a4ca4fd85e@ipfire.org> (raw)
In-Reply-To: <714365FA-2D67-41F7-97EF-21FFD3B487AC@ipfire.org>
[-- Attachment #1: Type: text/plain, Size: 2476 bytes --]
Hello Michael,
thanks for your reply.
This is good to know as I was surprised to see this working on my testing machine without
any further exports/converting/${whatever} of the location database. :-)
Thanks, and best regards,
Peter Müller
> Hello,
>
> I told you that you will need to export the lists before you can load them, but that seems to have been incorrect.
>
> Whenever we download the database, we extract everything:
>
> https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=src/scripts/update-location-database;h=06b22d101cafbb59c23c2c0310d35905b280d9dd;hb=HEAD
>
> So this should always work.
>
> -Michael
>
>> On 18 Dec 2021, at 13:48, Peter Müller <peter.mueller(a)ipfire.org> wrote:
>>
>> Similar to the Location block, this chain logs and drops all traffic
>> from and to networks known to pose technical threats to IPFire users.
>>
>> Doing so in a dedicated chain makes sense for transparency reasons, as
>> we won't interfer with other firewall rules or the Location block, so it
>> is always clear why a packet from or to such a network has been dropped.
>>
>> Signed-off-by: Peter Müller <peter.mueller(a)ipfire.org>
>> ---
>> src/initscripts/system/firewall | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/src/initscripts/system/firewall b/src/initscripts/system/firewall
>> index 9e62c0245..ebc8168ae 100644
>> --- a/src/initscripts/system/firewall
>> +++ b/src/initscripts/system/firewall
>> @@ -139,6 +139,20 @@ iptables_init() {
>> iptables -t nat -N CUSTOMPOSTROUTING
>> iptables -t nat -A POSTROUTING -j CUSTOMPOSTROUTING
>>
>> + # Log and drop any traffic from and to networks known as being hostile, posing
>> + # a technical threat to our users (i. e. listed at Spamhaus DROP et al.)
>> + if [ "$DROPHOSTILE" == "on" ]; then
>> + iptables -N DROP_HOSTILE
>> + iptables -A DROP_HOSTILE -m limit --limit 10/second -j LOG --log-prefix "DROP_HOSTILE "
>> +
>> + iptables -A INPUT -i $IFACE -m geoip --src-cc XD -j DROP_HOSTILE
>> + iptables -A FORWARD -i $IFACE -m geoip --src-cc XD -j DROP_HOSTILE
>> + iptables -A FORWARD -o $IFACE -m geoip --dst-cc XD -j DROP_HOSTILE
>> + iptables -A OUTPUT -o $IFACE -m geoip --src-cc XD -j DROP_HOSTILE
>> +
>> + iptables -A DROP_HOSTILE -j DROP -m comment --comment "DROP_HOSTILE"
>> + fi
>> +
>> # P2PBLOCK
>> iptables -N P2PBLOCK
>> iptables -A INPUT -j P2PBLOCK
>> --
>> 2.26.2
>
next prev parent reply other threads:[~2022-01-08 10:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-18 13:46 [PATCH 00/11] firewall: Introduce DROP_HOSTILE and improve spoofing logging/protection Peter Müller
2021-12-18 13:47 ` [PATCH 01/11] firewall: Log packets dropped due to conntrack INVALID state Peter Müller
2021-12-18 13:47 ` [PATCH 02/11] firewall: Accept inbound Tor traffic before applying the location filter Peter Müller
2022-01-07 16:58 ` Michael Tremer
2022-01-08 11:38 ` Peter Müller
2021-12-18 13:48 ` [PATCH 03/11] firewall: Log and drop spoofed loopback packets Peter Müller
2022-01-07 17:01 ` Michael Tremer
2022-01-08 11:43 ` Peter Müller
2022-01-16 15:14 ` Michael Tremer
2022-01-18 21:22 ` Peter Müller
2022-01-19 8:25 ` Michael Tremer
2021-12-18 13:48 ` [PATCH 04/11] firewall: Prevent spoofing our own RED IP address Peter Müller
2021-12-18 13:48 ` [PATCH 05/11] firewall: Introduce DROP_HOSTILE Peter Müller
2022-01-07 17:04 ` Michael Tremer
2022-01-08 10:39 ` Peter Müller [this message]
2021-12-18 13:49 ` [PATCH 06/11] optionsfw.cgi: Make logging of spoofed/martians packets and the DROP_HOSTILE filter configurable Peter Müller
2021-12-18 13:49 ` [PATCH 07/11] Update German and English translation files Peter Müller
2021-12-18 13:49 ` [PATCH 08/11] collectd.conf: Keep track of DROP_{HOSTILE,SPOOFED_MARTIAN} Peter Müller
2021-12-18 13:49 ` [PATCH 09/11] graphs.pl: Display spoofed and hostile traffic in firewall hits diagram as well Peter Müller
2021-12-18 13:50 ` [PATCH 10/11] configroot: Enable logging of spoofed packets/martians by default Peter Müller
2021-12-18 13:50 ` [PATCH 11/11] configroot: Drop traffic from and to hostile networks " Peter Müller
2022-01-07 16:57 ` [PATCH 00/11] firewall: Introduce DROP_HOSTILE and improve spoofing logging/protection 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=28ee50cb-8eeb-535b-0b93-32a4ca4fd85e@ipfire.org \
--to=peter.mueller@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