Commit graph

234 commits

Author SHA1 Message Date
ce13f756f9 Merge pull request 'docs(registry): rotate/add registry pull secrets through SOPS' (#47) from docs/registry-sops into master 2026-11-27 05:23:05 +00:00
1647f35ce0 docs(registry): rotate/add-namespace via the SOPS files, not kubectl
PR #45 landed the forgejo-pull Secrets as SOPS ciphertext in git while this doc
still described them as out-of-band. A kubectl apply of a new Secret is now
reverted by the next apps reconcile, so the rotation and add-a-namespace
recipes go through the encrypted file. Also records that the registry-reader
token is non-expiring and that a rotated value is picked up on the next pull.
2026-11-27 00:22:56 -05:00
5646572eaf Merge pull request 'controlplane: enable kube-apiserver audit logging (audit F1)' (#46) from controlplane/apiserver-audit into master 2026-11-27 05:20:37 +00:00
Lance Walters
f9d2594fe9 controlplane: enable kube-apiserver audit logging (audit F1)
The apiserver ran with no --audit-* flags at all: secret reads, pods/exec,
RBAC writes and serviceaccounts/token minting left no record anywhere.

- /etc/kubernetes/audit/audit-policy.yaml: RequestResponse for secrets
  get/write, pods/exec|attach|portforward, serviceaccounts/token, rbac.*,
  certificates.*, impersonate; Metadata for list/watch/update of secrets and
  for everything else (that split is what keeps 22.8 GB/day down to 2.5).
- static-pod flags: --audit-policy-file, --audit-log-path (JSON, 100 MiB x 48,
  maxage 7, compressed) + hostPath mounts for the policy dir and the log dir.
- install-audit.sh: idempotent, byte-identical re-application after a
  kubeadm upgrade silently regenerates the manifest (Flux does not own it).
- docs/kube-apiserver-audit-logging.md: design, measured volume, sensitivity
  (the log holds secret bodies), verify commands and rollback.
2026-11-27 00:20:29 -05:00
566834b5fb Merge pull request 'secrets: bring 29 hand-made cluster Secrets under Git via SOPS/age (audit F12)' (#45) from secrets/sops into master 2026-11-27 05:18:28 +00:00
c8f0834886 secrets: bring 29 hand-made cluster Secrets under Git via SOPS/age (audit F12)
Nothing in the cluster was reconciled from the repo: 67 hand-made Secrets and no
managed Secret at all, so a restore of this Git tree produced a cluster that would
not start. This commits the first-party ones as SOPS/age ciphertext and enables
Flux's sops decryptor.

* provider: SOPS + age (chosen over SealedSecrets: Flux already ships the sops
  decryptor, so no extra controller/CRD, and the age key is escrowed off-cluster).
* 29 Secrets across forgejo, siriusdevops, piedmont, sirius-growth, osint,
  metabase and customer1, as apps/base/<ns>/secret-<name>.sops.yaml with
  encrypted_regex ^(data|stringData)$ — names/namespaces stay reviewable.
* each file was generated from the LIVE object and decrypts to a byte-identical
  data map and type, so the first apply is a no-op (not a rotation).
* the CNPG bootstrap secrets (forgejo-pg-app, pg-app, sirius-growth-portal-db)
  are ours, not operator output — bootstrap.initdb.secret points at them, so a
  rebuild has no application password without them.
* forgejo-pull is included despite docs/registry-pull-auth.md calling it
  out-of-band: with imagePullSecrets on every workload it is the one Secret whose
  absence stops the whole cluster from pulling images.
* .gitignore keeps **/*secret*.yaml ignored and re-includes only .sops.yaml, so a
  plaintext Secret still cannot be committed; age.agekey stays ignored.
* excluded on purpose (controller/helm-owned): CNPG *-server/*-replication/*-ca,
  cnpg-system CA+webhook, cert-manager webhook CA, cilium/hubble certs, helm
  release records, prometheus-operator rendered prompts. Full table in
  docs/secrets-sops.md.

Key locations (never in git): Secret flux-system/sops-age (age.agekey) and
/root/sops/homek8s-age.key on the Linode, reached only over the mesh.
2026-11-27 00:18:14 -05:00
43353e9aa0 Merge pull request 'networking(hubble): deepen the event ring to 16383 flows and gate detection on loss (F10)' (#44) from netsec/hubble-event-loss into master 2026-11-27 05:17:26 +00:00
Lance Walters
8f98509c8f networking(hubble): deepen the event ring to 16383 flows and gate detection on loss (F10)
hubble_lost_events_total{source="hubble_ring_buffer"} was climbing at a
constant 12/min on siriussec (72,529 cumulative) and ~4/min on linode with
nothing dropped: Ring.read() synthesises a HUBBLE_RING_BUFFER lost event when
a backwards walk reaches the ring's read boundary, and getFlowRate() walks a
full minute on every hubble status / 5 s health probe / UI request. At
siriussec's ~80 flows/s the 4095-event default only holds ~51 s, so every
probe hit the boundary (cilium#46584).

16383 holds >= 60 s at the 24 h peak on every node (linode 196 flows/s ->
83 s, siriussec 101/s -> 161 s, rpi 38/s -> 431 s), so the walk exits on the
timestamp check instead. Ring accepts 2^n-1 only.

Also wire the sensor gate: recorders hubble:lost_events_increase_30m /
hubble:flows_processed_increase_30m, alert HubbleFlowWindowIncomplete when a
30 min window has any loss (a lossy window may not be reported as clean),
HubbleFlowLossMaterial above 0.1% of processed flows, and
HubbleFlowSensorMissing when the counters disappear entirely.
2026-11-27 00:16:47 -05:00
99cc3313f2 Merge pull request 'registry(auth): require authentication for image pulls (F11)' (#43) from fix/registry-anon-pull into master 2026-11-27 05:15:38 +00:00
bc942e2571 registry(auth): require auth for image pulls (audit F11)
Forgejo 16 mints an anonymous ("ghost user") registry token on /v2/token and
grants it Read on every package regardless of repo visibility, so all 18 app
images were world-downloadable — including images of private repos
(siriusdevops-site, phs-site, sirius-growth-*, sgs-leadgen).

* FORGEJO__service__REQUIRE_SIGNIN_VIEW=true: /v2/token answers UNAUTHORIZED
  to anonymous clients, anonymous manifests get 401. This is the documented
  switch in routers/api/packages/container (Authenticate) and
  services/context/package.go (determineAccessMode). Side effect: the Forgejo
  web UI/API becomes login-only for anonymous visitors.
* imagePullSecrets: [forgejo-pull] on all 18 workloads that pull from the
  registry (osint, piedmont, sirius-growth, siriusdevops). The
  kubernetes.io/dockerconfigjson Secret is per-namespace and out of band
  (never in git); docs/registry-pull-auth.md documents why, how to recreate
  it, and the verification commands. No containerd-level credential.
2026-11-27 00:15:20 -05:00
cea26863ec monitoring(alertmanager): enable the alert sink and wire the 33 PrometheusRules (F5) (#42) 2026-11-27 05:09:49 +00:00
Lance Walters
da045ab093 monitoring(alertmanager): enable an alert sink and wire the 33 PrometheusRules (F5)
Alertmanager was disabled in values.yaml, so every PrometheusRule on the
cluster evaluated into nothing: 5 alerts were firing at audit time,
including PrometheusNotConnectedToAlertmanagers.

- alertmanager.enabled: true, 1 replica pinned to siriussec, small
  resource caps, operator mounts Secret monitoring/alertmanager-telegram
  (created out of band; never in git).
- Receiver: Telegram @Siriusdevops_alert_bot chat 7528130947. This is the
  dedicated alert bot, NOT the Hermes gateway bot, so alerts cannot loop
  back into the agent.
- Routing: default -> telegram; Watchdog and InfoInhibitor -> null
  blackhole (Watchdog fires forever by design), severity=info -> null.
  Chart-default inhibit_rules kept.
- Prometheus alerting is generated by the chart from alertmanager.enabled,
  so prometheus.spec.alerting now points at the new StatefulSet/Service.
- Retention untouched: 7d / 8GB.
2026-11-27 00:09:40 -05:00
d874d4afaf fix(networking): make the public gateway :8080 WireGuard-only (F2) (#41) 2026-11-27 05:09:33 +00:00
Lance Walters
181266d7d4 fix(networking): make the public gateway :8080 WireGuard-only
Finding F2 of the 2026-11-27 cluster netsec audit: cilium-envoy on siriussec
binds gateway-system/public on 0.0.0.0:8080, so anyone on 192.168.1.0/24 could
`curl -H 'Host: forgejo.siriusdevops.com' http://192.168.1.179:8080/` and get
Forgejo (and every public site) over plain HTTP — no Cloudflare TLS, WAF, rate
limits or bot protection, and credentials on the wire inside the LAN. Live:
200 / 14609 B before this change.

The `internal_gw` nft table that already makes 8081/8084-8087 WG-only simply
did not list 8080. Add it to all three rules (lo, mesh+pods, drop), and to the
rpi ufw guard so a future `gateway=true` relabel on the Pi cannot re-open it.

Nothing legitimate needs the LAN path: cloudflared runs on rpi and connects to
10.10.0.2:8080 from 10.10.0.1 over the mesh (`ss` on siriussec shows
`10.10.0.1:* -> 10.10.0.2:8080 ESTABLISHED`), which the 10.10.0.0/24 accept
covers. 10.244.0.0/16 stays accepted for in-cluster probes.

Verified both polarities: LAN 192.168.1.179:8080 -> timeout/DROP (from two
vantage points), mesh 10.10.0.2:8080 -> 200 for all five public hostnames, and
all five public URLs still 200 through Cloudflare.
2026-11-27 00:09:14 -05:00
ac19ffb340 Merge pull request 'apps(secops): scoped read-only auditor SA + ClusterRole (F8)' (#40) from apps/secops-auditor into master 2026-11-27 05:08:28 +00:00
Lance Walters
2e52bfad24 apps(secops): scoped read-only auditor ServiceAccount + ClusterRole (F8)
Security runs had no read-only identity: every audit ran as kubernetes-admin
(system:masters), the identity that can delete the cluster, so the auditor was
the largest privilege holder in the environment.

New ns secops with SA secops-auditor bound to a from-scratch ClusterRole:

  get,list,watch  pods services endpoints events configmaps namespaces nodes
  get,list,watch  * in apps, batch, networking.k8s.io,
                    gateway.networking.k8s.io, cilium.io
  get             pods/log

Deliberately absent: secrets (all verbs), pods/exec, pods/attach, every write
verb, impersonate/escalate/bind. Not bound to view/edit/admin (all three carry
Secrets; edit reads Secret data).

The bearer token is a credential and is generated out of band into
~/.kube/secops.yaml (mode 600) — see the SA manifest comment for the one-liner.
2026-11-27 00:08:14 -05:00
c0cf2925dc apps(netsec): hubble-flow-collector DaemonSet — filtered flow capture on siriussec (#39) 2026-11-27 05:03:11 +00:00
696edddcaf apps(customer1): anonymize client name — farrisilk → customer1 (#38) 2026-11-24 06:46:52 +00:00
Lance Walters
ae22aab330 apps(customer1): anonymize client name — farrisilk -> customer1
Rename the client-shaped lab replica namespace and its manifests to keep the
client name out of the repo going forward (git history is intentionally not
rewritten).

- apps/base/farrisilk -> apps/base/customer1 (namespace, workloads, PVCs,
  HTTPRoutes, backup CronJob, README)
- infrastructure/networking/internal/gateway-farrisilk-{odoo,metabase}.yaml ->
  gateway-customer1-{odoo,metabase}.yaml (listener ports unchanged: 8086/8087)
- firewall comment headers updated (rules/ports untouched)

No functional change beyond object names; workloads remain parked at 0.
2026-11-24 01:46:25 -05:00
Lance Walters
f9888c63f0 apps(siriusdevops): pin site to 399c421f — zero em dashes on /, /book, /lab 2026-11-24 00:20:02 -05:00
Lance Walters
f5cb4ec22a apps(siriusdevops): pin site to 04b36fed — telemetry 7 / 7 Flux Kustomizations 2026-11-24 00:09:28 -05:00
Lance Walters
955f886d36 apps(siriusdevops): pin site to 398b5353 — homepage sheet roles 2026-11-24 00:02:35 -05:00
Lance Walters
5b26ecd823 apps(siriusdevops): pin site to 0e91b466 — /lab briefs rewrite 2026-11-23 23:43:30 -05:00
Lance Walters
cc50d1c231 apps(siriusdevops): pin site to fe2d5bb — Quiet Precision token pass 2026-11-23 23:28:27 -05:00
Lance Walters
648516af71 apps(siriusdevops): pin site to af139906 — five-band homepage repositioning 2026-11-23 23:09:23 -05:00
Lance Walters
82f0d83243 apps(siriusdevops): pin site to e2fd76a — /book drops the public audit price
siriusdevops-site:e2fd76ad (merge of PR #19) replaces the $750–$1,500
audit anchor in the /book funnel with 'scoped and quoted after the review'.
contact-api is unchanged at 8642f1a.
2026-11-23 22:54:10 -05:00
01db28dec5 apps(forgejo): serve a declarative robots.txt that keeps non-portfolio paths out of the index
Self-registration was open until 2026-11-20 and Google indexed spam
profiles under forgejo.siriusdevops.com (/leonabrewton8, /charlinebrando,
.../-/packages). The accounts are deleted and 404 now, but Forgejo's
built-in robots.txt only blocks /explore/*?* and /user/, so /explore/repos
and /search stay crawlable.

Forgejo serves GITEA_CUSTOM=/data/gitea/public/robots.txt at /robots.txt,
so mount a ConfigMap there (the supported custom-public override) and
disallow /explore/*, /user/*, /search*, /api/*, /*/-/packages while
allowing /sirius/* for the portfolio repos.
2026-11-23 22:50:52 -05:00
Lance Walters
79206e0487 ops(farrisilk): park the client replica stack to cut siriussec draw
siriussec is on a 15 W USB-C adapter and low-battery-shutdown fired 2026-11-22
04:20. The farrisilk replica (Odoo + Metabase JVM + Postgres) is the largest
single stack on that node and is not client production. Scale its three
Deployments to 0 and suspend the nightly pg_dump; PVCs and data stay put.

Restore: set replicas back to 1 in odoo.yaml, metabase.yaml, postgres.yaml and
unsuspend backup.yaml, then let Flux reconcile.
2026-11-22 05:54:53 -05:00
Lance Walters
530320bbfe ops(siriussec): bound CPU bursts to the 15W power budget
siriussec is a T480 on a 5V/3A (15W) USB-C supply and died 2026-11-22 04:20
after ~12h on battery. Host PL1 was 25W with turbo on, so any sustained burst
outran the adapter. Cap the two workload-side bursts that can pin cores:

- forgejo-runner-amd64 dind: no CPU limit before -> add cpu: 3
- metabase + farrisilk metabase: cpu limit 2 -> 1 each (two JVMs = 4 threads)

Host-side cap (PL1 12W/PL2 15W, no_turbo=1) is applied by
cpu-power-cap.service on the node itself, not by this repo.
2026-11-22 05:42:52 -05:00
devops
96404c96e1 apps(farrisilk): document backup schedule/restore/RPO + the filestore gap with measured evidence 2026-11-22 02:43:17 -05:00
devops
03fb50c3d7 apps(farrisilk): client-shaped nightly pg_dump cron + 14d retention on a 10Gi PVC 2026-11-22 02:38:35 -05:00
Lance Walters
f658bfabe9 apps(farrisilk): close the metabase_ro schema-CREATE hole + README
metabase_ro could create tables in public: default_transaction_read_only is a
role default the role can lift (SET ... = off), and PG16 keeps CREATE on schema
public for PUBLIC when the database was created by a non-superuser (Odoo creates
its own). Revoke CREATE from PUBLIC and ALL from metabase_ro, grant USAGE only,
in both the first-boot script and the per-start grant pass. README documents the
stack, list_db/workers=0 rationale, module loading, filestore, the DB-only backup
gap (filestore is not covered; follow-up t_8bdd3708) and the Shopify blank.
2026-11-22 02:28:56 -05:00
Lance Walters
4891694f6f apps(farrisilk): name Odoo's database odoo (align with the BI grants + Metabase source)
The card's build section names db `odoo` (owner odoo) and points Metabase at
pg.../odoo, while its Odoo config line said db_name=farrisilk — the two cannot
both hold. Aligned on `odoo`: db_name/dbfilter in odoo.conf and the init
script's ODOO_DB_NAME. The renamed database kept its data (partner 7, product
template 1, base+web+product installed).
2026-11-22 02:25:09 -05:00
Lance Walters
7f7f806616 apps(farrisilk): lab replica stack (Odoo 18 + plain Postgres + Metabase) on :8086/:8087
Odoo 18 (dated tag 18.0-20261112) on a plain postgres:16 container, not CNPG:
the client runs bare Postgres on a Proxmox VM and this namespace mirrors that
shape. Odoo's initContainer installs base,web once, applies the read-only BI
grants/revokes and sets the admin login from a Secret. Metabase gets its own
state in the same Postgres (db metabase) with a 1Gi heap and
MB_ENCRYPTION_SECRET_KEY. Two bare-IP Gateways (8086 odoo, 8087 metabase) in ns
internal, each with its own RouteConfiguration. Host firewall (nft on siriussec,
ufw on rpi) carries 8086/8087 and was installed before the Gateways were pushed.
2026-11-22 02:15:56 -05:00
Lance Walters
930752152e apps(metabase): deploy Metabase (WireGuard-only :8085) with CNPG app DB
- apps/base/metabase: namespace, CNPG Cluster pg (5Gi local-path, siriussec),
  Metabase Deployment v0.65.6.3 (1.5G heap, no PVC), Service, hostname-less
  HTTPRoute on the dedicated metabase Gateway
- infrastructure/networking/internal: new Gateway metabase on port 8085
  (own RouteConfiguration, so it cannot merge with Grafana's bare route)
- host firewall: 8085 in siriussec nft set + rpi ufw guard
2026-11-22 00:32:31 -05:00
a0fc373e34 Merge pull request 'apps(osint): pin ingester to amd64-76035535bcb2' (#37) from fix/osint-gdelt-bulk-pin into master 2026-11-21 23:39:33 +00:00
Lance Walters
0e5ba18377 apps(osint): pin ingester to amd64-76035535bcb2 (GDELT 15-min GKG bulk ingest) 2026-11-21 18:39:28 -05:00
f83b0cb246 Merge pull request 'apps(osint): pin ingester to amd64-fc0cd41b7aa4 (GDELT 429 backoff)' (#36) from fix/osint-gdelt-backoff into master 2026-11-21 23:15:58 +00:00
Lance Walters
1e9253c147 apps(osint): pin ingester to amd64-fc0cd41b7aa4 (GDELT 429 backoff)
osint-dashboard#69: drop the pointless https->http retry on 429, add a
doubling backoff (300s -> 1800s, Retry-After honoured) and log one line
per cycle instead of a traceback. Ingester only; app/camera keep their tags.
2026-11-21 18:15:51 -05:00
243f113c1f Merge pull request 'apps(osint): set PGDATABASE=osint_data on osint-db' (#35) from fix/osint-db-pgdatabase into master 2026-11-21 22:58:39 +00:00
Lance Walters
f0a82f85de apps(osint): set PGDATABASE=osint_data on osint-db
deploy/osint-db logged 'FATAL: database "osint" does not exist' straight
after it became ready (2026-11-21 22:15:15): any bare `psql -U osint` /
`pg_dump -U osint` inside the pod defaults the database to the user name.
PGDATABASE makes osint_data the default so ops commands cannot aim at a
database that does not exist. Probes already pass -d osint_data.
2026-11-21 17:58:33 -05:00
d5514c6ed4 Merge pull request 'apps(osint): pin app to amd64-54897b49bc57 + ADS-B idle watch env' (#34) from fix/osint-adsb-watch-poll into master 2026-11-21 22:42:24 +00:00
Lance Walters
f326735a8b apps(osint): pin app to amd64-54897b49bc57 + ADS-B idle watch env
osint-dashboard#68: the ADSB refresh loop persisted aircraft only for
connected browser viewports, so aircraft_positions stalled whenever nobody
had the map open. The new image sweeps the chokepoint presets while idle;
this commit pins it and sets ADSB_REFRESH_INTERVAL/ADSB_WATCH_* explicitly
instead of relying on app defaults.

ingester/camera keep amd64-915f6cbe25be (no loop change there); pinning the
ingester would restart it for nothing.
2026-11-21 17:42:10 -05:00
0e6fa0d738 Merge pull request 'apps(osint): pg image r3 for timescaledb 2.32.1 on PG 16.16 (fix all policy jobs)' (#33) from wt/t_c3e6d2cd into master 2026-11-21 22:14:04 +00:00
Lance Walters
e63c14641d apps(osint): pg image r3 for timescaledb 2.32.1 on PG 16.16
PG 16.16 added the PortalDrop() "cannot drop portal" check that
TimescaleDB <=2.32.0 trips from the background scheduler, so every policy
job (refresh/compression/retention/job history) failed with SQLSTATE 24000
although CALL run_job() worked (timescale/timescaledb#11038, fixed in
2.32.1).

Rebuilt apps/base/osint/pg-image/Dockerfile with:
- base postgres:16.16-bookworm (was floating 16-bookworm)
- timescaledb-2-postgresql-16 / -2-loader-postgresql-16 pinned to
  2.32.1~debian12-1616 (built against PG 16.16)

Pushed as amd64-c48788d4b614-r3 (digest sha256:b2bdc093...), verified by a
throwaway restore of a fresh pg_dump: extension 2.32.0 -> ALTER EXTENSION
UPDATE 2.32.1 -> all 12 jobs Success with real last_successful_finish and
no portal errors.
2026-11-21 17:13:54 -05:00
2380cfb6ac Merge pull request 'apps(osint): move osint-db onto a linode-local PVC' (#32) from wt/t_f459753c into master 2026-11-21 21:47:26 +00:00
Lance Walters
c2cdc2d5c1 apps(osint): move osint-db onto a linode-local PVC
osint-db (TimescaleDB+PostGIS) moves from siriussec's local-path PV to a new
15Gi local-path-linode claim restored from a pg_dump (44,120,765 bytes,
sha256 d74afa6d...30da). The Deployment gets a required linode nodeAffinity
plus an amd64 arch selector; the old osint-pgdata claim and its PV are left
untouched so rollback is one revert of claimName + scheduling.
2026-11-21 16:47:03 -05:00
7da7a8c5d4 Merge pull request #31 from wt/t_e7e02d2e into master 2026-11-21 21:24:41 +00:00
2d38e1a3f7 Merge pull request 'storage: add a linode-local StorageClass + provisioner (local-path-linode)' (#30) from wt/t_5635533c into master
Merge pull request 'storage: add a linode-local StorageClass + provisioner' (#30) from wt/t_5635533c into master
2026-11-21 21:24:23 +00:00
devops
b55ec826c9 apps(osint): place stateless CPU workers on the amd64 linode node
news-scraper, news-summarizer, ingester and nats were hard-pinned to
siriussec (the ThinkPad, on a 15 W USB-C supply that brownouts under load).
Replace the hostname pin with:
  * nodeSelector kubernetes.io/arch=amd64  (keeps them off the arm64 rpi)
  * preferred nodeAffinity weight 100 for kubernetes.io/hostname=linode
still falling back to siriussec if linode is down. No PVCs, images,
resources or taints touched.
2026-11-21 16:24:16 -05:00