k.rennerandClaude Opus 4.8 3eeb2aadca mosquitto: add DoS/resource guards (security review, broker hardening)
The broker had no resource limits at all. It's now load-bearing and reachable
by ~30 untrusted IoT devices (the Shelly fleet) + the edge host on a single
256Mi replica, so a misbehaving/compromised client is a real DoS vector.

Add:
- message_size_limit 1048576 — MQTT permits up to 256 MB per publish; one such
  message would OOM the broker. Every legit payload here (HA discovery,
  Shelly/open3e/evcc telemetry) is <10 KB.
- persistent_client_expiration 1d — reap abandoned persistent sessions (the
  edge bridges reconnect within seconds, so they never hit this).
- max_connections 200 per listener — bound a connection flood (~40 clients
  today; generous headroom, not the previous unlimited).

All values chosen well above real usage, so no legit client is affected.

Apply: the ConfigMap has no checksum annotation, so Flux won't restart the pod
on its own — needs `kubectl -n home-assistant rollout restart deploy/mosquitto`
(brief reconnect; clients auto-reconnect) after reconcile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 10:10:52 +02:00
S
Description
No description provided
39 MiB
master
Latest
2026-01-31 15:05:31 +00:00
Languages
Go 35.7%
Shell 24.3%
Python 22.4%
Jinja 5.1%
HCL 4.8%
Other 7.6%