Docs menu ▾
Running the fleet server, and what goes over the wire
How the fleet server runs, and exactly what goes over the wire.
Operating the fleet server
How the fleet server runs on genossec.com, and how to update, configure and troubleshoot it.
How it's deployed
flowchart LR
net(["Internet"]) -- "HTTPS" --> nginx["nginx"]
nginx --> app["genossec.com app<br/>port 8000"]
app -- "/dashboard/, /v1/,<br/>/baseline, /install/" --> fleet["Fleet server"]
app -- "everything else" --> site["Website"]
fleet --> db[("SQLite")]
| Piece | Where |
|---|---|
| nginx | Handles HTTPS and passes everything to one app; the node stream and baseline uploads get their own settings. Routes: website/deploy/nginx-genossec.conf |
| The app | genossec.service, listening on localhost only: the website and the fleet server in one process. website/dispatch.py sends the four fleet paths to the fleet server |
| Data | /var/lib/genos-fleet/, mode 0700. The server won't start if others can read it |
Install or update
cd ~/genos/genos-server
website/deploy/reload.sh
Safe after every pull: installs dependencies, writes the fleet config if missing, checks the app
builds, installs and reloads the service and the nginx routes (rolling back if nginx -t fails),
then checks the site and the dashboard answer.
Code-only changes just need a reload:
sudo systemctl reload genossec
A reload also re-reads dashboard.env and republishes the catalog.
Configuration
/etc/genos-fleet/config.toml, owned by root. Edit it with sudo, then reload.
| Key | Default | Meaning |
|---|---|---|
db_path |
/var/lib/genos-fleet/fleet.db |
The database |
behind_proxy |
true |
Trust nginx's forwarded headers |
event_history_days |
90 |
How long blocks are kept (retention) |
enrollment_token_ttl_hours |
24 |
How long an install key is valid |
session_hours |
8 |
Dashboard session length |
scanner_path |
<repo>/genos_scanner_enforcer/scanner |
Where the catalog is built from |
health_check_mode |
"interval" |
Health checks for a newly enrolled node: "off", "manual" or "interval". The dashboard says Enforcing only from a recent answer |
health_check_interval_mins |
15 |
How often, for "interval". Each node's own setting can be changed on its page |
Expected hashes
Name the baseline you expect for a host. If its upload has a different canonical_hash, the
dashboard shows Mismatch:
[agents."web-01"] # one node, by hostname or agent_id
baseline_canonical_hash = "…"
Who can sign in
Sign-in uses Clerk. The settings are in website/dashboard/dashboard.env (git-ignored, mode 0600):
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
FLEET_OPEN_SIGNUP=1 # anyone who signs up gets in
CLERK_SECRET_KEY=sk_... # only for FLEET_ALLOWED_EMAIL_DOMAINS
FLEET_ALLOWED_EMAIL_DOMAINS=example.com # anyone with a verified address here gets in
FLEET_ADMIN_USER_IDS=user_abc...,user_def... # see every node
Each user sees their own nodes. A node belongs to whoever generated its node key: they see it,
its tickets, blocks, alerts and baseline, and only they can approve its tickets. Admins
(FLEET_ADMIN_USER_IDS) see and act on every node. With FLEET_OPEN_SIGNUP=1 and Clerk's sign-up
set to public, anyone can sign up and start with an empty fleet.
To let a team in: put their email domain in FLEET_ALLOWED_EMAIL_DOMAINS and the Clerk secret
key in CLERK_SECRET_KEY, then reload. In the Clerk dashboard, set sign-up to public and require
email verification. Anyone at that domain then signs up on the sign-in page and goes straight in;
only a verified address counts.
To add one person: have them sign in once. The page shows their user ID. Add it to
FLEET_ADMIN_USER_IDS, then reload.
Everyday tasks
Run these from ~/genos/genos-server/website/dashboard:
export FLEET_CONFIG=/etc/genos-fleet/config.toml
FLASK="../.venv/bin/flask --app fleetmon:create_app()"
| Task | Command |
|---|---|
| Add a node | Dashboard → Install, or $FLASK create-token --label <host> |
| Show the approver public key | $FLASK approver-key (the install command writes it on each host) |
| Remove a host's baseline | $FLASK remove-baseline <hostname> |
| Forget a node that is gone or being rebuilt from scratch | $FLASK remove-node <hostname> --yes (backs up first, then deletes that node's tickets, blocks, alerts, audit log and baseline) |
| Back up the database | $FLASK backup <file> |
| Trim old history now | $FLASK prune (it also runs on its own) |
| Turn health checks on for existing nodes | $FLASK set-health interval --mins 15 (all current nodes; --node <host> for one). New nodes take the config default |
| Export for a SIEM or an auditor | $FLASK export reviews > reviews.jsonl (also events, tickets, changes, alerts; --days N, --node <agent_id>) |
| Watch the logs | journalctl -u genossec -f |
Removing a host's baseline
Each host gets one baseline, and a second one is refused. When you rebuild a host:
- On the server:
$FLASK remove-baseline web-01 - On the host: delete
/var/lib/genos-inventory/baseline.json
Audit log, retention and export
Every decision made on the dashboard is recorded as it is made, in the reviews table: who (the
dashboard user), when, the kind of decision (approve, dismiss, revoke, restore, a health-check change
or request, a generated node key), the ticket or node it concerns, the reason the reviewer typed, and
the request's source address. Rows are inserted in the same transaction as the decision and are
never updated or deleted. Two commands clear them, each after backing up the database: remove-node
for one node, reset-nodes for all of them.
| Data | Table | Kept |
|---|---|---|
| Blocks (one per refused operation) | events |
event_history_days (90 by default), pruned on the server's own schedule and by flask prune |
| Tickets, in their current state | tickets |
Until the node is removed (remove-node, or reset-nodes for all) |
| Every change to a host's baseline | baseline_changes |
Until the node is removed |
| The audit log | reviews |
Until the node is removed |
| Alerts about the reports themselves | alerts |
Until the node is removed (the Alerts page shows 30 days) |
| Install baselines | host_baselines |
Until remove-baseline or remove-node |
Each of the first five can be exported as JSON Lines (one object per line, UTF-8) from the
dashboard's Audit page (GET /dashboard/export/<kind>.jsonl, optional ?days=N and
?node=<agent_id>, within the signed-in user's view of the fleet) or with flask export <kind> on
the server. The actor of a block and of a ticket comes out as an object. The format is stable and
additive: new fields may appear, existing ones keep their names.
Certificate pin
Every daemon pins genossec.com's public key. The certificate renews about every 60 days, but
certbot is set to reuse_key = True, so the key and the pin stay the same.
Don't remove reuse_key. A new key means every daemon refuses to connect, and blocks stop
reaching the dashboard without any warning. To rotate the key on purpose, roll out a second pin to
every node first.
Catalog
/dashboard/catalog serves the catalog built from the scanner's own copy (scanner_path) at startup. After
changing the catalog, reload. Its hash changes, and scanners pinned to the old hash will refuse
it until you update their pin.
Backups
Everything is in /var/lib/genos-fleet/. To copy the database while the server runs:
$FLASK backup ~/fleet-$(date +%F).db
Keep backups private: they hold host metadata. secret_key in the same folder only signs
dashboard sessions. Losing it just signs everyone out.
Troubleshooting
| Symptom | Check |
|---|---|
| "502 Bad Gateway" | systemctl status genossec, then journalctl -u genossec -n 50 |
| Sign-in loops | The Clerk key in dashboard.env is from the right Clerk app. Reload after edits |
| "Not on the allowlist" | Add the user ID shown to FLEET_ADMIN_USER_IDS, or their email domain to FLEET_ALLOWED_EMAIL_DOMAINS, then reload |
| Catalog page unavailable | Look for could not build the catalog bundle in the log |
| A node never appears | On the host: journalctl -u genos-daemon. Usually a wrong pin or a used or expired install key |
| No node reports anything | The server or nginx is down, or the certificate key changed |
| Baseline upload gets 413 | Over 32 MB compressed. Re-run website/deploy/reload.sh so nginx allows 33 MB |
API
Hosts report to https://genossec.com and hold one connection open, the
node stream. The server sends a host four kinds of message, all down that stream:
a baseline addition, a baseline removal, a rule mode, a health check.
| Endpoint | Caller | Auth |
|---|---|---|
GET /install/{key} |
Install command, once | Install key |
POST /v1/enroll |
Daemon, once | Install key |
POST /v1/events |
Daemon, each time it blocks a deviation | Signed envelope |
GET /v1/stream (WebSocket) |
Daemon, held open | Signed hello; additions, removals and rule modes by approver signature |
POST /baseline |
Scanner, once per host | None |
GET /dashboard/catalog |
Scanner | None (public data) |
Errors are JSON, {"error": "…"}:
| Status | Meaning |
|---|---|
400 |
Malformed request |
401 |
Unknown agent, bad signature or bad key |
404 |
Install key not valid |
409 |
Replay, a duplicate baseline, or an applied report with no matching approval |
413 |
Too large |
Code: server website/dashboard/fleetmon/ingest.py; clients genos-daemon/src/reporter.rs and
installer/scanner.sh.in in genos_scanner_enforcer/.
GET /install/{key}
Returns the installer script, but only for a key that exists, is unused and hasn't expired.
Anything else gets 404, so a wrong key looks the same as a used one. Fetching the script doesn't
use up the key; enrolling does.
POST /v1/enroll
Trades the install key for an agent_id, and registers the host's public key.
{
"enrollment_token": "genos_enr_…",
"agent_pubkey_ed25519": "<base64 of the 32-byte public key>",
"hostname": "web-01"
}
201 → {"agent_id": "<uuid>"}
- The key is used up in the same transaction that creates the agent, so it works only once.
- The server stores only each key's SHA-256.
- A public key can enroll only once (
409).
Signed envelopes
Every daemon message after enrollment looks like this:
{
"agent_id": "…",
"seq": 42,
"nonce": "<base64, 16 random bytes>",
"sent_at": "1793181600",
"kind": "events",
"body": { … },
"sig": "<base64 Ed25519 signature>"
}
Signature. Ed25519 over six fields joined by \n, with no trailing newline:
agent_id \n seq \n nonce \n sent_at \n kind \n <body as compact JSON>
Compact JSON means no whitespace, keys in wire order, and UTF-8 rather than \u escapes: what
serde_json::to_string produces. kind is signed, so a message can't be replayed as another kind.
Sequence numbers. seq goes up by one per message. The server accepts each seq once, and
up to 1024 behind the highest it has seen, so a delayed message still lands. Anything else is
409 and raises replayed_seq.
Checks, in order: shape (400), known agent (401), signature (401), body (400),
sequence (409). A message is stored only if all five pass.
POST /v1/events
kind: "events". A batch of blocks:
{"decisions": [
{"observed_at": "1793181600", "action": "create", "decision": "DENY",
"dir_inode": 262145, "dir": "/etc/sudoers.d", "name": "zz-test", "uid": 0}
]}
| Field | Meaning |
|---|---|
observed_at |
When it happened: epoch seconds, ms or ns, or ISO 8601 |
action |
create, mkdir, rename, link or symlink (a new name); write, attr or delete (a file the baseline has); escalate (a setuid, setgid or capability grant anywhere); exec or map (code from a writable place or memory); module, remount, setting (kernel state); listen, connect (sockets); package (dpkg asking); folder (a protected folder moved, removed or mounted over); tamper (an attempt to switch Genos off) |
decision |
DENY, or WATCH for a change a rule set to watch let through and reports as what it would have blocked. Anything else is 400 |
dir_inode, dir, name |
The folder and the bare file name. A block with both opens a ticket |
uid |
The real user id of the process that tried |
actor |
Optional. Who tried it; see below |
Up to 5,000 per message. 200 →
{"ok": true, "accepted": 1, "tickets": 1,
"ticket_refs": [{"ref": "TKT-ab12cd34", "dir": "/etc/sudoers.d", "name": "zz-test"}]}
ticket_refs lists the tickets these blocks opened or bumped. The host remembers them: it accepts an
approved update only for a ticket it raised.
The actor object
Recorded by the kernel at the moment of the block, then filled in by the daemon from /proc.
Unknown fields are dropped; any field may be null if it couldn't be read.
| Field | Meaning |
|---|---|
pid, tid, ppid |
The process, thread and parent |
euid, gid, egid |
Effective user, real and effective group |
auid, login |
The login user's id and name. null outside a login session |
user |
Name of the effective user |
session, tty, unit |
Login session id, terminal (pts/0), systemd unit or scope |
comm, exe |
Process name and executable path |
cgroup_id |
The process's cgroup |
ancestry |
Parents, nearest first: [{"pid", "comm", "exe"}], at most 16 |
process |
running if /proc still showed this exact process, else exited |
When auid and euid are both set and differ, the dashboard shows the user change (alice → root)
and the program in ancestry that made it (via sudo).
GET /v1/stream
A WebSocket (wss://genossec.com/v1/stream) the daemon opens and holds over the same pinned TLS.
No inbound connections. The server pings every 25 s; 90 s without a frame and the daemon reconnects
with backoff (1 s doubling to 5 minutes) and jitter. Enforcement never depends on it.
Every message is a JSON text frame with a type. Opening:
| From | Message |
|---|---|
| Server | {"type": "challenge", "nonce": "…"} |
| Daemon | {"type": "hello", "agent_id": "…", "sig": "<base64 Ed25519>"}, signed with the agent's key over genos.stream_hello/1 \n agent_id \n nonce |
| Server | {"type": "welcome"}, or closes the connection (code 1008) if the signature doesn't verify |
Then the server sends every approved ticket the host hasn't applied yet, oldest first, and each new
approval as it's made (within a few seconds if it was made outside the server process, such as by a
flask command). The tickets table is the outbox: an addition is sent again on every connect
until the host reports it applied.
{"type": "addition", "record": "genos.baseline_addition/1", "agent_id": "…", "ref": "TKT-ab12cd34",
"dir": "/etc/sudoers.d", "name": "zz-test", "sig": "<base64 Ed25519>"}
sig is Ed25519, by the approver key, over:
genos.baseline_addition/1 \n agent_id \n ref \n dir \n name
The host applies it only if the signature verifies, it's for this host, and it's for a ticket this host raised with the same folder and name. It answers:
| Daemon replies | When |
|---|---|
{"type": "applied", "ref", "dir", "name", "version"} |
Applied, or already applied. version is the host's baseline version (the scan is 1). The ticket shows In baseline |
{"type": "rejected", "ref", "reason"} |
Wrong host, a ticket it didn't raise, a different folder or name, or a bad signature. The ticket shows Refused by the host |
| nothing | It holds up but couldn't be recorded; it's sent again on the next connect |
A revoked approval goes the same way, also sent on every connect until the host confirms it:
{"type": "removal", "record": "genos.baseline_removal/1", "agent_id": "…", "ref": "TKT-ab12cd34",
"dir": "/etc/sudoers.d", "name": "zz-test", "sig": "<base64 Ed25519>"}
sig is Ed25519, by the approver key, over:
genos.baseline_removal/1 \n agent_id \n ref \n dir \n name
The host removes the name only if the signature verifies, it's for this host, and that ticket's addition added exactly this folder and name. A name from the install scan is never removed.
| Daemon replies | When |
|---|---|
{"type": "removed", "ref", "dir", "name", "version", "changed": true} |
Removed. version is the new baseline version. The ticket shows Revoked |
{"type": "removed", …, "changed": false} |
Nothing to remove: the approval never reached the host, or it was removed already. version is unchanged |
{"type": "rejected", "ref", "reason"} |
Wrong host, a bad signature, or a different name than the ticket added. The ticket shows Refused by the host |
| nothing | It holds up but couldn't be recorded; the name is put back, and the removal is sent again on the next connect |
A rule mode sets one protected place (by its path), or a named rule, to watch or block. The
named rules: grants (the host-wide setuid, setgid and capability rule) and kernel (module loads
and remounts) block unless set to watch; exec (writable places), settings (sysctls and
security switches), listen (new TCP ports) and sockets (root reaching a login user's socket)
ship watch-only and block once set so. It is sent on every connect until the host confirms it:
{"type": "mode", "record": "genos.rule_mode/1", "agent_id": "…", "rule": "/etc/cron.d",
"mode": "watch", "version": 3, "sig": "<base64 Ed25519>"}
sig is Ed25519, by the approver key, over:
genos.rule_mode/1 \n agent_id \n rule \n mode \n version
The server counts version up per rule. The host applies the mode only if the signature verifies,
it's for this host, the version is newer than the mode in force for that rule (so a replayed
watch can't undo a later block), and the place is one it protects. It records the mode, applies
it to the kernel without a restart, and keeps it across restarts. A watched place lets a change
through and reports it with "decision": "WATCH" on POST /v1/events; the ticket reads would
block.
| Daemon replies | When |
|---|---|
{"type": "mode_set", "rule", "mode", "version"} |
In force, or already in force. The node page shows In force |
{"type": "mode_rejected", "rule", "version", "reason"} |
Wrong host, a bad signature, an older version, or a place this host doesn't protect. The node page shows Refused with the reason |
| nothing | It holds up but couldn't be recorded; it's sent again on the next connect |
Health checks, when the node's health setting asks for one:
| From | Message |
|---|---|
| Server | {"type": "health", "id": "…"} |
| Daemon | {"type": "status", "id": "…", "hooks": 28, "baseline_version": 2, "additions": 1, "uptime_secs": 7200, "version": "0.1.0"} |
A status is read-only; nothing in it changes the host. hooks is how many of the daemon's 30 hooks
are attached; the dashboard shows the node as Enforcing only when a recent answer says all of
them. Anything else on the stream is ignored.
POST /baseline
The scanner's report, sent once per host, gzipped:
Content-Type: application/json
Content-Encoding: gzip
{
"report": "genos.phase0.baseline/1",
"status": "ok",
"host": "web-01",
"sent_at": "2026-10-29T12:00:00Z",
"scanner_version": "0.3.0",
"bundle_sha256": "<64 hex>",
"timing": {"scan_started_at": "…", "scan_seconds": 312},
"profile": {"header": {…}, "coverage": {…}, "vectors_present": […],
"entities_digest": "<64 hex>", "canonical_hash": "<64 hex>"},
"unmapped_queue": {…},
"entities": [{"entity_key": "…", "kind": "…", "path": "…", …}, …]
}
A failed scan sends "status": "failed" and error: {exit_code, log_tail} instead of profile
and entities.
| Response | When |
|---|---|
200, "kind": "baseline" |
Stored |
200, "kind": "failed" or "incomplete" |
Logged. A later complete scan is still accepted |
400 |
Wrong format, or entities don't hash to profile.entities_digest |
409 |
This host already has a baseline |
413 |
Over 32 MB compressed or 96 MB uncompressed |
Digest: SHA-256 of entities as JSON with sorted keys, separators , and :, in UTF-8.
GET /dashboard/catalog
The catalog the scanner downloads:
{"fingerprint": "<64 hex>", "entities": [{"entity_id": "ENT-…", "entity_kind": "…", …}, …]}
| Header | Value |
|---|---|
X-Genos-Catalog-SHA256 |
SHA-256 of the body. Scanners pin it as GENOS_CATALOG_SHA256 |
ETag |
The same hash. Send If-None-Match to get 304 |
503 if the catalog couldn't be built.