Docs menu ▾
Genos · How Genos works / updated 2026-11-09

One rule, checked by the kernel

Genos records the server's baseline at install. From then on the kernel refuses any change in a protected place that the baseline doesn't allow, before it happens, and reports it as a ticket.

The whole rule
1. Is the folder protected? No: allow. Almost every file stops here
2. A new name: is it in the baseline? Yes: allow. It was there at install, or an admin approved it
3. A change to a file there? Only if an admin approved that name. A file from the install scan stays exactly as it was
4. Otherwise Refuse it (Operation not permitted) and report it. Nothing changes

No signature, model or indicator, and nothing to tune: the kernel applies the server's own baseline the same way to a known tool and to one written a minute ago. An EDR recognises behaviour and hands the result to an analyst (the difference).

Every way to change a protected place is checked before it happens:

Operation Looks like Kernel hook
Create Write a new file; make a FIFO, socket or device node inode_create, inode_mknod
Rename in Write it elsewhere, then move it in inode_rename
Hard link in Link existing content in inode_link
Symlink in Point a new name anywhere inode_symlink
Write Overwrite, append, truncate, move a file over it, or write through a descriptor opened earlier file_open, file_permission, inode_setattr, inode_rename
Change its attributes chmod or chown it, backdate it, set an extended attribute or an ACL inode_setattr, inode_setxattr, inode_removexattr, inode_set_acl, inode_remove_acl
Run what no package owns Execute, or map as code, a file in /tmp, /var/tmp, /dev/shm, a home folder, /run, any tmpfs or memory, or any file dpkg didn't install; or map it as data and make it executable afterwards bprm_check_security, mmap_file, file_mprotect
Load code into the kernel Load a module from anywhere but the module tree, or from memory kernel_read_file, kernel_load_data
Unlock a read-only filesystem Remount a filesystem that is read-only sb_remount
Weaken a kernel setting Write ptrace scope, kptr_restrict, dmesg_restrict, modules_disabled, core_pattern, suid_dumpable, SELinux enforce or lockdown file_open
Open a new door Listen on a TCP port the install scan didn't see socket_listen
Take over a user's agent Connect, as root, to a socket a login user owns unix_stream_connect
Delete Remove it, or move it out (to plant it again) inode_unlink, inode_rename
Swap the folder Move or mount over it, or a folder above it inode_rename, inode_rmdir, sb_mount, move_mount

A scan file is locked by what it is, not its path: no new hard link to it, no write through one. Six rules hold host-wide, in folders the scan never listed. No file gains setuid, setgid or a capability (chmod, setcap, install, cp -p) outside an approved package install. A module loads only from the module tree, never from memory, and a read-only filesystem stays read-only; both block from the start. Nothing runs from a writable place or that no package owns, the listed kernel settings stay as they are, no new port listens and root doesn't reach a login user's socket; these report first and block once a fleet sets them to. Mounts inside a service's own mount namespace (systemd's sandboxing) change nothing the server sees and are allowed unless they would propagate back.

Genos guards itself the same way. Its checks are pinned in the kernel and stay loaded when the service stops; detaching, unpinning, unmounting the BPF filesystem, writing its maps and changing its program are refused. Only a reboot unloads them, and the service starts before cron, SSH or any login.

The life of a baseline

  1. 1Scanonce, at installWork out which places to protect from the catalog and record the files in them. This is version 1.
  2. 2Lock inevery bootLoad it into the kernel and pin it there; prove the hooks block.
  3. 3Blockeach attemptA name not in it: refused, and reported.
  4. 4Decidean adminApprove adds that one name. Dismiss keeps it out.
  5. 5Undoany timeRevoke one name, or restore the install scan.

One baseline per server, never rewritten. The install scan stays exactly as recorded. Approving adds one name on top of it; revoking takes that name back out; restoring takes them all out. Each change is the next version: after one approval the server is on version 2 ("Install scan + 1 approved").

Every decision is signed. The server sends the host one signed update per decision, down a connection the host opened itself. The host checks the signature, and that it raised this ticket, before it changes anything. Nothing else from the server can change a host.

The rest of this page follows a baseline through its first four steps. Deciding and undoing are in Tickets and decisions; the memory-level view of one block is in Inside one block, at the end.

1. Scan

flowchart LR
  catalog["Catalog<br/>78 threat vectors"] --> scan
  host["Server at install"] --> scan["Scanner<br/>metadata only"]
  scan --> b["baseline.json<br/>scan hashes"]
  scan --> e["enforcement.json<br/>names in every protected place"]
  scan -.->|full report, once| fleet["Fleet server"]
  classDef genos fill:#1c1917,stroke:#fb923c,stroke-width:2px,color:#fed7aa
  class scan,e genos

The scanner reads metadata only, never file contents. It checks the places on the system listed in the catalog of 78 Linux threat vectors, and records each one it finds. Two hashes, canonical_hash and entities_digest, fingerprint the scan record so the daemon can confirm its two files belong to the same scan. They play no part in detecting deviations: that's a name lookup in the kernel (step 3).

It writes two small records on the host, then uploads the full report once:

File Holds
/var/lib/genos-inventory/baseline.json The scan's hashes. While it exists, the scanner won't run again
/var/lib/genos-inventory/enforcement.json The baseline the kernel enforces: each protected folder's device, inode and file names

2. Lock in

