Threat model
Security and threat model
A lightweight STRIDE review of the platform. It covers what is worth protecting, where trust changes hands, the control for each threat, and the honest residual risk.
1. What we protect
| Asset | Why it matters | Sensitivity |
|---|---|---|
| App databases (family app, games, self-discovery tests) | Personal data, including family photos and notes | High |
| Backups | 14 days of everything above | High, so they're encrypted |
| Deploy path (CI keys, deploy scripts) | Whoever controls it controls what's served | High |
| Android signing keys | Used to publish updates to children's apps | High, never in Git |
| Domain and TLS | Users' trust that they're on the real site | Medium |
| Local-first app data | Stays on users' devices; never reaches the server | Out of scope by design (ADR 005) |
2. Trust boundaries
- Internet → edge: only ports 80 and 443 (Traefik) and SSH are open. Port 80 only redirects to HTTPS. Containers are exposed only when they opt in with labels, and the Traefik dashboard is turned off.
- Edge → app: each app runs in its own Compose network, so Traefik reaches only the web container.
- App → database: each database sits on its app's private network with no published port. The only other thing that can reach it is the backup container.
- CI → host: SSH with keys locked to a single command per app (ADR 002).
- AI agent → production: the agent is an unprivileged user that changes production only through Git (ADR 009).
- Host → offsite: the host sends out only ciphertext, and it can't decrypt its own backups (ADR 003).
3. STRIDE analysis
| Threat | Example | Control in place | Residual risk |
|---|---|---|---|
| Spoofing | A fake site, or a stolen CI identity, deploys code | HTTPS everywhere with automatic certificates; SSH key-only (no passwords); CI keys locked to one command | Low. Root login is still allowed with a key; see gaps |
| Tampering | Hand edits on the server, or a modified build | Every deploy runs git reset --hard origin/main; read-only deploy keys; builds from source in Docker | Medium. Base images use :latest tags and aren't signed or scanned |
| Repudiation | "Who changed this?" | Every change is a Git commit; key setup is logged to syslog; Actions keeps run history | Low |
| Information disclosure | Database leak; backup leak; XSS stealing data | No published DB ports; encrypted backups; strict CSP and security headers on static apps; local-first data; no third-party trackers | Medium. Some app secrets sit in env files in private repos; see gaps |
| Denial of service | Traffic flood; one app starving the others | Low-cost static sites; Traefik in front | Medium-high. No rate limits, CDN or per-container memory limits yet |
| Elevation of privilege | Compromised app or proxy → host root | Unprivileged agent user; sudo limited to two validated scripts; containers don't run in privileged mode | Medium. Traefik can reach the Docker socket (read-only mount, but the API itself isn't restricted) |
4. AI-specific threats
Because an AI coding agent works on this platform, the model includes threats specific to it:
| Threat | Control |
|---|---|
| Prompt injection from a web page, dependency or file makes the agent run harmful commands | The agent has no root and no write access to live apps; production changes need Git and the pipeline; destructive actions need human approval |
| The agent leaks secrets into code or commits | Signing keys and the backup decryption key live outside any repo, or offline; repos are private (moving secrets out of repos entirely is on the roadmap) |
| The agent ships plausible but wrong code | Automated tests, emulator CI for the Android apps, a health-checked deploy, and Git revert. Pull-request gating is planned |
The highest residual risks: secrets in Git, the Docker socket, no image scanning, no rate limiting, and root SSH login. Each one is on the gaps and roadmap page with its planned fix.