From 1ce4b55b7505948ecd5080590f777c9f476008cb Mon Sep 17 00:00:00 2001 From: Thore Cimbal Date: Fri, 21 Aug 2026 12:00:00 +0000 Subject: [PATCH] monitoring: the hardening lived on the host and not in here MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prometheus and Loki accept writes without authentication and were bound to 0.0.0.0; node-exporter likewise. That was fixed on CFGMON during the firewall work today and never came back to the repository, so this file still described three open ports and a firewall as the only thing in front of them. The consequence is worse than a stale comment. A pull would have reverted the binding and reopened all three, and nothing here or there would have said so. It did not happen only because git refused the pull over the local edit — the accident that saved it is not a control. Ports now match what actually runs: the private vSwitch address for the hosts that push, localhost for the host itself, and node-exporter on localhost alone. --- monitoring/README.md | 15 ++++++++++++--- monitoring/docker-compose.yml | 23 ++++++++++++++++------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/monitoring/README.md b/monitoring/README.md index 76272b4..e30afb7 100644 --- a/monitoring/README.md +++ b/monitoring/README.md @@ -214,9 +214,18 @@ selbst nicht melden koennen. ## Offene Punkte / Sicherheit -- `9090`, `3100`, `9100` sind auf der oeffentlichen IP ohne Auth erreichbar - (Docker umgeht ufw). Per **Hetzner Cloud Firewall** auf die IPs der - bekannten Absender einschraenken. +- `9090`, `3100`, `9100`: **erledigt am 2026-08-21.** Sie standen auf `0.0.0.0` + und waren damit auf der oeffentlichen IP ohne Auth erreichbar (Docker umgeht + ufw). Jetzt an Adressen gebunden -- `10.0.0.3` fuer die pushenden Absender + ueber den vSwitch, `127.0.0.1` fuer den Host selbst; node-exporter nur + localhost. Die Hetzner-Firewall bleibt die zweite Schicht, ist aber nicht + mehr die einzige. + + ⚠️ **Das war auf dem Host repariert und im Repo nicht.** Vier Monate spaeter + haette ein `git pull` die Ports wieder geoeffnet, ohne dass jemand es + bemerkt haette -- verhindert nur dadurch, dass git den Pull wegen der + lokalen Aenderung abgelehnt hat. Eine Haertung, die nur auf dem Host steht, + ist keine Haertung, sondern eine Wette auf das naechste Deployment. - Game-Host: **erledigt**. Host-Seite am 2026-08-20 deployt und verifiziert, die Ports liegen auf `10.0.0.4` (nicht `0.0.0.0` -- das umginge ufw). Der lokale Prometheus/Grafana/Loki-Stack des Game-Hosts ist zurueckgebaut; er liefert nur diff --git a/monitoring/docker-compose.yml b/monitoring/docker-compose.yml index 2d24f7e..59fc8bd 100644 --- a/monitoring/docker-compose.yml +++ b/monitoring/docker-compose.yml @@ -17,11 +17,16 @@ services: - '--storage.tsdb.retention.time=45d' - '--storage.tsdb.retention.size=15GB' # Remote-Write-Receiver: k3s-Cluster und Matrix-Server pushen hierher. - # ACHTUNG: Port 9090 ist oeffentlich und ohne Auth erreichbar -- - # per Hetzner Cloud Firewall auf die Absender-IPs einschraenken! + # ⚠️ Prometheus hat KEINE Authentisierung. Bis 2026-08-21 stand hier + # "9090:9090", also 0.0.0.0 - oeffentlich erreichbar, abgesichert allein + # durch die Hetzner-Firewall. Seither an Adressen gebunden: der private + # vSwitch fuer die pushenden Absender, localhost fuer den Host selbst. + # Wer das zurueckdreht, macht die Zeitreihen wieder oeffentlich lesbar + # UND beschreibbar. - '--web.enable-remote-write-receiver' ports: - - "9090:9090" + - "10.0.0.3:9090:9090" + - "127.0.0.1:9090:9090" networks: - traefik @@ -158,10 +163,12 @@ services: - ./loki:/etc/loki:ro - loki_data:/loki command: -config.file=/etc/loki/loki-config.yaml - # Port 3100 oeffentlich: externe Alloys pushen Logs hierher. - # Ebenfalls per Firewall auf bekannte Absender-IPs einschraenken. + # ⚠️ Externe Alloys pushen Logs hierher; Loki hat ebenfalls keine + # Authentisierung. Bis 2026-08-21 auf 0.0.0.0 gebunden, seither wie + # Prometheus: privater vSwitch fuer die Absender, localhost fuer den Host. ports: - - "3100:3100" + - "10.0.0.3:3100:3100" + - "127.0.0.1:3100:3100" networks: - traefik @@ -228,8 +235,10 @@ services: - '--path.rootfs=/rootfs' - '--web.listen-address=:9100' - '--web.disable-exporter-metrics' + # Nur localhost: gescrapt wird aus demselben Host heraus, von aussen hat + # hier niemand etwas zu suchen. Bis 2026-08-21 stand auch das auf 0.0.0.0. ports: - - "9100:9100" + - "127.0.0.1:9100:9100" networks: - traefik