Files
kernel-automation/docs/security.md
T
patrickandClaude Sonnet 5.5 77a880880a Move README sections into docs/ pages
Content is moved verbatim (checked line by line against the old README). Each
page gets a title and a link back to the README; H3 sections that become pages
of their own are promoted to H2. The README itself is trimmed next.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 12:07:31 -04:00

2.3 KiB

Security notes

← kernelwatch

  • 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 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.
  • Livepatch status runs in a separate root unit with no network access and a read-only filesystem. It has no capability bound, syscall filter or NoNewPrivileges, because the snap's setuid snap-confine can't run under them (tested: NoNewPrivileges=yes fails with "cannot change profile for the next exec call"). It only runs canonical-livepatch status.
  • 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 processes' memory maps), a read-only filesystem except /run/kernelwatch, and -r l (list, never restart).
  • apt-get update (with --with-apt-update) runs as root with network access, like apt's own apt-daily.service, but sandboxed: no access to home directories, devices or kernel settings. apt drops to its _apt user for the downloads, and nothing gets installed.
  • The agent runs as a throwaway unprivileged user (DynamicUser=yes) with no capabilities, a read-only filesystem view and a syscall filter. The token reaches it through LoadCredential= and goes to curl on stdin, so it never appears in a process listing.
  • The dashboard uses scrypt-hashed passwords, server-side sessions, HttpOnly + Secure + SameSite=Strict cookies, an Origin check on form posts, per-IP login rate limiting, and a strict CSP. Everything a host reports is HTML-escaped.
  • It's read-only by design. The server can't make hosts do anything. Adding remote actions (like "reboot this host") would turn it into a remote-execution system; think hard before doing that.