I-skip tungo sa nilalaman
I-edit ang pahinang ito

Threat model

Hindi pa naisasalin ang pahinang ito. Ang binabasa mo ay ang bersyong Ingles.

This page says what CashPilot protects, who it protects it from, and where the boundaries are. Each control links to the code that enforces it. The links point at a fixed commit, so you can read the exact lines. The security defaults page has the full detail of each control. This page is the map.

Assets

Asset Where it lives Why it matters
Provider logins, API keys and tokens The UI's database, /data/cashpilot.db, encrypted Most of these accounts hold money
The encryption key /data/.fernet_key, or a file you name with CASHPILOT_ENCRYPTION_KEY_FILE It decrypts every stored login
Wallets and node identities Earner volumes, such as Mysterium's keystore and Storj's identity No provider keeps a copy, so a lost one is gone
The host Every machine that runs a worker The Docker API is root on that machine
Your home network The LAN, the router, your tailnet, cloud metadata Earners carry strangers' traffic through your IP
The owner account The UI It can deploy, delete and read every login
Your earnings data The UI's database and /metrics Balances, box names and LAN addresses are private

Adversaries

  1. A hostile earner image. The images in the catalog are third-party and mostly closed-source. One of them can be malicious, or a provider can push a bad build under the same tag.
  2. A buyer of your bandwidth. Bandwidth-sharing services sell your IP to their customers. That traffic must reach the internet and nothing else.
  3. Someone who reaches the dashboard or the worker's API. A person on your LAN, or on the internet if you publish a port.
  4. A compromised worker. A bug in the worker, or an attacker who holds a worker's key.
  5. A compromised UI. A bug in the dashboard, or a stolen session.
  6. A dead or hostile proxy. A proxy that you route a copy through can stop, or can try to reach your LAN.

Trust boundaries

flowchart LR
  B[Browser] -->|session cookie| UI[CashPilot UI]
  UI -->|per-worker key| W[Worker]
  W -->|filtered socket| P[Socket proxy]
  P -->|calls its policy allows| D[Docker on the host]
  M[One-shot migration] -->|raw socket, at each compose up| D
  D --> E[Earner containers]
  E -->|fenced bridge| I[Internet]
  E -.->|dropped| L[LAN, host, tailnet, metadata]
  E -->|shared namespace| T[Tunnel sidecar]
  T --> X[Your proxy]
  C[Isolated copy] -->|internal network| G[Gate]
  G --> X
Boundary Between What crosses it
1 Your browser and the UI Sign-in, every page and every action
2 The UI and each worker Deploy, stop and remove commands, and heartbeats
3 The worker and Docker Every Docker API call, through the socket proxy
4 An earner and the host kernel System calls, capabilities, devices, host folders
5 An earner and the network Every packet an earner sends
6 A proxied copy and its proxy Every packet of that copy, through a tunnel sidecar, or through a gate for an isolated copy

Threats and controls

1. Browser to UI

Threat Control Enforced in
The dashboard is reachable from other machines The compose file publishes the UI on 127.0.0.1 only. You must set CASHPILOT_BIND_ADDR to open it docker-compose.yml
The first person to open /register takes the owner account The first account needs a one-time setup token. The UI prints it to its own log, so only someone with access to the host can read it app/setup_token.py, app/deps.py
Password guessing Passwords are stored as bcrypt hashes. Sign-in stops for 5 minutes after 5 attempts at one account from one IP, or 30 attempts from one IP app/auth.py, app/login_rate_limit.py
Session theft through a script on the page The session cookie is HttpOnly and SameSite=Lax. It is Secure when CASHPILOT_BASE_URL starts with https, when a trusted proxy (CASHPILOT_TRUSTED_PROXY) sends X-Forwarded-Proto: https, or when CASHPILOT_SECURE_COOKIE is on app/auth.py
Another site on the same host sends actions with your cookie The UI refuses a state-changing request whose Sec-Fetch-Site or Origin is not its own app/main.py
A stolen session or the admin API key empties a wallet Actions that cannot be undone, such as deleting a wallet volume or showing a seed, ask for the owner's password again. An API key can never give it app/deps.py
Device IDs leak to people who should not see them Alerts and logs for anyone but the owner show only the last four characters of an EarnApp or ProxyRack device ID app/notify.py
/metrics shows balances and box names Metrics are off by default. With CASHPILOT_METRICS_TOKEN set, they need a bearer token app/metrics.py

