deploy/lib/preflight.sh prüft Python, venv, Platz, Betriebssystem, Umgebung (VM/Container), pypi und optional Checkmk/Ollama per TCP. first-run.sh und setup-lxc.sh rufen ihn auf (--skip-preflight, --preflight-only). LXC-Teile nur bei erkanntem Container; Texte neutral; README um VM-Abschnitt ergänzt. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
60 lines
1.9 KiB
Plaintext
60 lines
1.9 KiB
Plaintext
#!/usr/sbin/nft -f
|
|
# Optionale Host-Firewall für den checkbot-Rechner (VM oder LXC). Anpassen, dann nach /etc/nftables.conf kopieren
|
|
# und mit "nft -c -f /etc/nftables.conf" prüfen, bevor "systemctl enable --now nftables" läuft.
|
|
# In unprivilegierten LXCs (nicht in einer VM) ist nftables oft nicht ladbar; dann dieselben Regeln in der
|
|
# Proxmox-Firewall abbilden (siehe deploy/README.md).
|
|
# Achtung: Wer sich per SSH aussperrt, kommt nur über die Konsole der VM bzw. "pct enter <id>" auf dem Proxmox-Host wieder hinein.
|
|
|
|
define ADMIN_NET = 192.168.1.0/24
|
|
define UI_NET = 192.168.1.0/24
|
|
define MONITOR_IP = 192.168.1.10
|
|
|
|
table inet checkbot
|
|
delete table inet checkbot
|
|
|
|
table inet checkbot {
|
|
chain input {
|
|
type filter hook input priority filter; policy drop;
|
|
|
|
iifname "lo" accept
|
|
ct state established,related accept
|
|
ct state invalid drop
|
|
|
|
ip protocol icmp accept
|
|
ip6 nexthdr icmpv6 accept
|
|
|
|
ip saddr $ADMIN_NET tcp dport 22 accept
|
|
ip saddr $UI_NET tcp dport { 80, 443 } accept
|
|
# Checkmk-Agent (TCP) und /health vom Monitoring-Server; entfällt bei Agent über SSH
|
|
ip saddr $MONITOR_IP tcp dport { 443, 6556 } accept
|
|
}
|
|
|
|
chain output {
|
|
type filter hook output priority filter; policy drop;
|
|
|
|
oifname "lo" accept
|
|
ct state established,related accept
|
|
|
|
ip protocol icmp accept
|
|
ip6 nexthdr icmpv6 accept
|
|
|
|
# DNS und NTP (bei fester Resolver-/NTP-IP auf diese Adressen einschränken)
|
|
udp dport { 53, 123 } accept
|
|
tcp dport 53 accept
|
|
|
|
# Telegram, Matrix, Checkmk-API, Ollama hinter Proxy, apt (HTTPS)
|
|
tcp dport 443 accept
|
|
# apt über http, falls das Debian-Mirror-Setup es nutzt
|
|
tcp dport 80 accept
|
|
# Ollama direkt
|
|
tcp dport 11434 accept
|
|
|
|
# Weitere Ziele hier ergänzen, z.B. Checkmk auf Port 80/5000 oder ein Matrix-Homeserver auf 8448:
|
|
# ip daddr 192.168.1.20 tcp dport 8448 accept
|
|
}
|
|
|
|
chain forward {
|
|
type filter hook forward priority filter; policy drop;
|
|
}
|
|
}
|