New to threat modeling? Identity, secrets and zero trust basics covers the vocabulary (tokens, least privilege, lateral movement), and Enterprise engineering habits explains why a hobby lab writes one of these at all.
Unfamiliar word or acronym? The Glossary defines it.
Security controls only make sense against named threats. This page lists what is worth protecting, who might go after it, where the trust boundaries are, what stops each threat, and what is left over and accepted on purpose.
It is a lab with a $30 budget and one operator, and the threat model is sized to that. Nation-state targeting of a hobby cloud account is out of scope; the internet's background noise, credential theft and supply-chain mistakes are very much in scope.
| Asset | Why it matters |
|---|---|
| DigitalOcean write token | Can create, destroy or open anything in the account, and run up a bill |
| Twingate API token | Can grant itself access to every resource |
| Doppler service token | Reads every secret above |
| Connector tokens | Can impersonate a connector in the tenant |
| OpenTofu state in Spacelift | Contains connector tokens and the full resource map |
| The droplets | Today: the access path. Later: workloads and a link back to the homelab |
| The operator's identity | The repo is public; account identifiers, home ranges and names stay out |
Boundary numbers are shared with Threat model exercise, step 2, which draws all eight (B1 to B8). This diagram shows only the four that matter most for the threats below, so it skips B2, B4, B5 and B6.
| # | Threat | Controls | Residual |
|---|---|---|---|
| T1 | Internet scanning, brute force, exploit of an exposed service | Zero public inbound rules (the only inbound rule of any kind is tag-scoped connector-to-connector TCP 22 inside the VPC, see T12), attached by tag at creation; connectors are outbound-only; sshd keys only, one user | None from the network side today |
| T2 | Stolen Twingate credentials | Sign-in delegated to the identity provider (enforce MFA there); access limited to one host and port per resource; SSH key still required on the host | An attacker with both the identity and the SSH key gets a shell on a connector |
| T3 | Malicious pull request steals secrets from a plan | A Spacelift push policy that never proposes a run, so no pull request's code runs in Spacelift (tested in CI; needs a paid Spacelift plan and must be attached there); on the free plan, narrow project roots and globs so only pull requests that change a stack reach it; proposed runs get no credentials anyway; branch protection; one writer | Until the policy is attached, script checks only guard honest code. Either way, anyone who can push to main is trusted |
| T4 | Leaked Doppler service token | Read-only, one config, 90-day expiry, write-only in Spacelift, masked in logs | Reads all prd secrets until revoked |
| T5 | Connector token theft from the droplet | File is root-only 0600; one token per connector, revocable | Accepted: user-data is readable by any local process via the metadata endpoint; a root-and-do-agent-only lock (metadata_lock) is built but off by default until it is rolled out and tested on a real droplet |
| T6 | Connector token theft from state | Marked sensitive; state lives only in Spacelift | Accepted: anyone who can read stack state sees it; restrict state access in Spacelift |
| T7 | Compromised GitHub Action | Every action pinned by commit SHA; permissions: {} by default; CI holds no cloud credential |
A compromised pinned commit is still trusted until the pin changes |
| T8 | Tampered Doppler CLI download | Pinned version, pinned SHA-256 per architecture, fail closed | None beyond trusting the pinned release |
| T9 | Tampered Twingate package | Repository key checked against a pinned fingerprint before being trusted; apt verifies signatures | Trusting Twingate's signing key |
| T10 | Vendor compromise (Twingate, Spacelift, Doppler) | Narrow scopes; E2E encryption to connectors; separate SSH key gate | Accepted: inherent to using hosted control planes; see Why ZTNA and not a VPN |
| T11 | Runaway bill | Cost gate allowlist; approved totals in review; billing alerts at $10 and $25 | Bandwidth overage and resources created outside the repo |
| T12 | Lateral movement between droplets | DigitalOcean firewalls filter VPC-internal traffic; only connector-to-connector SSH by tag is allowed | Workload rules in stage 3 must keep the same discipline |
| T13 | Lockout (both connectors down) | Two connectors with staggered reboots and updates | Accepted: no console password by design; recovery is rebuilding the stateless droplets through Spacelift |
| T14 | Doxxing the operator through the public repo | Account identifiers, ranges and names in Doppler; SSH key comment stripped; secret scanning in CI | Human error in a commit message or doc |
Accepting a risk is a decision, so each one is written down where a reviewer will see it:
main itself, and required reviews become mandatory first. The push policy already keeps pull requests out of Spacelift once attached.Next: Lessons learned, step 20 of the core path on the Reading order page. To build a threat model yourself, the security track starts at the Threat model exercise.