---
title: "Security, compliance and operations"
description: "Threat model, GDPR, backup and observability."
---

## Trust model in one table

| Asset | Who may read/act | Control |
|---|---|---|
| Another tenant's data | nobody in a tenant | separate DB/bucket/process; token org checks |
| LiveKit API secret | CP broker only | Stored in the separate Infisical project `fortspace-broker`; only the broker identity (viewer) can read it |
| Coolify API token | CP worker only; **and the base stack's deploy** | root-equivalent on host; rotated; network-restricted. The base stack's own token is in the `prod` GitHub Environment (ADR-030): that runner can therefore change the whole platform |
| **Base stack's Pulumi state** (bucket + passphrase) | the operators' workstations **and GitHub Actions** | the state lives in an S3-compatible EU bucket outside the platform, versioned, with bucket-scoped keys (ADR-029); the passphrase (in the `prod` Environment and in `.env.local`) decrypts every secret in it. A compromised runner means a compromised platform — the Environment is restricted to `main` and can require a reviewer |
| GHCR registry token (read:packages) | the Coolify host (docker login) | classic PAT with `read:packages` only; a secret of the base stack (`base:registryToken`); it is never given to a tenant stack |
| Pulumi state backend URL | CP worker only | own database `pulumi_state` with its own role on core Postgres; the URL carries a password and is never in the repo or in the API |
| Pulumi secrets-provider passphrase | CP worker only | Infisical `/platform/pulumi#PASSPHRASE`; the state rows are ciphertext at rest |
| Zitadel mgmt rights | CP provisioner service account | narrowly scoped IAM role; JWT profile key in Infisical |
| Zitadel instance admin | `platform-setup` machine user + superadmins | `IAM_OWNER`; key in Infisical (`/platform/zitadel#SETUP_KEY_JSON`); the bootstrap PAT is revoked after the first setup |
| Zitadel Login UI session cookie | the Login UI, with the key in the base stack's encrypted state | `ZITADEL_SESSION_COOKIE_SECRET` (escrow offline): it signs the browser sessions; rotating it signs every user out of the Login UI |
| RustFS console | superadmins only | Zitadel OIDC, project `Fortspace Admin`, role `superadmin`; the root key stays with the CP worker |
| Infisical UI | local org admins (password + TOTP) | no free OIDC/SAML on the self-hosted edition (ADR-023) |
| Coolify UI | one local account | it hosts Zitadel: it must work when Zitadel is down |
| Tenant S3 key | that tenant's go-meet (+ Egress per request) | bucket-scoped policy |
| Recordings | meeting participants as authorized by go-meet | presigned 15 min; SSE |
| Audit log | operators | append-only, ids not content; written in the same transaction as the action; keys that look like secrets/emails are rejected |
| Tenant webhook signing secrets | the tenant stack (own copy), the CP broker (every tenant's routing copy) | separate Infisical projects; the API holds the broker identity only |

## Threat model (STRIDE-lite)

| Threat | Scenario | Mitigations |
|---|---|---|
| Spoofing | Forged webhook to a tenant stack | HMAC from router; stack only accepts router signature; internal network only |
| Spoofing | Stolen go-meet session | HttpOnly/Secure/SameSite cookies, back-channel logout, short refresh window |
| Tampering | Tenant tries another tenant's room | Broker parses the room name and requires exactly the caller's slug (verified org → tenant row; `acme` cannot reach `acme2`); grants default-deny; names unguessable |
| Repudiation | Operator action disputes | Audit rows in same transaction; Zitadel + Infisical audit trails |
| Information disclosure | Compromised tenant stack | Only its own DB/bucket/secrets; room-scoped tokens (≤1 h); no LiveKit secret |
| Information disclosure | Leaked presigned URL | 15 min TTL, tenant-scoped; recording URLs not posted statically |
| Denial of service | Noisy tenant | Per-tenant CPU/mem caps, per-shard isolation, lobby/request throttling in go-meet, per-tenant rate limits at broker |
| Elevation | SSRF/RCE in control plane | API process lacks powerful creds; workers isolated; egress allow-lists; the webhook router never follows a redirect, so the signed body cannot be re-sent to another URL |
| Elevation | Zitadel misconfig (auto-link) | Auto-create/auto-link off by default; domain verification; org-scoped IdP only |
| Supply chain | Image compromise | Pin digests, scan (Coolify can scan images), signed builds for go-meet and CP |
| Information disclosure | The Pulumi state is read | The state is encrypted with a passphrase held in Infisical (worker only); the API never reads it; no tenant content is in the state |
| Elevation | A tenant stack name reaches another project's resources | The adapter only manages `fortspace-tenant-<slug>`; a root-team token is the blast radius and the name is the guard |

### Residual risks to accept explicitly

* **Shared LiveKit** is a shared failure domain; Enterprise tier gets a
  dedicated node/key.
* **Control plane compromise** is high impact → smallest possible surface,
  separate worker role, MFA for operators, break-glass procedure.
* **LiveKit token non-revocation**: bounded by TTL (≤ 1 h; recording and admin
  tokens shorter).
* Host-level disk encryption protects against disk theft, not a root compromise
  of the host.
* **The base stack's Pulumi state is in an object storage bucket** (S3-compatible, EU, outside
  the platform — ADR-029) and holds every generated platform password, encrypted with the
  passphrase. The passphrase and the bucket key are in the `prod` GitHub Environment, so the
  automatic deploy (ADR-030) can read and write it: **a compromised CI runner is equivalent
  to a compromised platform** (root on the Coolify host, every secret of the stack). Mitigations:
  the Environment is restricted to `main`, the bucket key is bucket-scoped, the deploy is
  serialized, and the state itself is encrypted. Residual: a reviewer on the Environment is
  *not* configured yet — the deploy runs unattended.
