pve-cluster: Verwaltungsports nur aus IPSET admin (Proxmox ergänzt management stets um das /24); Skript nutzt python auf dem Laptop
ci / test (push) Successful in 25s

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Robert Rapp
2026-10-13 17:08:42 +02:00
co-authored by Claude Fable 5.1
parent 87b678e7a8
commit 47ad1580ff
4 changed files with 14 additions and 6 deletions
@@ -1,4 +1,8 @@
# Verwaltet von Ansible (Rolle pve-cluster, Vorlage cluster.fw.j2). Änderungen im Repo, nicht hier.
#
# Proxmox fügt dem eingebauten IPSET "management" immer das lokale Netz (/24) hinzu. Eine Einschränkung
# auf einzelne Adressen geht deshalb nur über eigene Regeln: erst ACCEPT für +admin, dann DROP für das
# restliche LAN auf den Verwaltungsports. Die Standardregeln dahinter werden für das LAN nie erreicht.
[OPTIONS]
enable: {{ 1 if knaster_pve.firewall.enable else 0 }}
@@ -6,7 +10,7 @@ policy_in: DROP
policy_out: ACCEPT
log_ratelimit: enable=1,rate=10/second,burst=5
[IPSET management] # Zugang zu 8006, 22, 5900-5999, 3128, 60000-60050 (Proxmox-Standardregeln)
[IPSET admin] # Nur diese Quellen erreichen 22, 8006, 3128, 5900-5999 und 60000-60050 der Knoten
{% for host in groups['pve_all'] | sort %}
{{ hostvars[host].ansible_host }} # Knoten {{ host }}
@@ -17,4 +21,6 @@ log_ratelimit: enable=1,rate=10/second,burst=5
[RULES]
IN ACCEPT -source +admin -p tcp -dport {{ pve_mgmt_ports }} -log nolog # Verwaltung nur aus +admin
IN DROP -source {{ knaster_pve.firewall.ping_from }} -p tcp -dport {{ pve_mgmt_ports }} -log nolog # restliches LAN
IN ACCEPT -source {{ knaster_pve.firewall.ping_from }} -p icmp -log nolog # Ping aus dem LAN