ProDG Mainframe — Consolidated Improvement Master Plan
Created: 2026-10-25 Source: the 8 runs of the Mainframe improvement scout cron job (job 7a7d2457c5fc) Owner: sudo (Mitch) Status: proposed — not yet executed
Why this exists
The scout deduplicates only against the single previous run (context_from: self, most-recent-only injection), so recommendations from runs #1–#6 were never reconciled against each other. This document summarises all 8 runs, de-duplicates them into cross-cutting themes, and sequences them into a plan ordered by real exposure to loss — not by the order they were discovered.
Source inventory (8 runs)
| Run | Date | Focus | Headline recommendation |
|---|---|---|---|
| #1 | 2026-10-04 | Security (OpenBao/Wazuh/LiteLLM) | OpenBao 2.6 EOL → 2.7.x; Wazuh upgrade; pin LiteLLM by digest |
| #2 | 2026-10-07 | Backup/DR | B2 SSE default; Talos etcd snapshots; dump-to-stdin; B2 lifecycle |
| #3 | 2026-10-10 | Talos/K8s | sandboxd workload isolation; Talos 1.14.1; registry config format |
| #4 | 2026-10-13 | Cost/efficiency | Compose resource limits; Redis encodings; PG autovacuum; MinIO baseline |
| #5 | 2026-10-16 | Observability/tools | Alerting blind spots; scrape unmonitored components; Loki ruler; smartctl_exporter + Gatus; Caddy forward_auth gap |
| #6 | 2026-10-19 | K8s/Talos ops | Talos 1.14.2→1.14.4; zero etcd backups; tombstone cleanup + 2nd etcd member; Pod Security |
| #7 | 2026-10-22 | LiteLLM | Budget alerting; daily cap; scrape to Grafana; bump 1.104.5 |
| #8 | 2026-10-25 | Backup/DR | DR docs are AWS templates; OpenBao single-copy; no PITR; never restored; etcd unprotected |
Verification performed (2026-10-25, live box)
Confirmed by direct inspection, not taken on the scout's word:
- ✅ Backup orchestrator exists (
/opt/prodg/backups/scripts/backup-all.sh→ postgres + minio + configs), last run green, B2 holds dailypg_dumpall_*.sql.gz(~1.9 MB) through 2026-10-25. - ✅ No pgBackRest anywhere (host or
postgrescontainer) and logical dumps only → no PITR. Backups are nightly, RPO = 24 h. - ✅ Zero etcd snapshots anywhere on the estate (
findfor*etcd*returns nothing). - ✅ Prometheus
rule_files: []— no file-based alert rules (Grafana-managed rules exist separately). - ✅
docs/security/Disaster_Recovery_Plan.mdis the untouched Hack23 AB AWS template (owner "CEO James Pether Sörling", next review 2026-07-25 — overdue). - ✅ Backup trigger is the Hermes cron job
prodg-backup-daily; there is no systemd timer for it → backups stop silently if Hermes is down. - ✅
rcloneremoteprodg-b2:exists and is the only offsite target. - ✅ OpenBao raft store and
.unseal-sharesare co-located at/opt/prodg/data/openbao/. - 🆕 New finding (not in any scout run): MinIO's 3 buckets (
prodg-artifacts,prodg-backups,prodg-logs) are all empty and have been since 2026-04-27. The nightly MinIO "backup" is vacuous by design (it warns "this backup protects nothing"). MinIO is running and consuming resources for zero live data.
Cross-cutting themes (de-duplicated)
- Backups exist but recovery is unproven and coverage is partial. Runs #2, #6, #8 all circle this. Offsite pipeline is real; what's missing is (a) anything ever restored, (b) PITR, (c) etcd, (d) OpenBao secrets.
- Single-copy trust anchors. OpenBao secrets, Talos etcd, and the DR documentation are each single points of failure.
- Monitoring is half-wired. Grafana alerting works; Prometheus has no rules; the components whose failure means data loss (Postgres/Redis/MinIO/OpenBao) aren't scraped at all; Loki's ruler points at a non-existent Alertmanager.
- Version currency / patching. OpenBao (EOL branch), Talos 1.14.2, LiteLLM 1.104.0, Wazuh — all have safe minor bumps available with security content.
- Least-privilege gaps. B2 app key can delete its own backups; LiteLLM master key used off-UI;
forward_authmissing for ~10 basic_auth services; no Pod Security admission. - Efficiency hygiene. No compose resource limits, untuned Redis/Postgres, and an apparently unused MinIO.
The plan (phased, ordered by exposure)
Effort estimates are the scout's, sanity-checked. src = originating run(s).
Phase 0 — Stop the bleeding (this week)
| # | Action | Effort | Why it matters | src |
|---|---|---|---|---|
| 0.1 | Run a restore drill end-to-end — pull a pg_dumpall from B2 into a throwaway Postgres, note timing, write /opt/prodg/backups/restore-runbook.md + drill log | ~1 h | Nothing has ever been restored; backups are unproven until one is. Highest-value single item. | #8.4 |
| 0.2 | Snapshot OpenBao off-host — bao operator raft snapshot save + .unseal-shares shipped to B2 (separate path), added to the orchestrator | ~1 h | Raft store + unseal shares live on one host; losing it loses every secret. No autosnapshot upstream (openbao#795). | #8.2 |
| 0.3 | Back up Talos etcd — systemd timer: talosctl etcd snapshot → rclone copy to B2 (age-encrypt, reuse the support-prodg-trackc.zip.age key), daily + pre-upgrade, 30-day retention | med | Zero etcd snapshots in the estate; single-member control plane. | #6.2, #8.5, #2.2 |
| 0.4 | Move the backup trigger off Hermes — systemd timer running backup-all.sh; retire the prodg-backup-daily cron job | ~30 min | Today backups stop silently whenever Hermes is down. | #8.4 |
| 0.5 | Lock down the backup target — B2 Object Lock (governance, 30–90 d) + swap to a write-only app key | ~1 h | Current key can delete its own backups → ransomware/operator error wipes the only copy. | #8.4, #2.4 |
Phase 1 — Close coverage & compliance (next 2 weeks)
| # | Action | Effort | Why it matters | src |
|---|---|---|---|---|
| 1.1 | Rewrite DR/BCP/Backup docs to describe the actual estate: per-service RTO/RPO + the real B2 restore runbook; replace the Hack23 AWS templates | ~3 h | An AWS-doc DR plan in a bank/defence-grade ISMS is worse than blank — it's an untruth. Review is already overdue. | #8.1 |
| 1.2 | PITR via pgBackRest 2.5x → B2 S3 endpoint — cipher_type=aes-256-cbc, WAL archive-push on a 60 s loop | med-high (~4 h) | Takes RPO from 24 h to minutes + restore-to-timestamp. | #8.3 |
| 1.3 | B2 lifecycle + encryption defaults — lifecycle rules on the backup bucket; SSE for any new bucket | low | Auto-expiry meets retention, default-encrypts new streams. | #2.1, #2.4 |
| 1.4 | File-based Prometheus alert rules — restart-loop, OpenBao sealed (bao_core_unsealed == 0), TLS cert expiry, backup-freshness (textfile stamp from the backup script); confirm the Grafana contact point actually pages the right chat | low | rule_files: [] today; a sealed OpenBao or a stalled backup currently pages no one. | #5.1, #7.3 |
| 1.5 | Scrape the data-bearing components — Postgres, Redis, MinIO, OpenBao exporters into prometheus.yml; enable LiteLLM /metrics callback | low-med | Only 9 of 47 containers are scraped; these four failing silently = data loss, not a missing graph. | #5.2, #7.3 |
Phase 2 — Harden trust anchors (next month)
| # | Action | Effort | Why it matters | src |
|---|---|---|---|---|
| 2.1 | OpenBao 2.6 → 2.7.x | low | 2.6 is EOL; 2.7 is the only branch getting security patches. | #1.1 |
| 2.2 | Wazuh → current 4.14.x | low | Recent cluster-sync / keystore hardening; confirm API+indexer are tailnet-only. | #1.2 |
| 2.3 | LiteLLM hygiene — pin image by digest, audit proxy_admin holders, retire the master key from off-UI callers, add $5/1d cap, alerting → Mattermost, bump to 1.104.5 | low-med | Trust anchor for AI credentials; today a runaway key can burn the month's budget silently. | #1.3, #7.1, #7.2, #7.4 |
| 2.4 | Pod Security admission — Talos cluster.apiServer.admissionControl: enforce baseline, audit/warn restricted; exempt tailscale/kube-system | low | No namespace enforces Pod Security today. | #6.4 |
| 2.5 | Talos 1.14.2 → 1.14.4 — snapshot etcd first (single CP), expect a short API blip | low (~10 min) | Carries the DHCP-address-change fix (the .56/.57 churn) + KubePrism recovery fix. | #6.1 |
| 2.6 | Talos sandboxd workload isolation — after CSI migration check | med | Real security boundary around kubelet/pods. | #3.1 |
| 2.7 | Caddy forward_auth for basic_auth services — oauth2-proxy or caddy-security front of Zitadel | med | Zitadel has no native ForwardAuth (#6912); ~10 services sit on basic_auth. | #5 auth |
| 2.8 | Fix Loki ruler / add Alertmanager — no Alertmanager exists at prometheus:9093 | low | Log-based alerts currently go nowhere. | #5.3 |
Phase 3 — Efficiency & hygiene (backlog)
| # | Action | Effort | Why it matters | src |
|---|---|---|---|---|
| 3.1 | Compose resource limits (CPU/mem) after docker stats baseline | low | One service starving others during a load spike. | #4.1 |
| 3.2 | Redis tuning — compact encodings + activedefrag | med | 30–50% memory savings on cache/session data. | #4.2 |
| 3.3 | Postgres autovacuum tuning — lower scale factors for Twenty CRM's churn | low | Prevents bloat-driven query slowdown as data grows. | #4.3 |
| 3.4 | Drive-health coverage — smartctl_exporter (S.M.A.R.T. for the KVM host disks) | med | Zero drive-health visibility today. | #5.4 |
| 3.5 | Add Gatus — YAML outside-in probes incl. [CERTIFICATE_EXPIRATION] | med | Checks Prometheus structurally can't do. | #5.4 |
| 3.6 | Talos etcd redundancy — boot convert-test as a real second etcd member; clear stale Node/pod tombstones | low-med | One-member etcd is the actual cluster SPOF. | #6.3 |
| 3.7 | Registry config format migration — .machine.registries → RegistryMirrorConfig | low | Future-proofs the 192.168.100.1:5000 mirror. | #3.4 |
| 3.8 | Decide on MinIO — all 3 buckets empty since Apr; either put real data in it or decommission to reclaim resources | low | 🆕 New: it's running for zero live data; its "backup" protects nothing. | verification |
Deliberately deferred / rejected
- Tag-based LiteLLM budgets — silently skipped upstream (#27480). Don't enforce on tags.
- Authentik / Pocket ID — redundant; Zitadel already runs the self-hosted login.
- Talos native BGP (run #3.3) — no current routing scenario needs it; keep as a note only.
- Minor jump to LiteLLM 1.106.x — not worth it for a billing fix; 1.104.5 is enough.
Open questions for sudo
- B2 Object Lock is irreversible-ish (governance mode conflicts with the current
rclone deleteretention logic). Phase 0.5 and 1.3 must be reconciled — replace age-basedrclone deletewith lifecycle+Object Lock, or Object Lock will make the bucket un-prunable. - Target RTO per service? The doc rewrite (1.1) needs numbers only you can set.
- Keep MinIO or retire it? Affects whether its backup stays in the orchestrator.
Suggested execution order
0.4 → 0.5 → 0.1 → 0.2 → 0.3 (make backups tamper-proof and provable first), then Phase 1, then 2, then 3 as capacity allows. Phase 0.4/0.5 are prerequisites for a trustworthy Phase 1.