* **No automated backup of the core Postgres yet** (Zitadel, Infisical, control plane, Pulumi state
  of the tenants). The first manual dump was taken on 2026-11-25 before the Zitadel upgrade
  (`~/fortspace-backups/` on the Coolify host) — take a `pg_dump` per database before any upgrade
  until the backup job exists.
* **Mailpit's UI has no login of its own** and holds every Zitadel and Infisical mail
  (init codes, password resets, invites) until the prod EU SMTP relay replaces it. Temporary by
  decision (ADR-023). With `base:mailpitAuthEnabled` an OIDC login (the operator's external
  pocket-id, an allow-list of emails) stands in front of it and the exposure is closed; **while
  the flag is off it is a live exposure**: treat the mails as readable by anyone who knows the
  host. The login's client id, client secret and session key are in the Traefik labels of the
  Mailpit container (the plugin reads them there): encrypted in the Pulumi state, but readable in
  Coolify's database and in the container's labels. Escrow the client secret and the session
  key offline with the other secrets.

* **Tenant hosts are same-site with the platform** (ADR-035, [13](/architecture/tenant-hosts)): a
  tenant's host can set cookies for `fortspace.eu`. Our session cookies are host-only `__Host-`
  (go-meet's double-submit `csrftoken` excepted) and origin checks are the CSRF control; **Zitadel's login cookies cannot be prefixed**: a neighbour can shadow
  them (the victim must log in again) or plant its own valid session (login CSRF), which every
  product's own org/role check after login must stop. Tenant names are public in certificate
  transparency logs.

### Exceptions and known risks

Two exceptions to the normal rules are deliberate and recorded here.

**1. The Pulumi state holds secrets (exception to "no secrets in a column",
ADR-021).** A Pulumi checkpoint is not a registry column: it is an encrypted
control-state blob. The tenant stack's secret values are stored as Pulumi
secrets, so the state rows contain `{"ciphertext": "v1:…"}` and never
plaintext; the passphrase lives in Infisical (`/platform/pulumi#PASSPHRASE`)
and is read by the worker identity only.

What the exception does **not** cover: job payloads, step outputs, audit rows,
logs and the tenant registry keep ids and refs exactly as before, and the
adapter never writes a decrypted value anywhere. The risk accepted is that the
Pulumi state is worth attacking if the passphrase is stolen; the mitigation is
that the passphrase is in Infisical with the worker identity, the state is
encrypted at rest, and the state holds no tenant content (only configuration
and the ciphertext of the stack secrets). The detailed table is in
[08](/architecture/data-storage-secrets#pulumi-secrets-the-one-exception-to-no-secrets-in-a-column).

**2. The Coolify token reaches the whole root team (blast radius).** The
control plane talks to Coolify with a **root-team** token that carries `read`,
`write`, `deploy`, `read:sensitive` and `delete`. A token of that kind can
reach **every project of the team**, not only the tenant projects. Coolify's
own permission model is not the boundary we rely on, for two reasons: a
restricted write token is not a server security boundary anyway (Compose and
bind mounts are privileged), and a project-scoped token hides the other
projects from the API, which the CP needs for listing.

The boundary is therefore **code and tests**, not permissions:

| Guard | Rule |
|---|---|
| Name | the adapter only manages projects named `fortspace-tenant-<slug>`; the prefix can never match the pre-existing `fortspace` project or any other project of the team |
| Tags | what the adapter creates is tagged (`tenant-<slug>`); tags are team-scoped, so one stack's `destroy` cannot remove another stack's tag |
| Destroy | `destroy` acts only on stacks recorded in `pulumi_state`, never on a name found by listing |
| Identity | only the worker holds the token; the API has none (hard rule 8) |
| Rotation | the token is rotated on schedule (see the runbooks) |

The residual risk is accepted explicitly: a compromised worker can reach every
project of the root team. That is the same blast radius as the Zitadel
provisioner key and the RustFS root credentials the worker already holds, so it
does not widen the worker's trust boundary — but it does mean the worker is the
one component whose compromise is a platform-wide incident. A separate Coolify
team per environment is the future mitigation.

### Known limitations of the prototype

Two trade-offs the audit left open on purpose. They are bounded, understood and
listed here so nobody discovers them in production.

**1. The idempotency lease is 60 s.** A mutating request claims its
`Idempotency-Key` by inserting a row before the handler runs and stores the
response when it is sent. If the process dies in between, the row would block
every retry of that key for the whole 24 h retention, so an in-flight row older
than the **60 s lease** is treated as abandoned and taken over by the next retry
(atomically: exactly one retry wins, and only for an identical request).
Consequence: a mutating request whose handler runs **longer than 60 s** can be
taken over by a client retry while the first execution is still running, and
then **execute twice**.
*Mitigation:* handlers are short: they validate, write the registry rows in one
transaction and enqueue a job; the queue is the thing that is allowed to be slow,
and the job side is idempotent by construction (create-or-get steps,
`singletonKey` per tenant, optimistic status transitions). No current endpoint
does long work in the request. *What would change it:* a longer or per-route
lease (a longer lease delays recovery after a crash by the same amount), a
heartbeat that renews the lease while the handler runs, or storing the response
in the same transaction as the action so no in-flight row exists.

**2. The principal cache is 30 s.** The API resolves a verified token to a tenant
row (`zitadel_org_id` → tenant, including its status) and caches the row per
process: **30 s** for a found tenant (an unknown org for only 2 s, so a
just-provisioned tenant is not locked out; at most 1000 entries, oldest evicted
first). Consequence: a tenant that is **suspended or erased** can still be
authorized by tenant-level calls for up to 30 s. The **token broker is the
exception**: it re-reads `tenants.status` from the database on every token
request, so a suspension stops new LiveKit tokens at once.
*Mitigation:* the window is short and bounded; tokens already issued die within
their TTL anyway (≤ 1 h, LiveKit cannot revoke), so a shorter cache would not
make the system revocable, only less stale; the suspension design
([05](/architecture/tenant-lifecycle#suspension)) also deactivates the Zitadel org,
which stops new logins independently (suspension itself is not built yet). *What would change it:* the
same direct read for other sensitive calls, an
explicit cache invalidation when a status transition commits (works for a
single process; multiple replicas need `LISTEN/NOTIFY` or a version column
check), or rechecking the status in the database for mutating tenant calls.

Smaller facts of the same kind: webhook routes are cached 30 s and webhook
secrets 5 min (rotating a tenant's webhook secret takes up to 5 min to reach the
router; negative lookups are cached 2 s and 5 s); the cockpit re-checks roles
every 10 min and its session cookie is stateless, so a copied pre-logout cookie
works until its next refresh; compensation runs only for a provisioning whose retries are
exhausted; the prototype has no reconciler or alerting beyond logs and metrics.

## GDPR / EU sovereignty mapping

| Requirement | Mechanism |
|---|---|
| Data residency | Single EU region for all planes; region on tenant row; no non-EU sub-processors for content (transcription is EU-hosted or local Whisper) |
| Purpose limitation, minimization | Audit log holds ids only; LiveKit holds no content; transcripts opt-in |
| Right of access / portability | Tenant admin export (recordings, transcripts, Matrix export, meeting data) |
| Right to erasure | Offboarding saga + crypto-erase ([05](/architecture/tenant-lifecycle)); per-user erasure requests via tenant admin tooling |
| Retention | S3 lifecycle + per-tenant policy; documented defaults ([08](/architecture/data-storage-secrets)) |
| Security of processing | Isolation, encryption, short-lived creds, audit, backups with drills |
| Breach notification | Central logging + alerting; runbook with 72 h clock |
| Sub-processors | Documented list: hosting provider, Scaleway (DNS), email relay if any |
| DPIA / records | Maintain RoPA per module; recording/transcription DPIA template for tenants |

> Compliance statements are design intent, not certification. Legal review
> and DPAs are out of scope of this document.

## Observability

| Signal | Tooling (default) | Labels |
|---|---|---|
| Logs | Loki or ELK, pino JSON | `tenant`, `service`, `request_id`; stdout per container keeps tenant logs separable |
| Metrics | Prometheus + Grafana | `tenant`, `shard`, `module` |
| Traces | OpenTelemetry (CP, go-meet) | `traceparent` injected explicitly on every outbound call that crosses a trust boundary (webhook forward, Infisical, RustFS admin) |
| Uptime | Synthetic probe per tenant (login, token, Matrix `/versions`) | — |
| LiveKit | Prometheus endpoint of LiveKit + Egress | node, room prefix aggregated |

Alerts (initial set): provisioning failures, drift detected, shard > 80%
capacity, broker 5xx/latency, webhook forward failures, Egress failures,
certificate expiry < 14 d, backup job failure, Infisical unreachable.

## Break-glass

Every lockout has a path that does not depend on the system that is locked. The
credentials below are the **offline escrow** (password manager + printed copies),
never in Infisical.

| Lockout | Path back in |
|---|---|
| No superadmin can log into Zitadel (MFA device lost, account locked) | another superadmin resets the account in the Zitadel console (user management: password / MFA); with no superadmin left, the Coolify local account + `docker exec` on the Zitadel container (the `platform-setup` machine key can be re-created from the console's key view) |
| Zitadel is down | Coolify is the host: its local account (escrow) opens the platform. Zitadel's own state lives in the core Postgres, restored from the backup runbook |
| `platform-setup` key lost or unreadable | a superadmin creates a new key for the `platform-setup` machine user in the Zitadel console and writes it to `/platform/zitadel#SETUP_KEY_JSON`; `superadmin.sh` uses it from then on |
| Infisical unreachable | the instance admin password (escrow) opens the UI; the CP keeps working with its cached credentials until the Infisical API is back |
| RustFS console unreachable | the root key (`/platform/rustfs#ROOT_ACCESS_KEY` + `ROOT_SECRET_KEY`) logs into the console directly; the control plane holds the same key, so the buckets stay manageable |
| Coolify unreachable | the local Coolify account (escrow) is the only way in: it must exist, with MFA, even while Zitadel login is not configured (ADR-023) |
| A tenant's storage is lost | restore from the backup runbook; the bucket policy is re-created by the CP (`shard.add` / reconcile) |

Rules that keep this working: one Coolify account with a stored password and MFA, the
Infisical admin password in the escrow, the Zitadel masterkey in the escrow, and at
least **two** superadmins so one lost device is never a lockout.

## Operational runbooks (to write)

**Written:** bringing up, operating and troubleshooting the base infrastructure —
[12](/architecture/bastion-runbook). The rest of the list is still to write:

1. Provision/retry/cleanup a tenant.
2. Rotate: Zitadel service-account key, Infisical identity, LiveKit key
   (rolling: add new key, switch broker, remove old; the broker and router
   re-read `/platform/livekit` every 10 minutes, so no restart is needed but the
   switch takes up to that long), RustFS key, webhook secret (the router caches
   it up to 5 minutes).
3. Add a Postgres shard; relocate a tenant.
4. Restore a tenant from backup; erase a tenant (with certificate).
5. LiveKit node failure; broker failure; Zitadel outage behavior.
6. Coolify token rotation and host recovery; the break-glass paths above
   (drill them: lose an MFA device and get back in).
7. Upgrade rings for go-meet, Tuwunel, Zitadel, LiveKit.
8. Pulumi: a stuck stack lock (cleared by the job holding the tenant
   singleton), a lost passphrase (the state is unreadable and the stack is
   recreated from the registry) and a passphrase rotation (an export/import
   batch job per stack).

## Security checklists

**Per release (go-meet / CP):** dependency + image scan, migration review,
OpenAPI diff, contract tests (go-meet has Django-compat contract tests),
secret scanning, SBOM.

**Per new tenant:** probes pass; MFA enforced for tenant admins; SSO test
login before enforcing; retention policy confirmed; export path verified.

**Quarterly:** access review of Infisical identities and Coolify tokens;
restore drill; key rotation; pen-test scope review.
