* [git.ipfire.org] IPFire 2.x development tree branch, core84, updated. 402c0097ec47b82437296507bc2c5118b8cf9401
@ 2014-10-04 12:21 git
0 siblings, 0 replies; only message in thread
From: git @ 2014-10-04 12:21 UTC (permalink / raw)
To: ipfire-scm
[-- Attachment #1: Type: text/plain, Size: 2814 bytes --]
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".
The branch, core84 has been updated
via 402c0097ec47b82437296507bc2c5118b8cf9401 (commit)
from e43b21264f8b0c28a9b03f8f65d46e47572df719 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 402c0097ec47b82437296507bc2c5118b8cf9401
Author: Arne Fitzenreiter <arne_f(a)ipfire.org>
Date: Sat Oct 4 14:18:16 2014 +0200
P2PBLOCK: IPP2P must run before CONNTRACK
and can only used for blocking, not for accept conenections bacause connections must already established for detecting protocol types.
-----------------------------------------------------------------------
Summary of changes:
config/firewall/rules.pl | 16 +++-------------
src/initscripts/init.d/firewall | 5 +++++
2 files changed, 8 insertions(+), 13 deletions(-)
Difference in files:
diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl
index 4d70382..58cc439 100755
--- a/config/firewall/rules.pl
+++ b/config/firewall/rules.pl
@@ -554,29 +554,19 @@ sub time_convert_to_minutes {
}
sub p2pblock {
- my $search_action;
- my $target;
-
- if ($fwdfwsettings{"POLICY"} eq "MODE1") {
- $search_action = "on";
- $target = "ACCEPT";
- } else {
- $search_action = "off";
- $target = "DROP";
- }
-
open(FILE, "<$p2pfile") or die "Unable to read $p2pfile";
my @protocols = ();
foreach my $p2pentry (<FILE>) {
my @p2pline = split(/\;/, $p2pentry);
- next unless ($p2pline[2] eq $search_action);
+ next unless ($p2pline[2] eq "off";
push(@protocols, "--$p2pline[1]");
}
close(FILE);
if (@protocols) {
- run("$IPTABLES -A FORWARDFW -m ipp2p @protocols -j $target");
+ run("$IPTABLES -F P2PBLOCK");
+ run("$IPTABLES -A P2PBLOCK -m ipp2p @protocols -j DROP");
}
}
diff --git a/src/initscripts/init.d/firewall b/src/initscripts/init.d/firewall
index 66ca432..9620c80 100644
--- a/src/initscripts/init.d/firewall
+++ b/src/initscripts/init.d/firewall
@@ -84,6 +84,11 @@ iptables_init() {
iptables -A INPUT -p tcp -j BADTCP
iptables -A FORWARD -p tcp -j BADTCP
+ # P2P Block (must before connection tracking)
+ iptables -N P2PBLOCK
+ iptables -A INPUT -p tcp -j P2PBLOCK
+ iptables -A FORWARD -p tcp -j P2PBLOCK
+
# Connection tracking chain
iptables -N CONNTRACK
iptables -A CONNTRACK -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
hooks/post-receive
--
IPFire 2.x development tree
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-04 12:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-04 12:21 [git.ipfire.org] IPFire 2.x development tree branch, core84, updated. 402c0097ec47b82437296507bc2c5118b8cf9401 git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox