infrastructure(garage): config in git, WG-only proven, per-consumer keys, egress policy, backup, metrics #16

Merged
sirius merged 2 commits from feat/t_2f8ec199-garage-hardening into master 2026-11-19 21:35:26 +00:00
Owner

Closes the gaps in card t_2f8ec199: Garage was the only piece of the platform in no git repository, and it was reachable from more than WireGuard.

1. Config in git — infrastructure/garage/

docker-compose.yml, garage.toml, README.md, host/ (firewall), backup/ (script + units). Flux does not apply this — said explicitly in the README. Live config was reconciled onto it (container recreated from this compose file; same node ID d053db4dfc97bf78, same buckets). Diff against the old /home/sirius/websites/garage/garage.toml:

old new why
127.0.0.1:3900-3902 + 10.10.0.1:3900 publishes 10.10.0.1:3900, 10.10.0.1:3903, 127.0.0.1:3900 every publish is an explicit address; 3901/3902 no longer published at all
[s3_web] bind_addr = 0.0.0.0:3902 removed static website mode had no consumer (a pod's 127.0.0.1 is its own netns); it was what pushed photos into the image
rpc_secret literal in the file GARAGE_RPC_SECRET from /etc/garage/garage.env (0600, out of git) the committed config carries no credential
no admin listener [admin] api_bind_addr = 0.0.0.0:3903, published on 10.10.0.1 only Garage was invisible to Prometheus

2. WG-only, by construction

host/garage-firewall.nft drops 3900-3903 at PREROUTING priority -140 — before Docker's DNAT (-100). ufw cannot do that job: Docker's publish path never traverses ufw's INPUT chain.

Proof in the card comment, including the deliberate negative test: a container published on 0.0.0.0:3902 was unreachable from the LAN and the drop counter incremented.

3. Egress policy

apps/base/siriusdevops/networkpolicy-site-egress.yaml — the first policy in the namespace. It is a CiliumNetworkPolicy, because 10.10.0.1 is a cluster node (reserved:remote-node in Cilium's ipcache), so a standard ipBlock: 10.10.0.1/32 rule is silently inert — measured, not assumed.

4. Metrics

monitoring/controllers/home/garage.yaml — Service + EndpointSlice + ServiceMonitor for 10.10.0.1:3903, five alerts (down, unhealthy, >80% disk, metadata GC backlog, errored blocks). Target is UP.

Out of scope / still open

  • Forgejo and the Postgres PVCs are backed up by nothing. Garage's backup is the first backup job on this platform, not an addition to an existing one. Separate card.
  • piedmont-photos has no consumer after ci-key was deleted; mint a scoped key if something needs it.
  • Data is replication_factor = 1 on one node. Still no redundancy — only backup.
Closes the gaps in card `t_2f8ec199`: Garage was the only piece of the platform in no git repository, and it was reachable from more than WireGuard. ## 1. Config in git — `infrastructure/garage/` `docker-compose.yml`, `garage.toml`, `README.md`, `host/` (firewall), `backup/` (script + units). Flux does **not** apply this — said explicitly in the README. Live config was reconciled onto it (container recreated from this compose file; same node ID `d053db4dfc97bf78`, same buckets). Diff against the old `/home/sirius/websites/garage/garage.toml`: | old | new | why | |---|---|---| | `127.0.0.1:3900-3902` + `10.10.0.1:3900` publishes | `10.10.0.1:3900`, `10.10.0.1:3903`, `127.0.0.1:3900` | every publish is an explicit address; 3901/3902 no longer published at all | | `[s3_web] bind_addr = 0.0.0.0:3902` | removed | static website mode had no consumer (a pod's `127.0.0.1` is its own netns); it was what pushed photos into the image | | `rpc_secret` literal in the file | `GARAGE_RPC_SECRET` from `/etc/garage/garage.env` (0600, out of git) | the committed config carries no credential | | no admin listener | `[admin] api_bind_addr = 0.0.0.0:3903`, published on `10.10.0.1` only | Garage was invisible to Prometheus | ## 2. WG-only, by construction `host/garage-firewall.nft` drops 3900-3903 at PREROUTING priority -140 — *before* Docker's DNAT (-100). ufw cannot do that job: Docker's publish path never traverses ufw's INPUT chain. Proof in the card comment, including the deliberate negative test: a container published on `0.0.0.0:3902` was unreachable from the LAN and the drop counter incremented. ## 3. Egress policy `apps/base/siriusdevops/networkpolicy-site-egress.yaml` — the first policy in the namespace. It is a **CiliumNetworkPolicy**, because `10.10.0.1` is a cluster node (`reserved:remote-node` in Cilium's ipcache), so a standard `ipBlock: 10.10.0.1/32` rule is silently inert — measured, not assumed. ## 4. Metrics `monitoring/controllers/home/garage.yaml` — Service + EndpointSlice + ServiceMonitor for `10.10.0.1:3903`, five alerts (down, unhealthy, >80% disk, metadata GC backlog, errored blocks). Target is UP. ## Out of scope / still open - Forgejo and the Postgres PVCs are backed up by **nothing**. Garage's backup is the first backup job on this platform, not an addition to an existing one. Separate card. - `piedmont-photos` has no consumer after `ci-key` was deleted; mint a scoped key if something needs it. - Data is `replication_factor = 1` on one node. Still no redundancy — only backup.
Garage was the only piece of the platform in no git repository and reachable
from more than WireGuard. This is a hardening/ownership pass, not a migration —
the container stays on the Pi.

- infrastructure/garage/: docker-compose.yml (pinned dxflrs/garage:v1.1.0,
  every publish on an explicit 10.10.0.1 / 127.0.0.1 address, no 0.0.0.0),
  garage.toml (rpc_secret moved to /etc/garage/garage.env, [s3_web]/3902
  removed, admin API on 3903 for metrics), README (apply, state, restore,
  keys, backup, metrics) and an explicit note that Flux does not apply it.
- host/garage-firewall.nft: PREROUTING priority -140 drop of 3900-3903 from
  anything but lo/wg0/wg-remote. Docker's DNAT bypasses ufw's INPUT chain, so
  ufw alone cannot stop a compose typo from publishing S3 on the LAN.
  Measured: a 0.0.0.0:3902 publish stayed unreachable from the LAN and the
  drop counter incremented.
- backup/: garage-backup.sh meta|data + systemd timers (meta hourly, data
  nightly) rsyncing to [email protected]:/root/garage-backup over wg-remote.
  Nothing else backs up Forgejo or the PG PVCs; that stays uncovered.
- monitoring/controllers/home/garage.yaml: Service + EndpointSlice +
  ServiceMonitor for 10.10.0.1:3903 and five alerts. Target is UP.
- apps/base/siriusdevops/networkpolicy-site-egress.yaml: first policy in the
  namespace. CiliumNetworkPolicy, not a k8s NetworkPolicy: 10.10.0.1 is a
  cluster node (reserved:remote-node), so ipBlock 10.10.0.1/32 is inert.
  Egress whitelist = TCP 3900 to a node + cluster DNS; measured 403 on 3900,
  timeouts on 3900-adjacent 5000/3903, on 10.10.0.2:8080 and on the internet.

Keys: ci-push (W only, siriusdevops-media) and site-fetch (R only, same
bucket) replace the shared ci-key, which is deleted. The k8s Secret and the
two Forgejo repo secrets were repointed. No key material is in this commit.
sirius merged commit 22554a792a into master 2026-11-19 21:35:26 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/homek8s!16
No description provided.