Repository navigation
Security Model
This page covers what HiddenForge protects, how, and where the protection stops. If you're relying on this for something that matters, read the limits at the bottom as carefully as the features at the top.
The core promise is network-layer location privacy: nobody who watches the connection, and nobody who connects to your service, should be able to learn where your server is. Everything below serves that goal, plus keeping the container itself hard to break out of if your app is compromised.
Your app runs on an internal-only network. It has no route to the internet and publishes no ports, so it can't be scanned or connected to from outside. The only thing that can reach it is Tor, running alongside it. Even if someone knew your app existed, they'd have nowhere to knock.
By default the container starts as root, only to hand the key folder to the tor user and write the config. Tor, the upload watcher and the guard monitors then run as the unprivileged tor user (uid 100) with no capabilities at all. The supervisor (PID 1) stays root but keeps at most three capabilities (two with the shipped Podman file), enough to publish the address file and start tor-user children, and it holds no CAP_KILL; the measured set is CapEff 0xc2 under Docker and 0xc0 under rootless Podman. If you can hand the key folder to uid 100 yourself, hiddenforge setup --no-root starts the container as uid 100 with no capabilities, and nothing ever runs as root.
Tor's own seccomp sandbox (Sandbox 1) filters the system calls it's allowed to make, so a Tor exploit has far less room to move. It stacks on top of the container runtime's default seccomp profile, which stays on: the kernel applies both filters and the stricter answer wins, measured working on Docker and on rootless Podman. Do not add seccomp=unconfined; 2.0.4's compose files set it, and 2.1.0 removed it.
On top of that, Landlock (a Linux kernel feature, applied by HiddenForge itself) limits which files each process can touch. The supervisor confines itself after start-up, and every helper it starts gets a stricter domain of its own with TCP denied. A helper whose domain cannot be built is not started, rather than started under the wider one. On a kernel without Landlock the container logs one line and carries on with the other layers. No HiddenForge process can dump core or be attached with ptrace, so a crash cannot write key material to disk.
There is no shell, package manager, interpreter or setuid file in the image. On top of Docker's minimal static base it holds Tor, the libraries Tor links, one small Rust binary and the mkp224o vanity generator. Someone who gets code execution in the container finds no tools to build on. One extra name, su-exec, exists only because compose files already on operators' hosts declare the healthcheck with it; it runs that healthcheck and nothing else. The image is built from Docker's Hardened Images static base and scanned with two scanners at every severity.
- Read-only filesystem. The container can't write anywhere except a few small in-memory scratch areas, and those are marked no-execute, no-setuid, no-device.
- All Linux capabilities dropped, then only the few needed are added back (to fix key-folder ownership and to drop privileges): five in the Docker file, three in the Podman file. The supervisor gives up all but three after start-up (two under the Podman file), and the processes facing the network keep none.
- No new privileges. A setuid binary inside the container can't be used to escalate.
-
No swap. Memory and swap limits are set equal, so the container's memory can't be paged to disk and your keys never touch storage as swap.
hiddenforge doctormeasures this inside the running container rather than trusting the compose file. - Resource caps. Memory, CPU, process count, and open-file limits are bounded, so a fork bomb or memory blowup is contained.
-
Podman caveat.
podman-composesilently ignoresmemswap_limit(every version) andpids_limit(before 1.1). Docker Compose run against the rootless Podman socket applies both (only the Compose binary is needed, not the Docker engine); the README's Podman section has the exact commands, andhiddenforge doctorconfirms what was really applied. - No host logs. Docker is told to write no log file for the container, matching Tor's own "avoid disk writes" setting.
- No DNS leaves the container. Your backend's name still resolves on the internal network, but a name the container runtime can't answer (for example, a backend that is down) is never passed on to your host's DNS provider, where its timing would line up with your onion's outages. Tor itself needs no DNS.
- It will never become a relay or exit node (
ClientOnly, plus an exit policy that rejects everything). It won't carry other people's traffic. - The SOCKS proxy is off. This is a publisher, not a way to route your own browsing.
- Logs are scrubbed of IPs and addresses, debugger attachment is blocked, and heartbeat log spam is off.
Onion services are a target for denial-of-service floods. HiddenForge enables two independent defenses per service:
- Proof-of-work, which makes attackers burn CPU to reach the rendezvous stage under load.
- Intro-point rate limiting, which throttles the flood of introduction requests at a different choke point.
It also caps streams per circuit and drops circuits that overrun.
Every Tor circuit starts at a small set of guard relays. An attacker who can figure out which guards your long-lived service uses has taken a step toward locating the server. The Vanguards defences address this. In HiddenForge two of them run natively (ported from the Vanguards addon, which is no longer in the image): bandguards (which watches for bandwidth side-channel attacks) and rendguard (which watches for rendezvous-point abuse), alongside Tor's own built-in "vanguards-lite" guard rotation, which is pinned on so a consensus parameter cannot switch it off.
These are off by default and you turn each on yourself:
-
Client authorization (
hiddenforge client-auth). The service descriptor is encrypted to your authorized clients' keys, so the address alone no longer reaches the service. -
Key encryption at rest (
hiddenforge setup --encrypt-keys). The service key on the volume is sealed with AES-256-GCM and decrypted into RAM at each start. It protects a volume, disk or backup taken while the service is stopped. It does not protect a running host, or a passphrase stored beside the volume. -
Full vanguards (
HIDDENFORGE_VANGUARDS=full). See the limits below.
Being clear about what this does not do is part of the security model.
-
Guard protection is L2-level by default, not full L2+L3. Pinning the deeper guard layers needs a Tor command that Tor's sandbox blocks, so by default HiddenForge leaves it off and relies on Tor's built-in vanguards-lite. Vanguards-lite is aimed at shorter-lived services and doesn't save its guard choices to disk, so the deeper topology resets when Tor restarts. If you run a long-lived, high-risk service that needs L2+L3 guard protection, set
HIDDENFORGE_VANGUARDS=fulltogether withTOR_SANDBOX=0. That pins 3 layer-2 and 8 layer-3 guards and keeps them across restarts on the key volume. The cost is Tor's own seccomp filter: the engine's profile, Landlock and the capability drop still apply, but the second, Tor-specific filter goes. The container refuses to start withfulland the sandbox on. -
The guard monitors can be absent for a while. If they crash, they are restarted; if they keep crashing, they are paused for 10 minutes and then tried again, never given up on. Meanwhile your service keeps running on vanguards-lite alone. That's degraded protection, not none, and the container reports itself not ready for as long as it lasts.
-
It does not protect your application. A bug in your web app that leaks an internal IP, a real name, or an EXIF-tagged photo will deanonymize you no matter how good the network layer is. See OPSEC: Mistakes That Deanonymize You.
-
It does not protect a compromised host. If the machine running the container is owned, the game is over. HiddenForge hardens the container, not the box under it.
-
It does not beat a global passive adversary. An attacker who can watch traffic entering and leaving the whole Tor network at once can, in principle, correlate timing end to end. That's a limit of Tor itself, not of HiddenForge.
-
The release is signed by one key. 3.0.0 carries an ML-DSA-65 signature only; there is no hardware-held (SSH-FIDO2) signature, so
hiddenforge verify-imageneeds--allow-pq-onlyand reportscomplete: false. The signing key is a file on the maintainer's workstation, so anyone who copies it can sign as the maintainer. That is why the reproducible build matters: rebuild the tagged source and compare the digest instead of relying on the signature alone. -
Commits are not signed. Only tagged, signed releases are meant to be run.
-
There is a vendor in the chain. The base image and Tor's libraries are Docker's builds of Alpine packages. HiddenForge pins them by digest and checks them before adopting a new one, but a reproducible build proves nothing about a base that was malicious when it was signed.
-
Not fuzzed, fault-injected or soak-tested. The runtime has unit, differential, mutation and live end-to-end tests; see
docs/PRODUCTION-READINESS.mdin the repository for what was and was not tested.
You don't have to take any of this on faith. The release digest is signed, and the build is reproducible, takes its inputs from a locked, signature-checked archive and gives no build step network access, so you can confirm the thing you're running is the thing described here. See Verifying the Image.
Start here
Older releases
Going deeper
- The Security Model
- Verifying the Image
- Reproducing the Build
- The hiddenforge CLI
- Rootless Podman
- Backing Up Your Onion Address
- Upgrading Safely
- Running Multiple Services
Help