Docs menu ▾
Genos · Architecture / updated 2026-11-09

Three parts on each server

A scanner that runs once, a daemon that always runs, twenty-eight checks in the kernel. This page is how they fit and what each file on the host is for; each part has its own page: the scanner, the kernel enforcer, the daemon. The operator's view is How Genos works; the wire protocol, the API reference.

From the scan to the kernel, and back

Once, at install

  1. 1ScanscannerReads metadata only, never file contents. Chooses the places to protect from the catalog and records what's in them.
  2. 2RecordscannerWrites the baseline once; it can't be rescanned. Uploads the report.
  3. 3CheckdaemonThe records must match and each folder must still be the one scanned.
  4. 4ProvedaemonLoads the hooks for this exact kernel, then proves they block.
  5. 5ProtectdaemonSwitches the protected places on. Only then does it report ready.

Every time a file is added to a protected folder

  1. 1CheckkernelIs the folder protected? Is the name in the baseline? Two lookups, microseconds.
  2. 2RefusekernelNot in it: Operation not permitted. The file never exists.
  3. 3ReportdaemonWoken by the kernel; adds who and how; sends it signed over pinned HTTPS.
  4. 4TicketdashboardOne ticket per file per server, labelled with its family.
  5. 5ApplydaemonA signed approval or revoke comes back down the host's own connection.
What could go wrong What happens
The kernel lays out its memory differently Genos reads the layout from the running kernel; if it can't, it doesn't start
The hooks don't block on this kernel The self-test fails and Genos refuses to run
Our server is unreachable Blocking carries on. The host reconnects on its own
A forged or mismatched decision arrives The host refuses it and says why; nothing changes
Genos is stopped Blocking carries on: the hooks are pinned in the kernel. Reporting stops until it restarts; the blocks made meanwhile wait in the kernel's buffer

Every failure path is below.

The parts

flowchart LR
  subgraph Host
    S[Scanner<br/>scanner.sh + genos.phase0<br/>runs once at install]
    F[(Files in<br/>/var/lib/genos-inventory)]
    D[Daemon<br/>genos-daemon<br/>root, systemd]
    K[Kernel enforcer<br/>28 BPF-LSM hooks<br/>pinned in /sys/fs/bpf/genos]
  end
  FS[Fleet server<br/>genossec.com]
  S -- writes baseline.json<br/>enforcement.json --> F
  S -- POST /baseline --> FS
  F -- read at start --> D
  D -- fills maps, attaches hooks --> K
  K -- block events, ring buffer --> D
  D -- POST /v1/events --> FS
  FS -- additions, removals,<br/>health checks<br/>down /v1/stream --> D
Part Language Runs Job
Scanner Bash + Python 3 (stdlib) Once, at install, as root Records the host's metadata baseline, the names in every place the enforcement plan protects, and the listening ports
Daemon Rust (aya) From early boot, as root (genos-daemon.service) Loads and pins the hooks with the baseline, reports blocks, applies signed changes
Kernel enforcer Rust compiled to BPF Inside the kernel, on every change to a name or file in a protected folder, on exec, module loads, remounts, setting writes, listens and unix connects, and on the operations that could switch it off Allows a new name only if it is in the baseline, a change only if an admin approved that name; applies the host-wide rules; refuses folder swaps and tampering. Stays loaded when the daemon stops

The protected places come from the enforcement plan (scanner/genos/phase0/enforce_plan.py): the catalog's locations for the covered families, per host, as trees, folders guarded by name and names that must not appear. The demo's four: /etc/sudoers.d, /etc/cron.d, /etc/systemd/system, /root/.ssh.

Files on the host

File Written by Read by Holds
/var/lib/genos-inventory/baseline.json Scanner, once (O_EXCL) Scanner (refuses to rescan), daemon Scan identity: canonical_hash, entities_digest, versions, time
/var/lib/genos-inventory/enforcement.json Scanner, once (O_EXCL) Daemon Per protected folder: path, device, inode, kind (tree or names), names (scanned), unscanned (present but not scanned), absent (watched for), its tree's root; ports, the TCP ports listening at the scan; and actors, the programs that may change a place (or listen on a scan port) where anyone else is refused, each by path, device and inode
/var/lib/genos-inventory/baseline-state.json Daemon Daemon The baseline as the daemon holds it after package transactions and watched folders made since: the next versions of the scan's lists, and each allowed program's file as a package transaction last left it
/var/lib/genos-inventory/baseline-additions.json Daemon Daemon Approved names in force (each with its approver signature) and removals since
/var/lib/genos-inventory/rule-modes.json Daemon Daemon Each rule's mode (watch or block) in force, signed and versioned by the server
/var/lib/genos-inventory/raised-tickets.json Daemon Daemon Tickets this host raised: ref -> (folder, name)
/var/lib/genos-inventory/agent_state.json Daemon Daemon agent_id, last sequence number
/etc/genos/agent.toml Installer Daemon Server URL, SPKI pin, one-time enrollment token
/etc/genos/agent.ed25519 Installer Daemon The host's private signing key
/etc/genos/approver-ed25519.pub Installer Daemon Public key every addition and removal must be signed by
/sys/fs/bpf/genos/ Daemon Kernel, daemon The pinned maps and hook links. In memory: gone at reboot. Only the daemon may unpin them

The baseline in force is enforcement.json (v1, never rewritten), the state since, and the additions. The daemon merges them into the kernel maps at start; the kernel sees only the merge.

What happens when something fails

Failure Result
Kernel field offset can't be placed (required) Daemon doesn't start; nothing is loaded
Self-test: an operation isn't blocked or reported, or something that should work is refused Daemon exits; the host is reported as not protected by the installer
enforcement.json doesn't match baseline.json, or a folder was replaced Daemon doesn't start
Fleet server unreachable Hooks still block. A report whose send fails is logged and dropped (the sender thread doesn't retry), so that block never opens a ticket; a send that only stalls (packets dropped, no reset) completes when the network returns. The stream reconnects with backoff
Stream sends a forged or mismatched addition/removal Rejected with a reason; nothing changes
Crash between recording an addition and the kernel insert Restart reloads the record and inserts it
Crash between the kernel removal and recording it Restart reloads the old record (name allowed again); the server resends the removal until confirmed
A kernel read inside the hook fails That one operation is allowed (verdict returns 0)
Daemon stops The hooks stay pinned and keep blocking. Blocks wait in EVENTS (64 KiB, about 180 of them; past that, still refused but not reported) and are reported when it starts again
Host reboots The hooks are gone until the daemon starts, early in boot, before cron, SSH and logins

View this page on GitHub ↗