Optionally refresh apt package lists before each report
CI / tests (Python 3.10) (pull_request) Successful in 15s
CI / tests (Python 3.11) (pull_request) Successful in 15s
CI / tests (Python 3.12) (pull_request) Successful in 15s
CI / tests (Python 3.13) (pull_request) Successful in 15s
CI / lint (pull_request) Successful in 3s

The agent's dist-upgrade simulation already finds new-ABI kernels and
security updates, but only once apt's lists know about them. Debian
doesn't refresh lists by default, so a kernel security release could
stay invisible until someone ran apt update.

install.sh --with-apt-update adds a marker that enables
kernelwatch-apt-update.service, a sandboxed root oneshot the agent pulls
in before each report. Failures (no network, apt lock held) are ignored
so the report still goes out. deploy.sh now ships the unit; a test keeps
deploy.sh's file list in sync with what install.sh uses.

Agent 0.3.2, server 0.3.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-10-17 17:13:55 -04:00
1 parent e9c8f889c7
commit f35cc007f5
8 files changed
+104 -11

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
[Unit]
Description=Refresh apt package lists (for kernelwatch)
# Pulled in by kernelwatch-agent.service before each report, so updates show up
# within the hour instead of whenever apt-daily next refreshes the lists (on
# Debian, by default, never). Enabled by `install.sh --with-apt-update`.
ConditionPathExists=/etc/kernelwatch/apt-update
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
# Same as `apt-get update`: downloads lists, installs nothing. A failure (no
# network, lock held by an admin's apt run) mustn't stop the report; the
# dashboard flags lists that stay old.
ExecStart=-/usr/bin/apt-get -q update
TimeoutStartSec=5min
Nice=10
IOSchedulingClass=idle
# apt needs root to write /var/lib/apt and drops to _apt for downloads, so this
# keeps root but loses everything apt update doesn't touch.
User=root
NoNewPrivileges=yes
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes
RestrictNamespaces=yes
RestrictRealtime=yes
LockPersonality=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
SystemCallArchitectures=native