Skip to content

Security model

Anastro’s security model, layer by layer, as built today. For the full long-term design, start at The OS image in the spec.

Every Linux node runs the same cluster-agnostic image:

  • Read-only, dm-verity checked: the Nix store sits on a read-only erofs partition verified block-by-block by dm-verity against a root hash embedded in the signed kernel image (UKI). Tampered blocks fail as I/O errors, and / is a tmpfs wiped on every reboot.
  • No login surface: no SSH daemon, no sudo, no package manager, and no writable Nix. The console prints the maintenance ticket over a passwordless-disabled prompt. All management happens over the authenticated node API.
  • Continuous config enforcement: machined renders service configs from the signed node config into /run/anastro and reconciles them every 10 seconds.

/var (config, keys, sealed secrets, Postgres) is LUKS2-encrypted with a single TPM-sealed slot—no passphrase and no recovery key, so every node requires a TPM 2.0.

Binding What it enforces
PCR 7 Secure Boot is active with your enrolled PK, KEK, db, and dbx
PCR 11 (signed policy) The booted UKI was signed by your image’s PCR key
epoch Raising anastro.image.epoch reseals /var on boot so older-epoch images can never unlock it again
generation Every public release increments anastro.image.generation; nodes reject anything not strictly newer than both the running image and the highest blessed release on disk

If the TPM changes, or a firmware/dbx update alters PCR 7, /var stays locked—reinstall the node and let it rejoin from peers or backups. Production nodes require node.boot.secure_boot = true and fail health checks (rolling back) if Secure Boot or PCR 7 + PCR 11 sealing is missing.

Nodes only accept configs and OS releases signed by an Ed25519 operator key listed in their current cluster.operator_keys:

  • Every config is signed for one specific node, pinned to its iroh endpoint ID, and timestamped so older configs cannot be replayed.
  • anastroctl cluster release sign <dir> independently verifies the UKI’s architecture, Authenticode signature, db.crt, .pcrsig, canonical format-3 generation metadata, and all manifest hashes before writing SHA256SUMS.sig. Nodes repeat every check against their baked-in trust anchors before writing the spare slot. Private-key storage and release signing are supported on Linux and macOS only (other platforms fail closed).
  • Operator keys are admins of the node API (--as-operator) without needing Postgres, and are limited to listing and draining hosts on the cluster API.
  • Zero public API listeners: apid binds loopback only; Postgres (5432), Patroni (8008), etcd (2379/2380), relays (3340), and Garage (3901/3903) accept connections only from network.private.cidr (Ports).
  • Pinned iroh endpoints: clients authenticate nodes by cryptographic node_id over end-to-end encrypted QUIC, never trusting IP addresses or relay URLs.
  • Allowlisted peers only: nodes drop unknown peers right after the QUIC handshake (and relays only forward enrolled peers). apid refreshes the enrolled list from Postgres every 2 seconds, cutting off revoked devices within seconds. Public iroh relays and discovery are never used.
  • Mutual TLS for etcd: HA etcd peers authenticate with per-member mTLS certificates managed via secrets.age (etcd peer certificates).
Layer Protection
secrets.age Age-encrypted operator bundle in git holding pre-Postgres cluster secrets
Node disk (/var) Only the secrets that node’s config needs, TPM-sealed via systemd-creds and unsealed into root-only tmpfs at boot
Node services Injected as per-service systemd credentials
Cluster secret store Encrypted rows in Postgres (per-value data keys wrapped by secrets/kek with XChaCha20-Poly1305); Postgres and backups see only ciphertext
  • Nodes missing required secrets stay sealed (node API only). Sealed control-plane nodes can unseal from peers only when presenting an operator-signed config pinned to their own endpoint ID.
  • secretd keeps secrets/kek in locked memory (no core dumps, database-only network). Revealing a secret requires cluster:admin on a recently signed-in device and is audited.
  • Non-bootstrap secrets in the cluster store can deliver directly to service consumers with serialized restarts (Deliver store secrets to services).
  • Worker-only nodes hold no cluster secrets—only short-lived, scoped grants from the control plane.

Linux machines run as Cloud Hypervisor microVMs under unprivileged, sandboxed systemd units in workloads.slice with read-only guest root images.

Host nftables rules restrict each Linux machine to the public internet only—blocking traffic to:

  • other machines and the host itself (beyond replies to host-initiated traffic),
  • private, CGNAT, link-local, multicast, and reserved IP ranges (including the cluster LAN),
  • any non-default route on the host (LAN, VPNs, static routes), and
  • spoofed source MACs/IPs and all IPv6.

Web traffic (TCP 80/443) passes through anastro-egress, which logs SNI/hostnames and inspects npm, PyPI, crates.io, Go, RubyGems, and Maven Central using a per-machine registry-constrained CA (Package firewall). A machine’s only paths to the control plane are two host-served vsock ports for git credentials and (when opted in) the inference gateway.

GPU/USB passthrough requires dedicated workers with whole IOMMU groups bound to VFIO. Device-backed machines can’t live-move or save VM memory.

Workstation mounts enforce the user’s live project roles and grants; writable takeover stops the machine, waits for a Portable checkpoint, and guarantees single-writer ownership. Snapshot pins and org key shredding require human credentials.

Integration What reaches the machine
GitHub Single-repo installation token (read or write matching the acting user’s role), valid ≤1 hour, held in memory by hostagent—never written to /workspace
Inference Nothing by default. When both cluster and project opt in, a machine-bound gateway token scoped to model endpoints only—provider keys never leave the control plane
1Password secrets Injected into env vars or snapshot-excluded files; invalidated on binding/role changes; values scrubbed from output (including base64 and URL-encoded forms) before reaching the agent or UI

Machine tokens are revoked automatically on spin-down, destroy, restore, attach/detach, owner change, or loss of edit access.

Every request on every transport runs through a single gate: authenticate the caller, resolve the target resource’s org and project, and evaluate Cedar policies.

Scope Roles
Cluster cluster:admin, cluster:operator, cluster:viewer
Org owner, admin, member, viewer
Project owner, editor, viewer
  • Deny by default: every OpenAPI operation must declare x-roles (compiled into api/policies/); unannotated endpoints fail the build. Org owners and admins automatically act as project owners.
  • Hand-written guardrails: sensitive actions require a human device key, service accounts can’t mint keys, and API keys can’t mint new credentials.
  • Acting-as enforcement: threads and machines inherit the acting user’s permissions, can never approve their own actions or manage users/devices, and pause immediately with fenced credentials if that user loses project access. MCP and connector calls re-check live project roles on every request.
  • Instant disable: disabling a user (anastroctl users disable) immediately drops their open connections, invalidates devices and API keys, and pauses their threads. At least one enabled cluster:admin is always preserved.
  • Origin-bound local UI: anastroctl ui and native apps serve on random .localhost origins with ephemeral ports and no server-side cookies; signing out clears live state across all tabs.

Every mutating request, every refused authenticated request, and every membership, key, token, or secret event is logged with caller, credential type, acting-as user, operation, resource, decision, and request ID. Inspect logs in Ops → Audit or via anastroctl org audit and anastroctl cluster audit.

Running controlplane and worker on the same box means a VM escape reaches Postgres and cluster secrets in memory. Keep untrusted workloads on dedicated worker-only nodes; once dedicated workers exist, converged nodes automatically carry the controlplane:trusted-only taint.