2. UI to worker

Threat Control Enforced in
Anyone with the shared key commands every worker The shared key only enrolls a worker. The UI then gives each worker its own key, and the worker refuses the shared key once its own key is confirmed app/worker_api.py
The worker's API is reachable from the network The default compose file does not publish the worker's port. The fleet and worker files publish it on 127.0.0.1 only docker-compose.yml, docker-compose.worker.yml
A worker URL makes the UI call cloud metadata or a loopback service (SSRF) The UI blocks metadata, loopback and link-local addresses. It resolves the name once, checks the address, and connects to that address app/worker_proxy.py
A key travels in clear text over the internet The UI and the worker send a key over plain HTTP only to a private address or a private name. The check reads the URL's host and does no DNS lookup, so a name under .local, .lan, .home.arpa, .internal or .ts.net passes even if it resolves to a public address app/cleartext.py
Secrets in request URLs end up in the log A log filter removes bot tokens, webhook tokens, URL passwords and API keys from every logged URL app/log_redaction.py

3. Worker to Docker

Threat Control Enforced in
Whoever holds the Docker socket is root on the host With the shipped compose files the worker has no socket. A proxy, sockguard, pinned by digest, holds the socket, has no network, and serves the worker a filtered socket. The proxy's filtering is the control. Its :ro mount is not, because a read-only bind of a Unix socket still allows the full Docker API docker-compose.yml
A compromised worker starts a privileged container or binds / The proxy reads every request body. It refuses privileged mode, host PID, IPC and user namespaces, capabilities and devices outside a short list, and any host folder you did not list docker-compose.yml
A compromised worker touches the UI or your other containers The proxy stamps an owner label on everything the worker creates, and refuses the worker everything without that label app/socket_policy.py
A compromised worker reads the encryption key The worker does not mount the UI's /data. A test fails if the two volumes are merged docker-compose.yml
An image update widens the proxy's rules The rules live in your compose file, never in an image. A test fails when a catalog change needs a rule the policy lacks, or when the policy gets looser scripts/socket_proxy_policy.py, tests/test_socket_proxy.py

4. Earner to host

Threat Control Enforced in
An earner uses kernel features it does not need Every capability is dropped. Only the ones its catalog entry declares come back. no-new-privileges and a process limit are always set, and privileged mode is fixed to off app/orchestrator.py
A deploy request asks for privileged mode or a host device The worker refuses privileged mode. It refuses any device that the service's own catalog entry does not declare app/worker_api.py
A deploy binds /etc, /var/run or another system folder System folders are blocked. You can open a specific service folder, never a whole root app/worker_api.py
An earner takes the GPU on a host whose default runtime is nvidia Every container without a catalog GPU grant gets NVIDIA_VISIBLE_DEVICES=void app/gpu.py
A custom image you add gets extra rights A custom service can carry no ports, capabilities, devices, network mode or privileged mode app/custom_services.py
An earner's password shows in docker inspect With CASHPILOT_EARNER_SECRETS=file, the worker keeps most catalog passwords out of Docker's container config app/secret_env.py
A deploy or delete destroys a wallet or node identity The worker refuses to delete a critical volume without an approval the UI signs after the owner's password check app/worker_api.py
A provider pushes a broken build under the same tag The daily image update watches each new container for 2 minutes. If it stops, restarts, turns unhealthy or logs a known failure, the worker starts the old container again, and tells you if that fails too. This does not catch a malicious build that keeps running. Images pinned by digest move only with a CashPilot release app/image_updates.py

5. Earner to network

Threat Control Enforced in
An earner, or a customer of the provider, reaches your LAN, router or other devices New installs put earners on cashpilot-isolated, behind a firewall table that drops the private ranges, Tailscale's range, link-local and the host itself app/lan_fence.py
The firewall table goes missing after a reboot or a flush The internet route (the masquerade) lives in the same table as the drops. Without the table the earners go offline, not onto the LAN. Three exceptions apply until the worker writes the table again: the host itself stays reachable, a masquerade rule of the host's own that covers the bridge lets earners out unfiltered, and one-way UDP to a LAN device still leaves (isolation) app/lan_fence.py
An earner reaches cloud metadata on a VPS 169.254.0.0/16 is one of the dropped ranges app/lan_fence.py

6. Proxied copy to proxy

