Security layers¶
Hindi pa naisasalin ang pahinang ito. Ang binabasa mo ay ang bersyong Ingles.
You decide how many layers protect your computer from the earners. Each layer guards against a different threat, and each one you add closes a path the others leave open.
The Fleet page shows the layers of each worker in its Security layers row. For each earner it shows the layers that the earner really got. It says whether the earner is fenced, and whether it runs under Docker's own runtime (Standard, runc) or under gVisor.
| Layer | What it guards | Default | What it costs |
|---|---|---|---|
| Socket proxy | Docker on the host, from the worker: no privileged containers, no host folders, only CashPilot's own containers | On in the shipped compose files | Nothing |
| LAN fence | Your LAN, this host, your tailnet and cloud metadata, from each earner | On for new installs. An upgraded install turns it on with one click on the Fleet page | Nothing |
| gVisor | The host's kernel, from an earner that escapes its container | Off. You install it and choose it per earner | Throughput close to Standard, and about six times the CPU for the same traffic (measured) |
| Secure VM | The host's kernel, files and passwords, your LAN and your tailnet | One command from the Fleet page, on a Linux host with KVM: The Secure VM on Linux | 580 to 810 MB of RAM and 1.6 GB of disk |
Nothing turns a layer on by itself. An upgrade offers a new layer and leaves your earners as they are.
The socket proxy¶
The worker never holds the raw Docker socket in the shipped compose files. It
talks to a proxy that refuses privileged containers, binds of / and of the
socket, and anything without CashPilot's owner label
(security defaults). The Fleet page shows Socket
proxy: off for a worker that holds the raw socket, as the TrueNAS listing and
an Unraid worker installed before the proxy template still do.
The LAN fence¶
An earner on CashPilot's own network, cashpilot-isolated, sits behind
firewall rules that let it reach the internet and nothing else
(network isolation). The fence covers only the earners on that
network. On an upgraded install, an earner that was stopped when you turned
isolation on stays on Docker's default bridge, and starting it does not move
it: it is fenced only once you redeploy it
(upgraded installs).
Each earner shows fenced or not fenced, so check each one.
gVisor¶
gVisor runs each earner against a kernel written in user space, so a kernel bug an earner exploits hits gVisor, not your host. It needs root on the host to install, which the worker does not have and must not get. So the Fleet page gives you one command to run on the host.
- Install. Open the worker's Security layers row and copy the install
command. It downloads the helper from this repository at your release's tag
and checks its sha256 before it runs anything with
sudo. The helper shows what it will change and asks before it does. It installs a pinned gVisor release, checked by sha512, in its own folder, and registers two runtimes in/etc/docker/daemon.jsonafter a backup. Docker reloads its settings, so your running containers keep running. If the reload does not pick the runtimes up, the helper asks you again before it restarts Docker, and says that a restart stops every container on the host, CashPilot's and any others. - Check. Press Check gVisor. The worker starts a short probe under each gVisor runtime, on the earners' network. Green needs gVisor's own kernel and a working name lookup. Red says which one failed.
- Choose. Set Runtime for earners you deploy here from now on, or press Run under gVisor on one earner. A running earner is redeployed at once, and the page asks first.
- Undo. If a worker variable (
CASHPILOT_CONTAINER_RUNTIMEorCASHPILOT_CONTAINER_RUNTIME_OVERRIDES) pins gVisor, the page locks the choice, so start there: remove the variable from the worker's compose file and recreate the worker with that file named:docker compose -f docker-compose.worker.yml up -d, ordocker compose -f docker-compose.fleet.yml up -don the main server. Compose reads those files only when you name them. A Quick Start install that has onlydocker-compose.ymlusesdocker compose up -d. Then switch every earner back to Standard. If Runtime for earners you deploy here from now on says gVisor, set it to Standard too. Then run the remove command. It restoresdaemon.json, deletes gVisor and its backup, reloads Docker and checks that nothing is left. It refuses while any container, running or stopped, still uses a gVisor runtime. Switching a stopped earner saves the choice only, so redeploy or remove each stopped one first. After the remove, an earner still set to gVisor is not redeployed, and while the worker's default still says gVisor no new earner is deployed. The page says why, and nothing is stopped or removed.
A copy routed through one of your proxies runs under Standard: it shares the proxy's network, and gVisor is not offered there yet. An earner you set to gVisor is therefore not routed. Set it back to Standard first.
If an install stops halfway, for example because the connection dropped, run
the remove command before you install again. It puts daemon.json back from
the backup. The helper stops, and says why, whenever Docker does not answer or
daemon.json cannot be read, so it never guesses.
Some earners cannot run under gVisor. The Fleet page locks their choice and says why:
- Mysterium needs
iptables-nftand kernel WireGuard, which gVisor does not have. - GPU miners need the GPU, which gVisor cannot pass in.
- Bitping needs raw sockets. It gets the gVisor runtime registered with
--net-raw, so it can run under gVisor.
An environment variable on the worker wins over the page:
CASHPILOT_CONTAINER_RUNTIME sets the runtime of every bridge-networked earner,
and CASHPILOT_CONTAINER_RUNTIME_OVERRIDES sets it per earner. The page shows
the choice locked and names the variable.
gVisor cannot run on Unraid at all, and Docker Desktop already runs every container in a VM. The helper refuses both and says why.
The Secure VM¶
A Secure VM runs the earners in a fenced VM on the same host, so an escape lands in the VM, not on your computer. The VM reaches the UI and the internet and nothing else. On a Linux host with KVM, the Fleet page shows the command that adds it, and the commands that check and remove it. It also shows the VM's fence and its last self-test, with a button that asks the host for a new one. How it works, what it needs and what it costs: The Secure VM on Linux.