Holdbay threat model, v1
Status: v1.1. v1 was written at the end of phase 0 (foundations), 2026-11-24. v1.1 (2026-11-26) adds boundaries B10 (smart import, spec F17) and B11 (AI assistants over MCP, spec F19), adversary A10, and threats T23 to T27. It also adds B12, A11 and T28 to T33 for Backup Vault, designed in backup-vault.md, T34 for the holdbay.dev module path, and T35 and T36 for Cloudflare and cloud-provider tokens (spec K9, K10). Most controls below are designed but not yet built. Each row says whether its control is implemented or planned, and which phase it lands in.
Method: threats come from three sources:
- the trust boundaries of the architecture in blueprint.md
- the STRIDE categories
- the bug classes behind real 2024–2026 advisories in comparable panels: Coolify, Dokploy, Portainer, Dokku and 1Panel
A threat class that has already hit a competitor is treated as expected, not hypothetical.
This document must be updated whenever the architecture changes, and reviewed by a third party before 1.0.
1. What we protect
| Asset | Why it matters |
|---|---|
| Root on every managed server | Holdbay runs containers there; compromise means the whole fleet |
| User data in database add-ons and backups | Our core promise is that data cannot quietly disappear |
| Secrets: env vars, DB credentials, API and registry tokens | Leaks spread to systems outside Holdbay |
| Control-plane state DB and master key | Holds every org, secret envelope and node identity |
| Panel accounts and API tokens | The front door to everything above |
| Release signing identity and build pipeline | One poisoned release hits every install |
2. Adversaries
| Adversary | Capability |
|---|---|
| A1 Internet attacker | Can reach the panel, the proxy and webhooks; holds no credentials |
| A2 Member of another org | Valid login in their own tenant; wants yours |
| A3 Low-privilege member of your org | Wants admin rights or host access |
| A4 Malicious code author | Controls a repo, Dockerfile, compose file or pull request that Holdbay builds |
| A5 Compromised app container | Code execution inside one workload |
| A6 Compromised node | Root on one managed server, including its agent |
| A7 Network attacker | On the path between agent and control plane |
| A8 Supply-chain attacker | Can tamper with a dependency, a CI action or a release artifact |
| A9 Attacker on hosted control plane | Future Holdbay Cloud only: breaches our hosted service |
| A10 Steered AI agent | An AI assistant the user connected over MCP. It holds a token the user granted and can be steered by any content it reads: logs, commit messages, issue text, app output |
| A11 Holdbay insider or Vault infrastructure attacker | Future Backup Vault only: staff, or someone who breaches the Vault service or its storage provider |
3. Trust boundaries
Browser/CLI ──(B1: HTTPS, session/token)──► Control plane ◄──(B2: mTLS, agent dials out)── Agent ──(B3)──► Docker Engine
│ │
Git host ──(B4: signed webhook)──────────────────┘ ├──(B5)──► Builder sandbox (rootless BuildKit)
│
Internet ──(B6: HTTPS)──► Proxy ──► App containers ──(B7: container isolation)──► Host kernel │
└──(B8)──► Backup storage (local / S3)
CI (GitHub Actions) ──(B9: OIDC-signed release)──► Users' servers (installer / self-update)
Control plane ──(B10: import session, platform token or SSH)──► Other platforms (Heroku, Render, Railway) and old servers (Coolify, Dokploy, Portainer)
AI client (Claude Code, Cursor, …) ──(B11: MCP over HTTPS, OAuth, scoped)──► Control plane
Agent ──(B12: client-side encrypted, write-only, short-lived credentials)──► Backup Vault (locked object storage)
4. Threats and controls
Status legend:
- ✅ Implemented (with tests)
- 🟡 Partial
- ⏳ Planned (the target phase is listed in the row)
| ID | Boundary | Threat (STRIDE) | Who | Control | Status |
|---|---|---|---|---|---|
| T1 | B3 | Command injection through shell strings built from names, URLs or healthchecks (E). This is the #1 CVE class in comparable panels. | A2, A3, A4 | No shell, ever. internal/safeexec is the only process launcher: argv only, allow-listed binaries pinned to absolute paths, shells and interpreters refused. The noshell analyzer fails CI on os/exec or os.StartProcess/syscall.Exec anywhere else. |
✅ |
| T2 | B3, B5 | Option injection: a value such as --upload-pack=… read as a flag (E) |
A3, A4 | internal/validate allow-lists every identifier (DNS label, domain, git ref, env key) and rejects a leading -. Callers put -- before user values. Fuzz tests cover both rules. |
✅ |
| T3 | B1 | Cross-tenant IDOR: reading or changing another org's objects by ID (I, T) | A2 | Repositories take an unforgeable tenant.Scope and filter org_id in SQL. The zero scope is rejected (default deny). Another tenant's object returns ErrNotFound, indistinguishable from "missing". TestTenantIsolation runs every scoped method cross-tenant. TestIsolationCoverage fails the build when a new scoped method has no cross-tenant test. Both were mutation-tested. |
✅ |
| T4 | B1 | Authorization bypass via WebSocket, terminal or streaming routes outside the middleware (E) | A2, A3 | One authorization middleware wraps HTTP, WebSocket, SSE and terminal routes alike; routes cannot be registered outside it | ⏳ P1 |
| T5 | B1 | Default or hard-coded secrets: JWT signing keys, DB passwords (S, E) | A1 | Every key is generated with a CSPRNG at server init. The server refuses to start if any is missing. No fallback values exist in code. |
⏳ P1 |
| T6 | B2 | Stolen host credentials from the panel DB, such as root SSH keys (E) | A1–A3 | The control plane stores no SSH keys. Agents run locally and dial out. Nothing in the panel DB grants host root by itself. | ⏳ P1/P2 (by design) |
| T7 | B2 | Agent impersonation or MITM (S, T) | A6, A7 | mTLS with an internal CA pinned on both sides, short-lived per-node certificates with SPIFFE-style IDs, one-time join tokens. InsecureSkipVerify is banned by a lint. The agent re-validates every RPC argument instead of trusting the control plane. |
⏳ P1 |
| T8 | B5 | Malicious build: Dockerfile, #syntax frontend or compose escaping to the host (E) |
A4 | Ephemeral rootless BuildKit with no docker.sock, no host mounts and no production secrets. Allow-listed #syntax frontends. Compose is parsed and re-rendered from an allow-list (no privileged, host binds, use_api_socket, volumes_from or host network). |
⏳ P1 |
| T9 | B4, B5 | Preview-deploy secret theft from fork pull requests (I) | A4 | Previews are off by default. When on, they never receive production secrets, and fork PRs need manual approval. | ⏳ P2 |
| T10 | B7 | Container escape (E) | A5 | Hardened defaults: non-root, no-new-privileges, all capabilities dropped, default seccomp/AppArmor, read-only rootfs where possible. The agent refuses runc/Docker versions below a patched minimum. gVisor runtime class comes later. |
⏳ P1 (gVisor P3) |
| T11 | B1–B3 | Secret leakage via logs, notifications, error messages, rollback snapshots, docker inspect or inherited env (I) |
A2, A3, A5 | Child processes never inherit the control plane's environment (✅ in safeexec, tested). Still to build: write-only secret API, redaction by matching actual secret values rather than regex, just-in-time delivery, tmpfs mounts where possible, BuildKit secret mounts (never ARG). |
🟡 |
| T12 | B4 | Webhook forgery or replay triggering deploys (S) | A1 | A random per-app secret is required, and empty secrets are rejected. hmac.Equal comparison. Delivery-ID replay cache. |
⏳ P1 |
| T13 | B1 | SSRF through "test connection", S3 endpoints or template URLs (I) | A2, A3 | A single outbound HTTP client that blocks private, link-local and metadata ranges after DNS resolution and re-checks every redirect | ⏳ P1 |
| T14 | B1 | CSRF, host-header poisoning and token abuse (S, T) | A1, A3 | No state change over GET. CSRF tokens. A fixed canonical base URL for links and emails. Passkeys/WebAuthn and TOTP. API tokens that are scoped, expiring and revoked when a member is removed. Rate limits that ignore spoofable headers. | ⏳ P1 |
| T15 | B1 | First-run takeover of a fresh, uninitialized instance (S, E) | A1 | Setup requires a one-time token printed to the server console; the setup endpoint is closed once used | ⏳ P1 |
| T16 | — | Data loss from a failed upgrade (D) | — | Migrations run one transaction each. A pre-upgrade VACUUM INTO snapshot is written whenever data exists. The binary refuses a schema newer than itself. All three behaviours are tested. Self-update with automatic rollback comes later. |
✅ (self-update P1) |
| T17 | — | State DB disclosure on the control-plane host (I) | A5, A6 | Data dir 0700 and DB files 0600, tested ✅. Envelope encryption of secrets with the master key kept outside the DB (age file, KMS or TPM) is planned for P1. |
🟡 |
| T18 | B9 | Tampered release (T) | A8 | Releases are drafts until a human publishes them. They carry a keyless cosign signature over the checksums, SLSA build provenance and an SBOM per archive. Workflows run with least privilege and use actions pinned to commit SHAs. govulncheck gates every release. The self-updater will verify signatures before swapping binaries. |
✅ pipeline config (not yet exercised on GitHub); updater P1 |
| T19 | B9 | Malicious dependency (T, E) | A8 | Minimal dependencies (stdlib, modernc.org/sqlite, x/tools for lint only), go.sum pinning, govulncheck in CI. Automated dependency PRs that require review are planned. |
🟡 |
| T20 | — | Audit-log tampering to hide an intrusion (R) | A3, A6 | Append-only, hash-chained audit log covering auth, secret access, terminals and deploys | ⏳ P1 |
| T21 | B3 | Resource exhaustion through child-process output or hangs (D) | A4, A5 | safeexec caps captured output per stream and enforces timeouts with a kill. Tested. |
✅ |
| T22 | B2 | Compromised hosted control plane pushing malicious commands to customer nodes (E) | A9 | Agents accept only typed, schema-validated RPCs and never arbitrary commands. Agent-side policy rejects privileged or host-mount specs even when the control plane sends them. Customers can revoke a node's trust in the control plane locally. | ⏳ P4 |
| T23 | B10 | Leaked third-party credentials from an import: a Heroku, Render or Railway token, or SSH access to an old server, ends up in logs, the DB or a backup (I) | A1, A3, A5 | Credentials live in memory only for one import session (max 1 hour) and are never persisted. Value-based redaction (T11) covers logs, errors, audit and notifications. The audit log records the event, not the value. The UI asks for the narrowest scope (for example a read-only Heroku authorization that expires in 1 hour) and reminds the user to revoke afterwards. | ⏳ P1 |
| T24 | B10 | SSH to the old server abused: MITM on first connect, or commands beyond what import needs (S, T, E) | A4, A7 | Host key shown and confirmed on first connect; a changed key blocks the session. Only a fixed allow-list of read and dump commands runs, built as argv with validated identifiers (container names, volume paths) and quoted for the remote side; no free shell string, consistent with T1. A dedicated user with only the needed access is suggested. No SSH key is stored afterwards (T6 still holds). | ⏳ P1 |
| T25 | B10 | Hostile source config: a compromised platform account or repo serves a render.yaml, compose file or app spec designed to escape or to smuggle privileged settings (E) |
A4 | Source files are untrusted input: parsed, allow-listed and re-rendered exactly like compose in T8. The migration report lists every mapped setting before Apply, and nothing applies without the user's review. Images still go through the normal pull and signature policy. | ⏳ P1 |
| T26 | B11 | Prompt injection through data an AI agent reads: log lines, commit messages or app output steer a connected agent into deleting, restoring over, or reconfiguring something (T, E) | A4, A5, A10 | Tools are read-only unless the user grants more. Destructive or irreversible tools (delete, restore that replaces data, env and domain changes, disabling backups) never run directly: they create a pending action the user approves in the panel with a passkey, showing exactly what will happen. Tool output that contains user or app content is marked as untrusted data. Secret values are never returned (T11). Per-client rate limits. | ⏳ P1 |
| T27 | B11 | Stolen or over-scoped MCP access used to act as the user (S, E) | A1, A10 | The MCP endpoint is off until enabled. OAuth 2.1 with PKCE and a consent screen per client that lists scopes and projects; short-lived access tokens, refresh tokens revocable per client; the same authorization middleware as the API (T4). Every action is audited as "client, on behalf of user". | ⏳ P1 |
| T28 | B12 | Ransomware deletes the offsite backups too: an attacker with root on the user's server uses its Vault access to delete, overwrite or shorten retention (T, D) | A5, A6 | Servers only get short-lived credentials that can add and read, never delete or change retention. Objects are locked in compliance mode until retention ends. Pruning is done by the Vault service after expiry. A CI test tries all three with the server's own credentials and must fail. | ⏳ Vault launch |
| T29 | B12 | Vault or Cloud breach, or an insider, reads customer data (I) | A9, A11 | Encryption on the user's server (restic, WAL-G libsodium) with a key that never reaches Holdbay; optional escrow is passphrase-encrypted. Vault runs on infrastructure, credentials and pipelines separate from Cloud. Staff use hardware keys, have no standing production access, and every access is logged append-only. | ⏳ Vault launch |
| T30 | B12 | Silent loss, rollback or corruption of stored backups by the provider or an attacker (T) | A11 | Each run writes a manifest signed by the server's key and chained to the previous one, checked on every list and restore. Vault-side scrubbing, plus weekly restore tests from the Vault on the user's server. | ⏳ Vault launch |
| T31 | B1, B12 | Weakening protection through a taken-over account or a compromised control plane: shortening retention, swapping the key, turning the Vault off (T, E) | A1, A9 | Passkey re-authentication, a 7-day delay with email and in-panel notice to every admin, cancelable. Existing locks are never shortened. Key changes are done on the user's server, not by the control plane. | ⏳ Vault launch |
| T32 | B12 | Cross-tenant access to another organization's backups (I, T) | A2 | A separate storage prefix and credentials per organization, issued for minutes and only to a server that proves its identity with its agent certificate (T7). Tenant-isolation tests like T3. | ⏳ Vault launch |
| T33 | — | Key loss makes backups unrecoverable (D) | — | The recovery kit cannot be skipped. Optional passphrase escrow. Restore without Holdbay using the kit and standard tools is tested in CI. The UI states plainly that a lost key cannot be reset. | ⏳ Vault launch |
| T34 | B9 | Hijacked module path: whoever controls holdbay.dev (registrar, DNS or the site's go-import page) can point Go at a malicious repository for new downloads (T) |
A8 | The Go checksum database pins every published version's content on first fetch. Registrar lock, auto-renew, hardware-key 2FA on registrar and DNS, DNSSEC. The meta-tag page is reviewed like code. Release binaries come from CI and are signed (T18), so they do not depend on the module path. Details in module-path.md. | ⏳ before the first beta |
| T35 | B1, B10 | Misused Cloudflare API token (DNS, Tunnel, later Workers): a stolen or over-scoped token lets an attacker repoint the user's domains, hijack traffic or publish code on their account (S, T) | A1, A3, A5 | The UI asks for the narrowest permissions (for example DNS edit on the chosen zones only) and refuses account-wide tokens where a scoped one works. Stored as an encrypted secret (F8), never shown again, redacted everywhere (T11). Every API call Holdbay makes with it is audited. Revoking it in Holdbay deletes it at once; the UI shows how to revoke it at Cloudflare too. | ⏳ P2 |
| T36 | B1, B10 | Misused cloud-provider token for automatic server creation: an attacker creates servers on the user's bill, deletes servers, or reads data from them (S, T, D) | A1, A3, A5 | Narrowest token the provider allows; stored encrypted (F8), never shown again. Holdbay only creates and configures servers it was asked to, shows the price and asks for confirmation before creating anything billed, and never deletes a server without a typed confirmation. Every call is audited, and alerts fire on servers Holdbay did not expect. | ⏳ P2 |
5. Assumptions and accepted risks (v1)
- The host OS is the user's responsibility. Holdbay warns about missing security updates but does not patch the OS.
- Docker Engine runs as root in the default install. Rootless Docker and Podman are later options. Until then, protection relies on T8 and T10 plus never exposing
docker.sockto workloads or builds. - Single admin in the MVP. Tenancy is enforced in the data layer from day one (T3), but full RBAC arrives with teams in phase 3.
- No control-plane HA. Losing the control plane stops deploys, not running apps. State is recoverable through Litestream (P1).
- Pre-alpha. No external audit has happened yet. One is planned before 1.0.
6. How this document stays honest
- Every ✅ row must point to a test that fails when the control is removed. T1 and T3 were verified this way with deliberate mutations during phase 0.
- Any security fix adds a row or tightens one, together with a regression test.
- Any new trust boundary (a new protocol, integration or runtime) requires an update here before it merges.