Skip to main content

Security enforcement

All enforcement follows the same rule: observe first, enforce under a lease, never persist. Turn a feature on, watch what it would have blocked, then enforce for a bounded time.

Policies​

Create policies per host or fleet-wide from Platform → Security. Kinds:

KindBlocks
deny_ip, deny_portTraffic to an address, CIDR or port
tc_allow, allow_portEverything except an allowlist (VM interfaces only)
deny_process, deny_file, deny_capExec of a binary, opening a path, a capability
deny_dnsResolution of a name
rate_limitNew connections per VM above a rate (100/s, 50/s burst 200)

Fleet policies are scoped to the whole fleet, one host, one VM or one cgroup.

Host protection​

  • DDoS shield — per-source token buckets at XDP for SYN, UDP, ICMP and other traffic, with allow and deny CIDRs. Audit counts what it would drop.
  • Node isolation — an emergency switch that cuts a host off except for an allowlist (SSH and Machina's own ports by default). It has its own lease of at most 15 minutes and refuses to arm without SSH or an exempt address.

VM protection​

  • VM edge — isolation groups and per-VM bandwidth / packet-rate limits on the VM's tap.
  • QEMU sandbox — restricts which devices QEMU may open and where QEMU's own sockets may connect (loopback, migration and NBD ports).
  • VMM guard — BPF-LSM hooks that flag or block unexpected exec, W+X memory and device opens by QEMU. Enforce requires BPF-LSM enabled in the kernel (lsm=...,bpf); otherwise it stays in audit.

Inside guests, see Guest policy.

Leases​

FeatureLease
Policies, shield, VM edge, QEMU sandboxShared enforcement lease (default 900 s, MACHINA_BPF_ENFORCE_LEASE_SECS)
Node isolation10–900 s, mandatory
VMM guard, scheduler, guest policy1–3600 s

When a lease ends the kernel stops dropping by itself.