Chronicle
A Linux host monitor. It records process, file and network activity with eBPF, keeps a baseline for each process in SQLite, and flags behaviour that drifts from it.
- Python 78%
- JavaScript 8%
- CSS 7%
- HTML 6%
- Shell 1%
live from github.com/Team-ADAPT/Chronicle, refreshed daily
The problem
A single system call tells you very little. A process that opens a file, or connects to a port, is usually fine. What's unusual is a process doing something it hasn't done before.
Chronicle takes that second view. Rather than matching events against a list of known-bad signatures, it builds a rolling baseline for each process and measures how far current behaviour drifts from it.
Architecture
Data moves in one direction, from the kernel to an alert.
kernel events (eBPF probes, or psutil as a fallback)
-> collector: samples in 2-second windows, groups processes,
anonymises file paths and removes credentials
-> SQLite in WAL mode: events, metrics, alerts, process baselines
-> models: a supervised XGBoost classifier and an
unsupervised Isolation Forest, both in-process
-> risk scoring: a 0-100 score, mapped to MITRE ATT&CK,
with duplicate alerts suppressed for 60 seconds
-> tray app and a read-only JSON API
Everything runs on the host itself, and the project is designed to work air-gapped.
One engineering decision
eBPF needs root and a recent enough kernel. Chronicle collects with eBPF probes when it can, and falls back to reading process information with psutil when it can't. The fallback is less detailed, but monitoring keeps running on a machine where the better source isn't available, instead of the whole tool failing at startup.
The cost is two data sources with different detail, so the models have to cope with both.
What broke
The first live runs raised alerts on ordinary processes, constantly. The cause was statistical. A process's baseline started from two samples, and deviations were measured as z-scores with a tiny minimum spread (0.2% CPU). For a fresh, quiet process, any normal blip was many standard deviations from "normal", so the risk engine flagged it.
The fix (pull request #13, commit 73afe50) attacked it at each stage:
- A process needs at least three samples before its deviations count at all.
- The minimum spread became realistic (2% CPU, 25 MB of memory), and noise below a floor is ignored.
- Statistical drift can add only a capped amount to the risk score.
- An alert now needs a score of 50 or more, an anomalous status, a heuristic hit or the supervised model calling it an attack. Drift alone is logged as
RESOURCE_DRIFT, not raised as an attack.
The lesson: a z-score is only as trustworthy as the spread it divides by.