flowchart LR
  b["baseline.json"] --> check{"Records match?<br/>Folders unchanged?<br/>Names valid?"}
  e["enforcement.json"] --> check
  check -- "no" --> stop["Refuse to start"]
  check -- "yes" --> load["Baseline into<br/>kernel memory"] --> hooks["30 hooks on, pinned"] --> fixed["Enforcing"]
  classDef genos fill:#1c1917,stroke:#fb923c,stroke-width:2px,color:#fed7aa
  classDef deny fill:#1c1917,stroke:#f87171,color:#fecaca
  class load,hooks,fixed genos
  class stop deny

When the daemon starts, it checks before it enforces:

  1. Both records carry the same hashes.
  2. Each protected folder is still the one the scan saw: same device, same inode, not a symlink.
  3. Every name is valid, and there are at most 16,384 of them in at most 2,048 folders.

If any check fails, the daemon refuses to start. If they all pass, it loads the baseline into kernel memory, switches on its twenty-eight kernel hooks and pins them, proves they block (the self-test), and only then reports itself ready. On a restart it finds the hooks still pinned and reuses them, with the baseline they hold.

From here on, the baseline changes in exactly one way: a signed approval of a ticket this host raised (Tickets and decisions). Nothing else on the host or from the server adds a name.

3. Block

The hooks above run inside the kernel (BPF LSM). For a new name, each hook makes the same two lookups, which take microseconds and read no file contents:

flowchart LR
  op["New name in a folder<br/>create · rename · link · symlink"] --> p{"Protected<br/>folder?"}
  p -- "no" --> a1["Allow"]
  p -- "yes" --> n{"Name in the<br/>baseline?"}
  n -- "yes" --> a2["Allow"]
  n -- "no" --> d["Deviation: block (EPERM)<br/>the file never exists"]
  classDef genos fill:#1c1917,stroke:#fb923c,stroke-width:2px,color:#fed7aa
  classDef deny fill:#1c1917,stroke:#f87171,stroke-width:2px,color:#fecaca
  classDef quiet fill:#0a0a0a,stroke:#404040,color:#a3a3a3
  class p,n genos
  class d deny
  class a1,a2 quiet

A blocked file never exists. The scanner chooses the folders from the catalog (every cron and systemd folder and the folders inside them, PAM, start-up scripts, AppArmor and SELinux policy, each account's keys and crontab, and single files such as /etc/crontab, /etc/sudoers, /etc/passwd, /etc/group and /etc/ld.so.preload). Four of them show why one new name matters:

Folder One new file there means
/etc/sudoers.d Instant root, no password
/etc/cron.d Code runs as root on a schedule
/etc/systemd/system A service that comes back on every boot
/root/.ssh A new key: remote root access

4. Report

The daemon never decides anything. It sleeps until the kernel wakes it with a blocked deviation attempt, then sends it to the server straight away. Reporting blocks needs no timer and no polling. Separately, the daemon holds one connection open to the server, which approvals come down (Tickets and decisions).

sequenceDiagram
  participant K as Kernel
  participant D as Daemon
  participant F as Fleet server
  participant A as Admin
  K->>K: Block the deviation
  K->>D: File, plus who: pid, login user, process
  D->>D: Add path and parents from /proc
  D->>F: Signed report, straight away
  F->>A: Ticket: Privilege Escalation, alice → root via sudo

The ticket that opens, and what it shows, are in Tickets and decisions. Every report is signed with a key that never leaves the host, so the server can tell it's genuine and not a replay. See the API reference.

Baselines on the dashboard

The scanner uploads its baseline before the host has a key, so the upload isn't signed. The dashboard shows it as Recorded. If you set an expected hash for a host in the server config and the upload differs, it shows Mismatch (how).

Inside one block

alice, acting as root through sudo, tries to plant /etc/sudoers.d/99-alice. Her request crosses into the kernel, Genos's hook refuses it before the file exists, and the event comes back up to the daemon.

One blocked write, drawn across user space and kernel space memory, with ten numbered steps

Step by step

The numbers match the markers in the drawing.

# What happens
1 tee asks the kernel to create the file
2 The kernel finds the folder; normal permissions say yes (she's root)
3 Before anything is created, the security hook runs Genos's program
4 It reads the folder's inode number, at offset +64 on this kernel
5 The folder is one the plan protects
6 {folder, "99-alice"} isn't in the baseline
7 It records who: logged in as alice (1000), acting as root (0)
8 It refuses. tee gets Operation not permitted; no file is made
9 The event is already in the daemon's memory; the daemon wakes
10 The daemon signs and sends it; a ticket opens: Privilege Escalation

Reading the drawing

  • User space (ring 3) is where tee and the daemon run, each in its own memory. Kernel space (ring 0) is one memory shared by every process; tee's own thread crosses into it at the system call.
  • PROTECTED maps a folder (its device and inode) to "protected". ALLOWED holds every {folder, name} in the baseline: names from the install scan, plus names an admin approved (nightly-backup here).
  • EVENTS is a 64 KiB ring buffer the kernel writes a 360-byte event into only when it refuses. The daemon has it mapped read-only, so the event is in its memory the moment the hook returns.
  • The blue offsets are where kernel 7.3 keeps each field. The daemon reads them from the running kernel's BTF at start-up; on 6.8, i_ino is at +80 instead.

The hook runs in microseconds and reads no file contents: two map lookups and, only on a refusal, one event. The function-by-function view is in the kernel enforcer.

View this page on GitHub ↗