Last modified by Tobias Wintrich on 2022/10/28 12:30

From version 9.1
edited by Tobias Wintrich
on 2022/10/28 10:09
Change comment: There is no comment for this version
To version 13.1
edited by Tobias Wintrich
on 2022/10/28 10:16
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,5 +1,7 @@
1 1  Das RangeeOS stellt keine grafische Benutzeroberfläche zur Erstellung und Verwaltung von Firewall Regeln bereit. Auf Wunsch können aber beliebige Regeln über das Linux Kommandozeilen Tool //**iptables **//erstellt und über das Skripte Modul auch auf verschiedene Geräte übertragen werden.
2 2  
3 +{{toc/}}
4 +
3 3  = Voraussetzung =
4 4  
5 5  Auf dem RangeeOS Client muss das Softwaremodul **scripts **in zur Firmware passender Version installiert sein.
... ... @@ -12,60 +12,45 @@
12 12  
13 13  Hier finden Sie verschiedene Regeln um nur definierten, eingehenden Datenverkehr zum RangeeOS auf Netzwerkebene zu erlauben . Das Blockieren ausgehender Verbindungen auf Clientseite wird nicht empfohlen.
14 14  
15 -In folgenden Beispielen werden diese Parameter von iptables verwendet:
17 + {{info}}Weitere Informationen zur Verwendung von iptables finden Sie hier:* [[https:~~/~~/linux.die.net/man/8/iptables>>url:https://linux.die.net/man/8/iptables]]
18 +* [[https:~~/~~/wiki.ubuntuusers.de/iptables/>>url:https://wiki.ubuntuusers.de/iptables/]]{{/info}}
16 16  
17 -{{{-A => --append
18 --p => --protocol
19 --s => --source
20 --m => --match
21 --j => --jump
22 --F => --flush
23 --P => --policy
24 -
25 ---dport => --destination-ports}}}
26 -
27 -{{info}}
28 -Weitere Informationen zur Verwendung von iptables finden Sie hier:
29 -
30 -* [[https:~~/~~/linux.die.net/man/8/iptables>>url:https://linux.die.net/man/8/iptables]]
31 -* [[https:~~/~~/wiki.ubuntuusers.de/iptables/>>url:https://wiki.ubuntuusers.de/iptables/]]
32 -{{/info}}
33 -
20 +(((
34 34  == Standard verwerfen ==
35 35  
36 36  **Entfernt alle bestehenden Regeln:**
37 37  
38 -{{{iptables -F}}}
25 +{{{iptables --flush}}}
39 39  
40 40  **Block sämtliche eingehenden Pakete die nicht explizit erlaubt sind:**
41 41  
42 -{{{iptables -P INPUT DROP}}}
29 +{{{iptables --policy INPUT DROP}}}
43 43  
44 44  **Erlaubt das Aufrechterhalten von Aufgebauten Verbindungen (RDP, ICA, VMwareView...):**
45 45  
46 -{{{iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT}}}
33 +{{{iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT}}}
47 47  
48 48  == Port / Protokoll / Netzwerk erlauben ==
49 49  
50 50  **Erlaubt Kontakt zur Kommbox per Browser / TCMS auf Port 443 TCP von dem 24er Subnetz 192.168.255.0/24:**
51 51  
52 -{{{iptables -A INPUT -p tcp --dport 443 -s 192.168.255.0/24 -j ACCEPT}}}
39 +{{{iptables --append INPUT --protocol tcp --destination-port 443 --source 192.168.255.0/24 --jump ACCEPT}}}
53 53  
54 54  **Erlaubt SSH zum Client auf Port 22 TCP von einzelner IP 192.168.255.56/32:**
55 55  
56 -{{{iptables -A INPUT -p tcp --dport 22 -s 192.168.255.56/32 -j ACCEPT}}}
43 +{{{iptables --append INPUT --protocol tcp --destination-port 22 --source 192.168.255.56/32 --jump ACCEPT}}}
57 57  
58 58  **Erlaubt VNC zum Client auf Port 5900 TCP vom 16er Subnetz 192.168.0.0/16:**
59 59  
60 -{{{iptables -A INPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j ACCEPT}}}
47 +{{{iptables --append INPUT --protocol tcp --destination-port 5900 --source 192.168.0.0/16 --jump ACCEPT}}}
61 61  
62 62  **Für WebVNC aus Kommbox oder TCMS zusätzlich Port 80 TCP vom 16er Subnetz 192.168.0.0/16:**
63 63  
64 -{{{iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/16 -j ACCEPT}}}
51 +{{{iptables --append INPUT --protocol tcp --destination-port 80 --source 192.168.0.0/16 --jump ACCEPT}}}
65 65  
66 66  **Erlaubt ICMP (Ping) von überall**
67 67  
68 -{{{iptables -A INPUT -p icmp -j ACCEPT}}}
55 +{{{iptables --append INPUT --protocol icmp --jump ACCEPT}}}
69 69  
70 70  = Skript anlegen =
71 71  
... ... @@ -82,19 +82,20 @@
82 82  Vergeben Sie die von Ihnen benötigen Regeln (eine je Zeile) in das Feld **Skript **ein. Ein Skript mit allen Regeln aus den Beispielen diese Seite sieht so aus:
83 83  
84 84  {{{#Zeilen welche mit '#' beginnen werden nicht ausgewertet und können als Kommentare verwendet werden
85 -iptables -P INPUT DROP
86 -iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
87 -iptables -A INPUT -p tcp --dport 443 -s 192.168.255.0/24 -j ACCEPT
72 +iptables --flush
73 +iptables --policy INPUT DROP
74 +iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT
75 +iptables --append INPUT --protocol tcp --destination-port 443 --source 192.168.255.0/24 --jump ACCEPT
88 88  
89 89  # Erlaube SSH Admin PC
90 -iptables -A INPUT -p tcp --dport 22 -s 192.168.255.56/32 -j ACCEPT
78 +iptables --append INPUT --protocol tcp --destination-port 22 --source 192.168.255.56/32 --jump ACCEPT
91 91  
92 92  # Erlaube VNC
93 -iptables -A INPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j ACCEPT
94 -iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/16 -j ACCEPT
81 +iptables --append INPUT --protocol tcp --destination-port 5900 --source 192.168.0.0/16 --jump ACCEPT
82 +iptables --append INPUT --protocol tcp --destination-port 80 --source 192.168.0.0/16 --jump ACCEPT
95 95  
96 96  # Erlaube PING
97 -iptables -A INPUT -p icmp -j ACCEPT}}}
85 +iptables --append INPUT --protocol icmp --jump ACCEPT}}}
98 98  
99 99  Zusätzlich zum Skript sollten (* = müssen) folgende Optionen in der Verbindung definiert werden:
100 100  
... ... @@ -101,9 +101,4 @@
101 101  |(% style="width:160px" %)Verbindungsname *|(% style="width:1346px" %)Frei wählbarer Anzeigename der Verbindung
102 102  |(% style="width:160px" %)Als root ausführen *|(% style="width:1346px" %)an - Führt das Skript mit den benötigten rechten aus
103 103  |(% style="width:160px" %)Automatischer Start|(% style="width:1346px" %)an - Sorgt dafür, dass die Firewall beim Start des geräts aktiviert wird
104 -|(% style="width:160px" %)Desktop-Verknüpfung erstellen|(% style="width:1346px" %)aus
105 -|(% style="width:160px" %)Verknüpfung im Startmenü erstellen|(% style="width:1346px" %)aus
106 -
107 -[[image:RangeeOS-Firewall.png||height="446" width="600"]]
108 -
109 -Das fertige Skript wird nun bei jedem Systemstart ausgeführt und wendet die definierten Regeln an. Das Skript kann beliebig per TCMS Konfiguration auf andere Geräte verteilt werden.
92 +|(% style="width:160px" %)Desktop-Verknüpfung erstellen