Rate-limit report ingestion per host #12

Merged
patrick merged 2 commits from feat/ingest-rate-limit into main 2026-10-30 01:16:32 +00:00
Showing only changes of commit 51732066d0 - Show all commits
+6
View File
@@ -468,6 +468,12 @@ To restore, stop the service, put the file at `db_path` owned by `kernelwatch`
- **Host identity comes from the token, not the payload.** A host can only - **Host identity comes from the token, not the payload.** A host can only
report as itself. Tokens are 256-bit random values; only their SHA-256 is stored. report as itself. Tokens are 256-bit random values; only their SHA-256 is stored.
- **Report rate limit.** A report arriving less than `report_min_interval_seconds`
(default 30) after the host's previous one gets HTTP 429 with a `Retry-After`
header, and isn't stored. So a stuck agent or a leaked token can't flood the
database or push real history off the host page. The agent's curl waits out the
`Retry-After` and retries, so running `systemctl start kernelwatch-agent` twice
in a row just pauses briefly. Set it to `0` to disable.
- **needrestart** runs in a separate root unit with `PrivateNetwork=yes`, a - **needrestart** runs in a separate root unit with `PrivateNetwork=yes`, a
capability set of just `CAP_SYS_PTRACE` + `CAP_DAC_READ_SEARCH` (to read other capability set of just `CAP_SYS_PTRACE` + `CAP_DAC_READ_SEARCH` (to read other
processes' memory maps), a read-only filesystem except `/run/kernelwatch`, processes' memory maps), a read-only filesystem except `/run/kernelwatch`,