Security

Threat model

What Ant protects, from whom, and which risks are accepted.

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

AssetWhere it livesWhy it matters
Account key~/.ant/identity, mode 0600; the portable bundle is passphrase-encryptedThe key is the identity: it signs invites and authorizes the roster on every machine
Machine identity~/.ant/worker/agent-identity on the machine, 0600The NodeID the machine is dialed by; proves the machine is the one registered
Roster and invitesmachine agent-state.json, 0600; mirrored client-sideDecides who may read, deploy, and administer a machine
Secretsnever stored by Ant; resolved at deploy time from the operator's environment or a from: providerBecome container environment variables; docker inspect shows them at runtime
Imagesbuilt on the machine or pulled from a registryWhat actually executes; signature verification is opt-in (deploy.image_signing)
Audit logmachine ~/.ant/worker/audit.log, hash-chainedTamper-evident record of privileged RPCs; reading it needs the admin role
Deploy history and config~/.ant/config.json, ~/.ant/deployments.json, ant.yaml, all 0600What was deployed where, and how routing is configured

Actors

ActorHoldsCan
Ownerowner role on a machineEverything, including ownership transfer and state.import
Adminadmin roleEverything except ownership transfer; countersigns an owner election (a signed, single-use consent the daemon verifies)
Deployerdeployer roleRead, deploy, roll back, open tunnels, remove volumes; root-equivalent on the machine
cia ci-role account on one machineRead and deploy; no roster, audit, or OS accounts
CI bota 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
Viewerviewer roleRead containers, logs, metrics, tools, and swarm state
Relay and address-lookup operatorn0's public services by default, or a self-hosted relayObserve NodeIDs, IP addresses, timing, and volume; resolve NodeIDs; never payloads
Network attackeran on-path position or a scannerMITM attempts, traffic analysis, denial of service
Local usera shell on the operator's workstationWhatever the signed-in account can do, including the loopback dashboard
Compromised host rootroot on a machineEverything 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 ui binds 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

ScenarioMitigationResidual risk
A stolen account key or credential bundleThe 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 rosterA 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 NodeIDMutual 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 bandA 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 recordedThe 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 documentAnt 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 warningAnyone who can deploy must hold the values; docker inspect shows runtime values; there is no rotation tracking
DNS rebinding or CSRF against the dashboardLoopback bind with a Host allow-list; a same-site guard rejects cross-site state-changing requests (GET included); JSON bodies are capped at 8 MiBAny local user or process can reach the loopback dashboard; there is no auth to stop them
Shadowing or hijacking another app's domainroute.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 allowlistA deployer controls their own routes and can reach any listener inside their container's network
Relay or address-lookup surveillancePayloads are encrypted end to end; the relay carries ciphertext only; a self-hosted relay keeps n0 off the data pathMetadata (NodeIDs, IPs, timing, volume; lookup queries) remains visible; a hostile lookup can deny service or return stale endpoints
Roster tampering on the machineState 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 regeneratedRoot 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 replayThe 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 insteadA leaked token is redeemable by anyone until it expires or is revoked; use short TTLs
An on-path network attackerMutual TLS with NodeID verification; no plaintext leaves a peerTraffic analysis and denial of service remain possible
Another local user on a shared workstationNone beyond file permissions: the dashboard is loopback-only and unauthenticated by designAccepted; 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:

RefusedAllowed
The worker's state/identity dir and its ancestorsAny other host path (/etc, /srv, another user's home)
The docker socket, /run, /var/runnetwork: 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.

Copyright © 2026