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.
Immutable, verified node OS
Section titled “Immutable, verified node OS”Every Linux node runs the same cluster-agnostic image:
- Read-only, dm-verity checked: the Nix store sits on a read-only
erofspartition verified block-by-block bydm-verityagainst a root hash embedded in the signed kernel image (UKI). Tampered blocks fail as I/O errors, and/is atmpfswiped 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:
machinedrenders service configs from the signed node config into/run/anastroand reconciles them every 10 seconds.
Secure Boot and TPM-sealed /var
Section titled “Secure Boot and TPM-sealed /var”/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.
Signed configs and releases
Section titled “Signed configs and releases”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 writingSHA256SUMS.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.
Network boundaries
Section titled “Network boundaries”- Zero public API listeners:
apidbinds loopback only; Postgres (5432), Patroni (8008),etcd(2379/2380), relays (3340), and Garage (3901/3903) accept connections only fromnetwork.private.cidr(Ports). - Pinned iroh endpoints: clients authenticate nodes by cryptographic
node_idover 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).
apidrefreshes 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: HAetcdpeers authenticate with per-member mTLS certificates managed viasecrets.age(etcdpeer certificates).
Secrets at rest and in transit
Section titled “Secrets at rest and in transit”| 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.
secretdkeepssecrets/kekin locked memory (no core dumps, database-only network). Revealing a secret requirescluster:adminon 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.
Machine isolation
Section titled “Machine isolation”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.
Scoped, short-lived machine credentials
Section titled “Scoped, short-lived machine 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.
Authorization
Section titled “Authorization”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 intoapi/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 enabledcluster:adminis always preserved. - Origin-bound local UI:
anastroctl uiand native apps serve on random.localhostorigins with ephemeral ports and no server-side cookies; signing out clears live state across all tabs.
Audit logging
Section titled “Audit logging”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.
Converged nodes
Section titled “Converged nodes”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.