The CNPG operator dials each instance's HTTPS status endpoint
(https://<podIP>:8000/pg/status) to derive the system ID and drive
switchover. The tenant isolation added in t_fed52919 opened only
gateway/node/health entities, same-namespace pods and monitoring:9187,
so cnpg-system was denied: forgejo/pg and sirius-growth/portal sat at
Ready=False / ConsistentSystemID=False ('Instance Status Extraction
Error: HTTP communication issue') while their pods served traffic and
automated failover was effectively disabled.
Add one ingress rule to each CNP, scoped to the operator pod label
(app.kubernetes.io/name=cloudnative-pg in cnpg-system) and to TCP 8000
only. Not world, not the whole cluster, not 5432.
The namespace never pulled from the in-cluster registry before (its job used
alpine/k8s from Docker Hub), so the new image reference had no credential and
the pod sat in ErrImagePull. Same SOPS-encrypted dockerconfigjson as the other
namespaces; deviating only in metadata.namespace.
monitoring/grafana-backup, forgejo/cluster-backup and sirius-growth/leadgen-backup
all ran `apk add --no-cache rsync openssh-client` at container start. Every night
that dialled dl-cdn.alpinelinux.org (Fastly anycast 151.101.x.132:443), which is
what `egress-new-dst` kept reporting, and made the backups depend on the public
internet at 03:00 UTC.
- image: forgejo.siriusdevops.com/sirius/backup-tools, built in CI from
python:3.12-alpine (pinned by digest) + rsync + openssh-client + bash +
kubectl v1.36.4 (release sha256 verified at build). Pinned by digest in all
three CronJobs, no apk in any backup path.
- egress: CiliumNetworkPolicy per backup pod — cluster DNS and 10.10.0.5:22 for
all three, plus kube-apiserver 6443/443 for cluster-backup only, with an
explicit deny for `world` (Cilium unions namespace policies, so the allow list
alone would not restrict a pod inside `forgejo`/`sirius-growth`).
- monitoring gains the registry pull secret it never needed before; the job now
keeps imagePullSecrets: forgejo-pull (SOPS-encrypted in git).
Schedules, retention, destination paths, entrypoints and RBAC are unchanged.
REQUIRE_SIGNIN_VIEW was the F11 mitigation for ghost-user /v2/token grants,
but it also forced every public repo to a login page. Move the guard to a
Cloudflare custom rule that blocks /v2/token unless the request carries
Basic auth, and turn public browsing back on.
Audit F3 / A5-1. Every pod in customer1, osint, sirius-growth, piedmont,
siriusdevops and forgejo was reachable from every other pod, from the API
server, from the internal WireGuard-only Gateway ports on 10.10.0.2 and from
the internet.
- each namespace: a stock NetworkPolicy 'default-deny' (podSelector {},
Ingress+Egress, no rules) plus a CiliumNetworkPolicy allow that names the
gateway/kubelet/health entities, same-namespace pods, cluster DNS and only
the egress each workload actually uses (world for Telegram/news/inference,
remote-node :3900 for Garage, :22 for the backup rsync, kube-apiserver :6443
where CNPG/kubectl needs it, none at all for customer1)
- siriusdevops: replaces the egress-only siriusdevops-site-egress CNP
- customer1: ResourceQuota + LimitRange sized from the declared 1-replica
shape (35Gi already bound, 2 CPU / 4Gi requests) - the sandbox stays parked
- docs/network-isolation.md: the model plus the five gotchas measured while
landing it (both-ends enforcement, kube-apiserver identity covering the
whole node IP, remote-node vs world for Garage, ingress vs host identity)
Kata's guest cgroup root is 'domain threaded' and only cpuset/cpu/pids are
delegated, so dockerd cannot apply --memory to a job container: every job died
at 'docker run' with
unable to apply cgroup configuration: cannot enter cgroupv2
"/sys/fs/cgroup/docker" with domain controllers -- it is in threaded mode
(run 1442, first attempt on the Kata runner). Drop --memory/--memory-swap from
deploy-arm64.toml only; the 2Gi dind limit sizes the microVM, so the blast
radius is unchanged. The runc runners keep their per-job limits.
A disk-backed emptyDir is a virtiofs share under Kata, and a unix socket on
virtiofs is visible across the pod but unconnectable: the runner crashlooped on
'cannot ping the docker daemon ... unix:///var/run/docker.sock' although ls -l
showed srw-rw---- root:1000 and the dind sidecar's own 'docker version' on the
same path worked. medium: Memory makes /var/run a tmpfs inside the guest, so the
socket is a real inode for both containers and the existing
'-v /var/run/docker.sock /var/run/docker.sock' job option keeps working.
Verified: the runner declared successfully and polls (deploy-arm64 runner).
The CI capsule cannot enforce PSA baseline: every nested dockerd needs
SYS_ADMIN+NET_ADMIN in the pod spec and baseline forbids exactly those, which
sysbox, gVisor and Kata all reproduce (measured on both arches, card
t_8aa4af50). What a runtime CAN change is what privileged:true means.
Stage 1, one runner: forgejo-runner-deploy-arm64 (rpi) gets
runtimeClassName: kata-qemu, so its privileged dind and job containers run
inside a QEMU/KVM microVM instead of on rpi's host namespaces. The amd64 and
shared arm64 runners stay on privileged dind under runc, untouched.
Kata-specific plumbing in the same Deployment:
- loop-backed ext4 data-root (16GiB image on the existing claim) because
overlayfs refuses virtiofs and Docker would silently fall back to vfs;
- binfmt_misc + tonistiigi/binfmt --install amd64 on every start, because the
guest kernel has no qemu handlers and deploy-site.yml cross-builds amd64;
- the runner waits for /var/run/dind-ready (touched after both are set up).
RuntimeClass kata-qemu is cluster-scoped; the containerd handler lives on rpi
only (/etc/containerd/conf.d/50-kata.toml, kata-static 4.4.0). Rollback is one
field. docs/pod-security.md records the measurement and states plainly that the
namespace stays enforce: privileged.
The CNPG exporter answers the whole /metrics request with HTTP 500 when a
custom query emits two rows with the same series name + label set, which
also drops every pg_stat_*/cnpg_pg_* series (Prometheus target down).
action_runner held three rows named siriussec-amd64 (one live, two
soft-deleted tombstones from the runner renames), so
cnpg_actions_runners_last_online_seconds was collected twice and the
endpoint returned 500.
- WHERE r.deleted IS NULL -> ignore Forgejo's soft-deleted runner rows.
- GROUP BY r.name with max(last_online) -> the label is the name, so a
duplicate name can never produce a duplicate series again; reporting the
most recent poll per name is the intended semantic.
- label cnpg.io/reload -> the instance manager re-reads the queries on
change instead of needing a pod restart (or kubectl cnpg reload) before
a query fix takes effect.
Renames the namespace introduced in #72 (`forgejo-runners` -> `ci-runners`) per
the orchestrator decision on card t_2bbe34a8, and sets the capsule's
warn/audit levels to `privileged` alongside `enforce: privileged`: everything
in it is allowed by design, so restricted-level warnings on every pod restart
would be noise, and the intent is explicit in Git rather than implied.
Storage is the same three PVs, rebound again by name (Retain + cleared
claimRef), so the runner registration uuids, dind image sets and action caches
survive: verified before/after (uuids 91124ee3/4e07c1e9/a41aad73, image counts
19/2/31, canary files intact). Monitoring selectors and docs follow the new
namespace; the Grafana dashboard keeps its `forgejo-runners` uid.
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
The collector wrote 150 MiB plaintext files into a directory capped at 960 MiB,
which bought only ~4-5 h of retention at the measured 4.5-6.2 GB/day
(3380-4280 kB/min) of filtered Hubble JSONL — the cap was sized for a forensic
window, not for hours.
Compress on rotate; no schema change, no filter change, no DS argument change:
* the file being appended stays plain `flows-<ts>-<n>.jsonl` (one file for a
reader to tail);
* on rotation the closed file is gzip'd to `.jsonl.gz` through a temp name +
atomic rename, in the background, so a reader never sees a partial archive and
the flow reader never stalls (stalling it makes the agent drop events);
* prune bounds the WHOLE directory at MAX_TOTAL_BYTES = 960 MiB — archives and
in-flight `.gz.tmp` included — deleting oldest first, and never reaps the live
file nor a file whose gzip is still running (that would discard the archive
and lose the entire file);
* MAX_FILES now bounds plain files only. Applying it to the archives is exactly
what would keep retention at a few hours.
Measured on this node's live data 2026-11-27: 18.53x ratio at gzip -9
(17.85x at -6), i.e. 960 MiB holds 72.6 h at the 6.16 GB/day burst sample,
92 h at 4.87 GB/day and ~100 h at the 4.48 GB/day 55-minute average.
Verified offline against a replaying fake `hubble` (rotation->archive parity,
gzip -t on every archive, atomicity, oldest-first prune, live-file and in-flight
protection) and inside the real cilium image under dash (23 rotations -> 23
valid archives, no loss).
The fix-data-perms init container guarded a chown -R behind a TOP-LEVEL owner
check (`stat -c %u /data/.cache`). /data/.cache was already 1000 while the git
pack files inside it were still root:root from the pre-uid-1000 runner, so the
guard skipped exactly the file that matters and every job on that runner died
in actions/checkout, before a single step:
open /data/.cache/act/actions-checkout@v4/.git/objects/pack/pack-ba0cccfe….pack:
permission denied
That is a 3 s red X with zero steps on a push (websites run 1430, card
t_29249bf0). chown the three trees the runner writes recursively instead
(cache/, .cache/, runner.ini); /data/docker stays root-owned and unwalked.
Also document the Recreate consequence: a template rollout SIGKILLs in-flight
jobs and Forgejo reports them as a plain failure with the log cut off mid-step
(sirius-growth push run 1422: 14 min red, log ending at 'Fetching the
repository').
All three contact APIs were still running the pre-F13 tree: unbounded
per-IP _hits deque and an unvalidated X-Real-IP limit key.
- siriusdevops-contact:467b087 (CI run 64 at the F13 merge 467b087)
- sirius-growth-contact:97cfa4f (main head = F13 merge 3042edc + the
deploy-contact buildx fix f3a9cae; run 126 job 2074)
- phs-contact:0446be8 (main head = F13 merge bd64105 + buildx fix
0d6d5e3 + the phs Telegram HTML fix 64f1b5b; run 126 job 2075)
The two latter merge shas had no image: their build failed on
'could not obtain buildx' until the workflow fix, so the pinned tags are
the current heads, which contain the F13 tree.
#54 (secops F6) inserted the new fix-data-perms init container at the
tolerations list indentation instead of under an initContainers key, and dropped
the key itself. YAML still parsed (a list item with name/image/... is just a
malformed toleration), so the merge was green, but the API rejects it:
Deployment.apps "forgejo-runner-arm64" is invalid:
spec.template.spec.tolerations[1].operator: Invalid value: "": operator must
be Exists when key is empty
That failed the dry-run of the whole apps Kustomization, so nothing in
apps/home could be applied at all - including any secret rotation - until it was
fixed. Nothing was pruned or broken in the cluster: the rejected revision never
applied.
Restores the initContainers: key above the block; the container's own body is
untouched, so F6's intent (re-own the PVC as 1000:1000 instead of chmod 666 on
the dind socket) is preserved.
Verified: the file parses to tolerations=[dedicated/Equal/network/PreferNoSchedule],
initContainers=[fix-data-perms], containers=[dind, runner]; server-side dry-run of
this Deployment succeeds; server-side dry-run of all 116 non-Secret objects in
apps/home reports no errors.
The FastAPI app now publishes components.securitySchemes.adminSession
(apiKey/in:cookie/osint_session) and stamps security on every documented
operation from auth.is_public(). Merged as 6066ac8e0d6c in
sirius/osint-dashboard (PR #71); CI pushed
forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-6066ac8e0d6c
(digest sha256:bf5f3d4ffbb7ae8cbe54fcf5f5b81cd5a1815d8abf9e042c2804f5a2d207ae6c).
The live /openapi.json keeps advertising no securitySchemes until this tag
is running, which is what F17 flagged.
Completes F12 on the objects deliberately held back until the delete-and-reconcile
drill on siriusdevops/siriusdevops-contact had proved the path works (it did:
deleted 05:29:03Z, recreated by Flux 05:29:05Z, byte-identical, pod restarted off
the recovered Secret and /health 200 — see docs/secrets-sops.md).
* cluster-backup-ssh in forgejo, sirius-growth and monitoring — three files, one
plaintext ed25519 key: a Secret cannot cross namespaces and each backup
CronJob mounts its own namespace's copy, so all three must exist and all three
must be rotated together.
* monitoring/grafana-admin, monitoring/grafana-secret-key and
monitoring/alertmanager-telegram, which are the *inputs* the prometheus-operator
and Grafana consume; the operator's rendered prometheus-*/alertmanager-* objects
stay excluded (a second writer would fight it).
* monitoring Kustomization gains the same sops decryption block as apps.
All six files were generated from the live objects and decrypt to a byte-identical
data map and type, so this apply is a no-op.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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).
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.
- 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
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.
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.
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.
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.
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.