Threat model
This page names what Ant protects, who the actors are, where the trust boundaries sit, and which attack paths are mitigated versus accepted. The mechanisms behind it are in the Security model; the deferred gaps are tracked in Known issues.
Assets
| Asset | Where it lives | Why it matters |
|---|---|---|
| Account key | ~/.ant/identity, mode 0600; the portable bundle is passphrase-encrypted | The key is the identity: it signs invites and authorizes the roster on every machine |
| Machine identity | ~/.ant/worker/agent-identity on the machine, 0600 | The NodeID the machine is dialed by; proves the machine is the one registered |
| Roster and invites | machine agent-state.json, 0600; mirrored client-side | Decides who may read, deploy, and administer a machine |
| Secrets | never stored by Ant; resolved at deploy time from the operator's environment or a from: provider | Become container environment variables; docker inspect shows them at runtime |
| Images | built on the machine or pulled from a registry | What actually executes; signature verification is opt-in (deploy.image_signing) |
| Audit log | machine ~/.ant/worker/audit.log, hash-chained | Tamper-evident record of privileged RPCs; reading it needs the admin role |
| Deploy history and config | ~/.ant/config.json, ~/.ant/deployments.json, ant.yaml, all 0600 | What was deployed where, and how routing is configured |
Actors
| Actor | Holds | Can |
|---|---|---|
| Owner | owner role on a machine | Everything, including ownership transfer and state.import |
| Admin | admin role | Everything except ownership transfer; countersigns an owner election (a signed, single-use consent the daemon verifies) |
| Deployer | deployer role | Read, deploy, roll back, open tunnels, remove volumes; root-equivalent on the machine |
ci | a ci-role account on one machine | Read and deploy; no roster, audit, or OS accounts |
| CI bot | a pipeline holding a ci membership (expiring, or OIDC-issued) | Deploy from a pipeline; the bundle, when used, is a long-lived account key, so prefer an expiring grant or workload identity |
| Viewer | viewer role | Read containers, logs, metrics, tools, and swarm state |
| Relay and address-lookup operator | n0's public services by default, or a self-hosted relay | Observe NodeIDs, IP addresses, timing, and volume; resolve NodeIDs; never payloads |
| Network attacker | an on-path position or a scanner | MITM attempts, traffic analysis, denial of service |
| Local user | a shell on the operator's workstation | Whatever the signed-in account can do, including the loopback dashboard |
| Compromised host root | root on a machine | Everything on that machine, including the worker's state and the audit log |
The local machine has exactly one user, the signed-in account; multiple users exist only on remote machines, through colony rosters and invites. See Colony & users.
Trust boundaries
- The loopback dashboard.
ant uibinds loopback and has no authentication there. It is one dashboard per operator, reading that operator's own~/.ant; it is never hosted and has no multi-user mode. The trust boundary is the local account: any local user or process that can reach the loopback port can perform the same mutations. - iroh mutual TLS. Every remote call runs over QUIC + TLS 1.3 with both sides proving possession of their key, and the bound endpoint id is checked against the NodeID. The transport authenticates the channel; it does not decide what a caller may do.
- Daemon authorization. The worker resolves the caller's NodeID against its roster and enforces a method → capability table; with no roster and no boot owner it fails closed. This is the line between "can talk" and "may act".
- Relay ciphertext-only. A relay forwards encrypted bytes: it can observe NodeIDs, addresses, and timing/volume, but not payloads. The address-lookup service sees which NodeIDs are resolved and from where. A self-hosted relay takes n0 off the data path; lookup still uses the default DNS service.
Attack paths and mitigations
| Scenario | Mitigation | Residual risk |
|---|---|---|
| A stolen account key or credential bundle | The bundle is passphrase-encrypted by default (PBKDF2-HMAC-SHA256, 210k iterations, AES-256-GCM), and load re-checks the key against the profile NodeID; memberships can expire (--expires-in / --grant-ttl), CI can join by OIDC without a stored key, and the member can be removed from every roster | A bundle with no expiry stays valid until removed from each machine; an expired grant still leaves the account key itself usable elsewhere (Known issues) |
| A rogue endpoint claims a machine's NodeID | Mutual TLS proves key possession; the endpoint id is checked against the NodeID; registration pins first contact, ant nest machines verify records it, and a different NodeID is refused; invites pin the machine NodeID out of band | A machine first added by hostname is trusted on first contact; verify explicitly |
| An unauthorized RPC (wrong or missing role) | Per-method capability table enforced server-side; fail closed without a roster or boot owner; role re-checked against the state being mutated; expired memberships authorize nothing; denied calls are recorded | The owner is unconstrained; an admin can countersign an owner election for a candidate of its choosing, so treat the role as sensitive |
A malicious deploy from deployer or ci (arbitrary image, mounts, host networking) | Deploy guards refuse the state/identity directory and its ancestors, the docker socket and /run//var/run, the host root /, privileged: true, host devices:, volumes_from:, volume driver_opts:, and include:/extends: {file: …} in a resolved document (in a no-build bundle they are resolved on the machine and the result is re-guarded); names and image refs are validated, -- precedes image refs, nothing runs through a shell, and tunnels resolve only to ports Ant published on loopback | "Allowed" means allowed: any other host path, host networking, and arbitrary Dockerfiles reach the machine; deployer/ci are root-equivalent by design (in group mode the worker is in the docker group; in rootless mode it controls its unix user and NodeID key) |
| Secret exfiltration through config, argv, or a stored compose document | Ant stores no secret values; values resolve at deploy time and reach the container through the docker process environment (compose: a 0600 secrets.env), never argv or a persisted file; provider failures log only a warning | Anyone who can deploy must hold the values; docker inspect shows runtime values; there is no rotation tracking |
| DNS rebinding or CSRF against the dashboard | Loopback bind with a Host allow-list; a same-site guard rejects cross-site state-changing requests (GET included); JSON bodies are capped at 8 MiB | Any local user or process can reach the loopback dashboard; there is no auth to stop them |
| Shadowing or hijacking another app's domain | route.apply accepts only valid hostnames and loopback upstreams, rejects a host (or host+path) already routed by another app, and verifies the upstream port against the named container's published ports; the Caddy admin API carries an origin allowlist | A deployer controls their own routes and can reach any listener inside their container's network |
| Relay or address-lookup surveillance | Payloads are encrypted end to end; the relay carries ciphertext only; a self-hosted relay keeps n0 off the data path | Metadata (NodeIDs, IPs, timing, volume; lookup queries) remains visible; a hostile lookup can deny service or return stale endpoints |
| Roster tampering on the machine | State files are 0600; the audit log is hash-chained with segments linked to their predecessor; clients anchor the chain head and refuse a gated call when the anchored entry vanished inside the retained window; a webhook can mirror every entry off-host; reading it needs admin; state.import is owner-only; a corrupt machine identity is kept, not regenerated | Root can edit state and delete the log; off-host shipping is a single best-effort webhook, not a collector; an old anchor can fall out of retention by design and is treated as rotation |
| Invite theft or replay | The invite is signed, bound to the machine NodeID, role, and expiry; redemption is server-side and checks the signature, expiry, inviter's current role, the grant matrix, and an unused nonce; a leaked token is revocable; --grant-ttl bounds the resulting membership; OIDC jobs join with provider-signed tokens instead | A leaked token is redeemable by anyone until it expires or is revoked; use short TTLs |
| An on-path network attacker | Mutual TLS with NodeID verification; no plaintext leaves a peer | Traffic analysis and denial of service remain possible |
| Another local user on a shared workstation | None beyond file permissions: the dashboard is loopback-only and unauthenticated by design | Accepted; treat a shared workstation as trusted, or run ant ui only while attended |
Deploy guards at a glance
Reused from the Security model, checked on the worker for every run target:
| Refused | Allowed |
|---|---|
| The worker's state/identity dir and its ancestors | Any other host path (/etc, /srv, another user's home) |
The docker socket, /run, /var/run | network: host / network_mode: host |
The host root / | cap_add, pid: host, security_opt, user, sysctls, ipc/uts/cgroup in compose and stack files |
privileged: true, host devices: (compose/stack) | Named volumes, by name |
volumes_from:, volume driver_opts:, include:, extends: {file: …} | Project-relative mounts in a compose file (for example .:/app) |
The list is a denylist for Ant's own secrets, not a sandbox: deployer and
ci are machine-level trust, as with any Docker-based deploy tool. The full
matrix, including which rows are "not expressible" per run target, is in the
Security model.
Explicitly out of scope
- A compromised host root. Root on a machine owns its state directory, the audit log, and the Docker engine. Some tampering is detectable, none is preventable from inside.
- A compromised Docker engine (or the docker group). Container execution is not sandboxed; the guards keep Ant's secrets out of a deploy, not a determined container out of the host.
- Supply chain beyond the pins. iroh is a vendored binding, pinned by version with committed static libraries; releases are checksum-verified but not code-signed, and image signature verification is opt-in. A vulnerability in a pinned dependency or a signed-off binary is outside this model.
- Lost account keys. There is no account recovery service. An owner can be
re-seeded only with operator access to the machine
(
ant colony recover --add-owner).
See the Security model for the mechanisms and Known issues for the accepted gaps and their paths forward.