| Message ID | 20211107174000.16210-1-frank@lichtenheld.com |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director9.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id yFg1BOkTiGEGKgAAIUCqbw (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Sun, 07 Nov 2021 12:59:05 -0500 Received: from proxy11.mail.ord1d.rsapps.net ([172.30.191.6]) by director9.mail.ord1d.rsapps.net with LMTP id sIIFBOkTiGGrAQAAalYnBA (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Sun, 07 Nov 2021 12:59:05 -0500 Received: from smtp20.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy11.mail.ord1d.rsapps.net with LMTPS id MGhGDdcTiGFiXgAAgKDEHA (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) for <patchwork@openvpn.net>; Sun, 07 Nov 2021 12:58:47 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp20.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=lichtenheld.com X-Suspicious-Flag: YES X-Classification-ID: 6503480a-3ff4-11ec-940d-bc305bf03180-1-1 Received: from [216.105.38.7] ([216.105.38.7:44384] helo=lists.sourceforge.net) by smtp20.gate.ord1c.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id A1/57-14176-8E318816; Sun, 07 Nov 2021 12:59:04 -0500 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1mjmQb-0002xf-SR; Sun, 07 Nov 2021 17:58:01 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <frank@lichtenheld.com>) id 1mjmQa-0002xU-7t for openvpn-devel@lists.sourceforge.net; Sun, 07 Nov 2021 17:58:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Wy45r597lr/OgHNF00Yp+PsJVDNFMxYX+R7YW0igVa0=; b=AAls5K7rH4hYAKX6Bpf4qpDBmT yjFoSO1rwKrNk+mFZF5MTSZFLElk0m6cOAZ+JxlIRBoQm5NWm6YElCZskCvDB81VkmsdBZ7r3zmQC iga4zCJvJWnfJowquieoGOL2q3Ml1jy5l7uja4EM6YoyTkVSIZE+wHPQs4u1LUtS6mJs=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=Wy45r597lr/OgHNF00Yp+PsJVDNFMxYX+R7YW0igVa0=; b=Y 1keJMizxKe4U5CCpu/gPfwlLpINARtE1bi5ZSeSz0kLzUCemT6xylHk82cjnnoWtdhHEfq/1bwAar ZaDLm9R966jhoAryKWdMecFu3HiVw5thNwE4NvNbIIMM/E4UyYoT3nJ/BBR6e9g++aMtCMYwpdoPV XwsvlaqHSdOEuOjM=; Received: from mout-p-102.mailbox.org ([80.241.56.152]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) id 1mjmQY-005FGq-89 for openvpn-devel@lists.sourceforge.net; Sun, 07 Nov 2021 17:58:00 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4HnM2g3wKDzQjXy; Sun, 7 Nov 2021 18:40:11 +0100 (CET) From: Frank Lichtenheld <frank@lichtenheld.com> To: openvpn-devel@lists.sourceforge.net Date: Sun, 7 Nov 2021 18:40:00 +0100 Message-Id: <20211107174000.16210-1-frank@lichtenheld.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: EDAC6188C X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Adrian <adrian.crespo@protonmail.com> The man page says: [!] -s, --source address[/mask][, ...] Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> --- sample/sample-config-files/firewall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (-0.7 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: firewall.sh] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [80.241.56.152 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [80.241.56.152 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-Headers-End: 1mjmQY-005FGq-89 Subject: [Openvpn-devel] [PATCH] Fix error in example firewall.sh script X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Cc: Adrian <adrian.crespo@protonmail.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel] Fix error in example firewall.sh script
|
|
Commit Message
Frank Lichtenheld
Nov. 7, 2021, 6:40 a.m. UTC
From: Adrian <adrian.crespo@protonmail.com> The man page says: [!] -s, --source address[/mask][,...] Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> --- sample/sample-config-files/firewall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) As part of an initative to clean up the Github PR submissions, submitting this patch to the mailing list for inclusion. Looks obviously correct to me.
Comments
Am 07.11.21 um 18:40 schrieb Frank Lichtenheld: > From: Adrian <adrian.crespo@protonmail.com> > > The man page says: > [!] -s, --source address[/mask][,...] > > Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> > --- > sample/sample-config-files/firewall.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > As part of an initative to clean up the Github PR submissions, submitting > this patch to the mailing list for inclusion. Looks obviously correct to > me. > > diff --git a/sample/sample-config-files/firewall.sh b/sample/sample-config-files/firewall.sh > index 19d75ee9..456700ca 100755 > --- a/sample/sample-config-files/firewall.sh > +++ b/sample/sample-config-files/firewall.sh > @@ -50,7 +50,7 @@ iptables -A OUTPUT -p tcp --sport 137:139 -o eth0 -j DROP > iptables -A OUTPUT -p udp --sport 137:139 -o eth0 -j DROP > > # Check source address validity on packets going out to internet > -iptables -A FORWARD -s ! $PRIVATE -i eth1 -j DROP > +iptables -A FORWARD ! -s $PRIVATE -i eth1 -j DROP > > # Allow local loopback > iptables -A INPUT -s $LOOP -j ACCEPT > I have a vague idea that this is actually different. Like one is that condition is not fulfilled and the other is that it is not part of the subnet if is different when there is different protocol but I might misremember. Arne
> Arne Schwabe <arne@rfc2549.org> hat am 08.11.2021 12:36 geschrieben: > > > Am 07.11.21 um 18:40 schrieb Frank Lichtenheld: > > From: Adrian <adrian.crespo@protonmail.com> > > > > The man page says: > > [!] -s, --source address[/mask][,...] > > > > Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> > > --- > > sample/sample-config-files/firewall.sh | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > As part of an initative to clean up the Github PR submissions, submitting > > this patch to the mailing list for inclusion. Looks obviously correct to > > me. > > > > diff --git a/sample/sample-config-files/firewall.sh b/sample/sample-config-files/firewall.sh > > index 19d75ee9..456700ca 100755 > > --- a/sample/sample-config-files/firewall.sh > > +++ b/sample/sample-config-files/firewall.sh > > @@ -50,7 +50,7 @@ iptables -A OUTPUT -p tcp --sport 137:139 -o eth0 -j DROP > > iptables -A OUTPUT -p udp --sport 137:139 -o eth0 -j DROP > > > > # Check source address validity on packets going out to internet > > -iptables -A FORWARD -s ! $PRIVATE -i eth1 -j DROP > > +iptables -A FORWARD ! -s $PRIVATE -i eth1 -j DROP > > > > # Allow local loopback > > iptables -A INPUT -s $LOOP -j ACCEPT > > > > > I have a vague idea that this is actually different. Like one is that > condition is not fulfilled and the other is that it is not part of the > subnet if is different when there is different protocol but I might > misremember. Certainly does not work with my iptables: # iptables -A OUTPUT -s ! 10.0.0.0/8 -j ACCEPT Bad argument `10.0.0.0/8' Try `iptables -h' or 'iptables --help' for more information. # iptables -A OUTPUT ! -s 10.0.0.0/8 -j ACCEPT # Regards, Frank
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Hi Sent with ProtonMail Secure Email. ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Monday, November 8th, 2021 at 12:23, Frank Lichtenheld <frank@lichtenheld.com> wrote: > > Arne Schwabe arne@rfc2549.org hat am 08.11.2021 12:36 geschrieben: > > > > Am 07.11.21 um 18:40 schrieb Frank Lichtenheld: > > > > > From: Adrian adrian.crespo@protonmail.com > > > > > > The man page says: > > > > > > [!] -s, --source address[/mask][,...] > > > > > > Signed-off-by: Frank Lichtenheld frank@lichtenheld.com > > > ------------------------------------------------------ > > > > > > sample/sample-config-files/firewall.sh | 2 +- > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > As part of an initative to clean up the Github PR submissions, submitting > > > > > > this patch to the mailing list for inclusion. Looks obviously correct to > > > > > > me. > > > > > > diff --git a/sample/sample-config-files/firewall.sh b/sample/sample-config-files/firewall.sh > > > > > > index 19d75ee9..456700ca 100755 > > > > > > --- a/sample/sample-config-files/firewall.sh > > > > > > +++ b/sample/sample-config-files/firewall.sh > > > > > > @@ -50,7 +50,7 @@ iptables -A OUTPUT -p tcp --sport 137:139 -o eth0 -j DROP > > > > > > iptables -A OUTPUT -p udp --sport 137:139 -o eth0 -j DROP > > > > > > Check source address validity on packets going out to internet > > > ============================================================== > > > > > > -iptables -A FORWARD -s ! $PRIVATE -i eth1 -j DROP > > > > > > +iptables -A FORWARD ! -s $PRIVATE -i eth1 -j DROP > > > > > > Allow local loopback > > > ==================== > > > > > > iptables -A INPUT -s $LOOP -j ACCEPT > > > > I have a vague idea that this is actually different. Like one is that > > > > condition is not fulfilled and the other is that it is not part of the > > > > subnet if is different when there is different protocol but I might > > > > misremember. > > Certainly does not work with my iptables: > > iptables -A OUTPUT -s ! 10.0.0.0/8 -j ACCEPT > ============================================ > > Bad argument `10.0.0.0/8' Try` iptables -h' or 'iptables --help' for more information. > > iptables -A OUTPUT ! -s 10.0.0.0/8 -j ACCEPT > ============================================ > From: https://ipset.netfilter.org/iptables.man.html [!] -s, --source address[/mask][,...] Source specification. Address can be either a network name, a hostname, a network IP address (with /mask), or a plain IP address. Hostnames will be resolved once only, before the rule is submitted to the kernel. Please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea. The mask can be either an ipv4 network mask (for iptables) or a plain number, specifying the number of 1's at the left side of the network mask. Thus, an iptables mask of 24 is equivalent to 255.255.255.0. A "!" argument before the address specification inverts the sense of the address. The flag --src is an alias for this option. Multiple addresses can be specified, but this will expand to multiple rules (when adding with -A), or will cause multiple rules to be deleted (with -D). R -----BEGIN PGP SIGNATURE----- Version: ProtonMail wsBzBAEBCAAGBQJhiSw2ACEJEE+XnPZrkLidFiEECbw9RGejjXJ5xVVVT5ec 9muQuJ1jZAf/b2mzU/9kXQIIvNAhICrkyDc68AnyR5GRlMItdo91prqcH/bn ksBxh5OolZeq7Md7K6O63DZgL3Kdj0HpUGavPonVgIrBXj1QoQW69KiEp9/A 98UixypgCCi3yy4wii510Wn9F8ZFmfQBk9l/ilRB5tT+oU6/KyvaZmwz2kRQ pkmcvXWI40LEvjMXA1Ye5Usn7a1yf5lP2YbJyvhE8mG64mZo6/2fePyTuASd EhCzxoQ1QIUy/jHL6FCHac6Gt2lx5JH73CI9lKzczvfZmq4Y7a3I5+rjpP2w Gx4YdA/PkRK5QJtn/KHppCZx4FdYBSvW2Aqq+fSrhzPam//qXQLt6g== =8IIR -----END PGP SIGNATURE-----
On 08/11/2021 13:23, Frank Lichtenheld wrote: > >> Arne Schwabe <arne@rfc2549.org> hat am 08.11.2021 12:36 geschrieben: >> >> >> Am 07.11.21 um 18:40 schrieb Frank Lichtenheld: >>> From: Adrian <adrian.crespo@protonmail.com> >>> >>> The man page says: >>> [!] -s, --source address[/mask][,...] >>> >>> Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> >>> --- >>> sample/sample-config-files/firewall.sh | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> As part of an initative to clean up the Github PR submissions, submitting >>> this patch to the mailing list for inclusion. Looks obviously correct to >>> me. >>> >>> diff --git a/sample/sample-config-files/firewall.sh b/sample/sample-config-files/firewall.sh >>> index 19d75ee9..456700ca 100755 >>> --- a/sample/sample-config-files/firewall.sh >>> +++ b/sample/sample-config-files/firewall.sh >>> @@ -50,7 +50,7 @@ iptables -A OUTPUT -p tcp --sport 137:139 -o eth0 -j DROP >>> iptables -A OUTPUT -p udp --sport 137:139 -o eth0 -j DROP >>> >>> # Check source address validity on packets going out to internet >>> -iptables -A FORWARD -s ! $PRIVATE -i eth1 -j DROP >>> +iptables -A FORWARD ! -s $PRIVATE -i eth1 -j DROP >>> >>> # Allow local loopback >>> iptables -A INPUT -s $LOOP -j ACCEPT >>> >> >> >> I have a vague idea that this is actually different. Like one is that >> condition is not fulfilled and the other is that it is not part of the >> subnet if is different when there is different protocol but I might >> misremember. > > Certainly does not work with my iptables: > # iptables -A OUTPUT -s ! 10.0.0.0/8 -j ACCEPT > Bad argument `10.0.0.0/8' > Try `iptables -h' or 'iptables --help' for more information. > # iptables -A OUTPUT ! -s 10.0.0.0/8 -j ACCEPT > # > > Regards, > Frank I remember iptables announced it would redo the parsing logic for the command line interfaces ages ago, where the negation needed to happen before the "rule parameter" (-s in this case). It's probably closer to 8-10 years since this change, unless my memory is completely corrupted.
On 07/11/2021 18:40, Frank Lichtenheld wrote: > From: Adrian <adrian.crespo@protonmail.com> > > The man page says: > [!] -s, --source address[/mask][,...] > > Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> > --- > sample/sample-config-files/firewall.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > As part of an initative to clean up the Github PR submissions, submitting > this patch to the mailing list for inclusion. Looks obviously correct to > me. > > diff --git a/sample/sample-config-files/firewall.sh b/sample/sample-config-files/firewall.sh > index 19d75ee9..456700ca 100755 > --- a/sample/sample-config-files/firewall.sh > +++ b/sample/sample-config-files/firewall.sh > @@ -50,7 +50,7 @@ iptables -A OUTPUT -p tcp --sport 137:139 -o eth0 -j DROP > iptables -A OUTPUT -p udp --sport 137:139 -o eth0 -j DROP > > # Check source address validity on packets going out to internet > -iptables -A FORWARD -s ! $PRIVATE -i eth1 -j DROP > +iptables -A FORWARD ! -s $PRIVATE -i eth1 -j DROP > > # Allow local loopback > iptables -A INPUT -s $LOOP -j ACCEPT > This change makes sense to me. The syntax changed ages ago for iptables, where the negation needed to happen first. Acked-By: David Sommerseth <davids@openvpn.net> -- kind regards, David Sommerseth OpenVPN Inc
Your patch has been applied to the master and release/2.5 branch (bugfix).
Thanks!
commit d720c5fd45d5c61b9c797172f8d6a7eaa35b959c (master)
commit 6b2c423aa42a11b41f90aad8f53db71703cee2e2 (release/2.5)
Author: Adrian
Date: Sun Nov 7 18:40:00 2021 +0100
Fix error in example firewall.sh script
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: David Sommerseth <davids@openvpn.net>
Message-Id: <20211107174000.16210-1-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23128.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/sample/sample-config-files/firewall.sh b/sample/sample-config-files/firewall.sh index 19d75ee9..456700ca 100755 --- a/sample/sample-config-files/firewall.sh +++ b/sample/sample-config-files/firewall.sh @@ -50,7 +50,7 @@ iptables -A OUTPUT -p tcp --sport 137:139 -o eth0 -j DROP iptables -A OUTPUT -p udp --sport 137:139 -o eth0 -j DROP # Check source address validity on packets going out to internet -iptables -A FORWARD -s ! $PRIVATE -i eth1 -j DROP +iptables -A FORWARD ! -s $PRIVATE -i eth1 -j DROP # Allow local loopback iptables -A INPUT -s $LOOP -j ACCEPT