unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#48753] iptables example update
@ 2021-05-30 21:07 Eric Brown
  2021-06-03 18:46 ` bug#48753: " Arun Isaac
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Brown @ 2021-05-30 21:07 UTC (permalink / raw)
  To: 48753

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

Dear List,

I have often puzzled over the iptables example that is given in the Guix manual.

It seems that this rule would allow someone to ssh in, but would not
practically allow ssh *outward* because the session would not be able to
receive a response.

I've added what I think is a line that fixes the issue.

Best regards,
Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: iptables update --]
[-- Type: text/x-diff, Size: 1042 bytes --]

From 44faa84695a5df7a0a3c3a35520d70f255b9fe53 Mon Sep 17 00:00:00 2001
From: Eric Brown <ecbrown@ericcbrown.com>
Date: Sun, 30 May 2021 22:00:52 +0100
Subject: [PATCH] doc: Updated iptables example

* doc/guix.texi (iptables): Update iptables example to allow (functioning) outbound SSH
---
 doc/guix.texi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index dc10e88123..71851ca0b1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -16427,6 +16427,7 @@ configuration rejecting all incoming connections except those to the ssh port
 :INPUT ACCEPT
 :FORWARD ACCEPT
 :OUTPUT ACCEPT
+-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
 -A INPUT -p tcp --dport 22 -j ACCEPT
 -A INPUT -j REJECT --reject-with icmp-port-unreachable
 COMMIT
@@ -16435,6 +16436,7 @@ COMMIT
 :INPUT ACCEPT
 :FORWARD ACCEPT
 :OUTPUT ACCEPT
+-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
 -A INPUT -p tcp --dport 22 -j ACCEPT
 -A INPUT -j REJECT --reject-with icmp6-port-unreachable
 COMMIT
-- 
2.32.0.rc0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#48753: iptables example update
  2021-05-30 21:07 [bug#48753] iptables example update Eric Brown
@ 2021-06-03 18:46 ` Arun Isaac
  2021-06-06 18:52   ` [bug#48753] " Eric Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Arun Isaac @ 2021-06-03 18:46 UTC (permalink / raw)
  To: Eric Brown, 48753-done

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


Hi Eric,

I wrote the iptables service and documentation. So, the mistake is
entirely due to my poor grasp of iptables! :-)

I have applied your patch, and pushed to master. Thanks!

Cheers,
Arun

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#48753] iptables example update
  2021-06-03 18:46 ` bug#48753: " Arun Isaac
@ 2021-06-06 18:52   ` Eric Brown
  2021-06-16  7:18     ` Arun Isaac
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Brown @ 2021-06-06 18:52 UTC (permalink / raw)
  To: Arun Isaac, 48753-done

On Thu, Jun 3, 2021, at 1:46 PM, Arun Isaac wrote:
> 
> Hi Eric,
> 
> I wrote the iptables service and documentation. So, the mistake is
> entirely due to my poor grasp of iptables! :-)
> 
> I have applied your patch, and pushed to master. Thanks!
> 
> Cheers,
> Arun
> 
> Attachments:
> * signature.asc



Hi Arun,

Thank you for applying the patch, I think it’s much better. Truthfully i am relieved that you are an iptables newbie and so am I!

I think there could still be some work done to this recommendation.  For example, when I use this updated iptables firewall selection, I am unable to telnet into ports open on localhost.   An example is that I am a heavy user of VNC/SSH tunnel connections and it doesn’t let me do that, it blocks e.g. port 5902.    (A similar naive rule in nftables does let this work!!!)

But so many examples are given in iptables (esp. WireGuard stuff) and so if you have no objections, I would like to take a further look and maybe even ask around as to what the ‘ufw allow ssh’ behavior vis-a-vis iptables best practices.

Best regards,
Eric




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#48753] iptables example update
  2021-06-06 18:52   ` [bug#48753] " Eric Brown
@ 2021-06-16  7:18     ` Arun Isaac
  0 siblings, 0 replies; 4+ messages in thread
From: Arun Isaac @ 2021-06-16  7:18 UTC (permalink / raw)
  To: Eric Brown, 48753-done

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


Hi Eric,

> Thank you for applying the patch, I think it’s much better. Truthfully
> i am relieved that you are an iptables newbie and so am I!

:-P

> I think there could still be some work done to this recommendation.
> For example, when I use this updated iptables firewall selection, I am
> unable to telnet into ports open on localhost.  An example is that I
> am a heavy user of VNC/SSH tunnel connections and it doesn’t let me do
> that, it blocks e.g. port 5902.  (A similar naive rule in nftables
> does let this work!!!)

I'm not able to reproduce this. I built and started a container with an
ssh server on port 5902. And, I was able to connect fine with
telnet. Could you describe the precise steps, configuration, etc. to
reproduce this issue?

> But so many examples are given in iptables (esp. WireGuard stuff) and
> so if you have no objections, I would like to take a further look and
> maybe even ask around as to what the ‘ufw allow ssh’ behavior
> vis-a-vis iptables best practices.

Sure, please do! You don't need my permission for that! :-)

Regards,
Arun

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 524 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-16  7:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-30 21:07 [bug#48753] iptables example update Eric Brown
2021-06-03 18:46 ` bug#48753: " Arun Isaac
2021-06-06 18:52   ` [bug#48753] " Eric Brown
2021-06-16  7:18     ` Arun Isaac

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).