Threat Control Enforced in
The proxy dies and the copy earns from your own IP A copy without NET_ADMIN, NET_RAW or a device shares the network of a tunnel sidecar whose firewall drops every packet by default. It lets out only the tunnel and the connection to the proxy. If the tunnel stops, traffic stops tunnel/cp-tunnel
A copy that holds NET_ADMIN, NET_RAW or a device such as /dev/net/tun (Mysterium, Bitping) rewrites its own firewall or sends raw packets past it That copy never shares a sidecar's namespace. It runs in cp-inner, on an internal Docker network whose only route is a gate. The gate is a sidecar that forwards the copy's traffic into the tunnel and nowhere else, from a firewall in its own namespace (isolated copies) app/proxy_tunnel.py, tunnel/cp-tunnel, tunnel/cp-inner
Traffic through the tunnel reaches your LAN or tailnet The sidecar drops private, Tailscale and link-local destinations on the tunnel too tunnel/cp-tunnel
The tunnel sidecar itself has too many rights It drops every capability except NET_ADMIN, has a read-only root, no-new-privileges and a process limit app/proxy_tunnel.py
The proxy password shows in labels or docker inspect The worker writes the proxy settings into a file in the sidecar, under /run/cashpilot-secret, never into its environment app/proxy_tunnel.py

Limits

We list the gaps so that you can decide with all the facts. The details are in security defaults.

  • The socket proxy is not yet a full root boundary in every setup. Since sockguard 2.4.10 it binds a listed host path only as itself, so a symlink planted in a listed folder leads nowhere. But when one listed path sits inside another, counting CASHPILOT_COMPOSE_DIR as listed (a path inside the compose folder, or a path that holds it), a compromised worker can replace the inner one with a symlink and reach the host's /. With both unset, no host folder can be bound.
  • The raw socket still reaches two places. The one-shot cashpilot-migrate holds it as root, with no network and every capability dropped, each time docker compose up runs. It starts before the proxy and exits (docker-compose.yml). The Unraid template and the TrueNAS app do not ship the proxy yet, so there the worker gets the raw socket (app stores).
  • A compromised worker controls its own earners. It can stop them, read their logs and environment, and delete their volumes, including the critical ones, through Docker directly.
  • A compromised worker can start a container on host networking with NET_ADMIN. That container can change the host's network settings and take an earner off the fence. The owner label does not stop it, because the LAN fence's own helper needs the same rights.
  • An isolated copy can still send DNS lookups from the box's own IP. This happens on Docker engines before 25.0.5 (23.0.11 on the 23 line), when the host's own resolver is a loopback address, such as a Pi-hole on 127.0.0.1. This is moby CVE-2024-29018. The fix is #977, which is not shipped yet.
  • The UI and a worker on one host share that host. For a stronger boundary, run the UI on a machine with no worker (fleet).
  • The encryption key sits beside the database by default. A leaked database file alone does not reveal the stored logins, but it shows your earnings data. Moving the key out protects copies of the data folder, such as backups. A compromised UI reads the key in both cases, because the UI loads it to decrypt the logins (encryption key).
  • UI to worker traffic is plain HTTP by default. Keep it on your LAN or in a VPN. Neither side sends its key over plain HTTP to a public address, but the check trusts private names such as .lan without a DNS lookup.
  • Earners share the host kernel. A kernel bug in an earner reaches the host. gVisor or the Secure VM closes this, and both are opt-in (security layers).
  • Root on the host reads everything. No control here protects against someone who is already root on a box.
  • The provider sees your traffic and your IP. CashPilot cannot change what a provider does with the connection it rents.

Tests

  • tests/test_socket_proxy.py checks the proxy policy against the catalog and fails when it gets looser. scripts/socket_proxy_live_test.sh runs the real proxy against a real Docker daemon. Each refused call passes when sent to the raw socket, which proves the refusal is the proxy's.
  • tests/test_lan_fence.py checks the firewall table. Test your isolation runs the same probes from the dashboard, on your own box.
  • tests/test_proxy_tunnel.py and tests/test_proxy_tunnel_real_docker.py check the tunnel. scripts/proxy_leak_test.sh checks that a dead proxy stops the copy.
  • tests/test_setup_token.py, tests/test_cleartext_refusal.py, tests/test_custom_services.py, tests/test_secret_env.py and tests/test_image_updates.py cover the other rows.
  • tests/test_beads_batch_69.py fails if the worker's volume and the UI's /data are merged.

To report a gap, see SECURITY.md. Do not open a public issue.