Check that the release's security repository is configured and fresh
CI / tests (Python 3.10) (pull_request) Successful in 36s
CI / tests (Python 3.11) (pull_request) Successful in 36s
CI / tests (Python 3.12) (pull_request) Successful in 37s
CI / tests (Python 3.13) (pull_request) Successful in 37s
CI / lint (pull_request) Successful in 4s

security_count is only meaningful if apt has the release's security
suite. A host missing it from its sources shows 0 security updates
forever, and one whose apt can't fetch it (expired key, wrong URL after
a release upgrade, a mirror that fell behind) keeps the last copy while
the update stamps and other lists move on, so neither the simulation nor
the package list age notices.

The agent (0.9.0) now finds apt's list for <codename>-security by its
Suite: (Ubuntu) or Codename: (Debian) field, since file names depend on
the mirror (mirror+file: sources, several mirrors), and reports
security_repo_suite and security_repo_age_seconds from its Date:, the
newest copy winning. The server puts the host in update when there's no
such list, or when it's older than security_repo_stale_after_days
(default 7) while the package lists are otherwise fresh; if all of
them are old, the existing "package lists N days old" reason covers
it. Releases past the end of support are skipped: their suite has
stopped publishing, and support.check already says so. ESM suites
publish too rarely to judge by date and aren't checked.

The host page gets a "Security repository" row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
patrickandClaude Opus 5.5 committed 2026-11-01 14:58:10 -05:00
1 parent fa6cca4f64
commit c9912d5fbc
12 files changed
+261 -4

No files matched your search

+17 -1
View File
@@ -10,7 +10,7 @@ Each host gets one status. When several apply, the worst one wins:
|----------|---------|
| `stale` | No report in `stale_after_hours` (default 3h), or never. Other data can't be trusted. |
| `reboot` | A newer kernel is installed but not running, or `/run/reboot-required` exists. |
| `update` | A kernel or security update is available but not installed, services are running outdated libraries and need a restart, or apt's package lists are too old (`apt_stale_after_hours`) for "no updates" to mean anything. Also when `/boot` has less than `boot_min_free_mb` free, dpkg left packages half-installed, the OS release no longer gets security updates, or unattended-upgrades is enabled but hasn't succeeded in `unattended_upgrades_stale_after_days`. |
| `update` | A kernel or security update is available but not installed, services are running outdated libraries and need a restart, or apt's package lists are too old (`apt_stale_after_hours`) for "no updates" to mean anything. Also when `/boot` has less than `boot_min_free_mb` free, dpkg left packages half-installed, the OS release no longer gets security updates, unattended-upgrades is enabled but hasn't succeeded in `unattended_upgrades_stale_after_days`, or the release's security repository is missing from apt or hasn't refreshed in `security_repo_stale_after_days`. |
| `ok` | Running the newest installed kernel, with no security or kernel updates pending. |
Each row also lists the reasons behind its status, and clicking a host shows
@@ -134,6 +134,22 @@ How the agent works it out:
`kernelwatch-apt-update.service` runs `apt-get update` just before each
report, so updates show up within the hour. Either way, lists older than
`apt_stale_after_hours` put the host in `update`.
- **Security repository**: security updates come from one suite,
`<codename>-security` (`trixie-security`, `noble-security`). A host whose apt
sources lack it sees "0 security updates" forever. One whose apt can't fetch
it (an expired key, a wrong URL after a release upgrade, a mirror that fell
behind) keeps the last copy while the update stamps and other lists move on.
So the agent finds apt's list for that suite by its `Suite:`/`Codename:` field
(file names depend on the mirror) and reports how old its `Date:` is, the
newest copy if there are several mirrors. No list puts the host in `update`
("apt has no trixie-security repository"), and so does a copy older than
`security_repo_stale_after_days` (default 7; both suites publish at least
daily) while the package lists are otherwise fresh. If all the lists are old,
only "package lists N days old" is shown. ESM suites aren't checked, as they
publish rarely, and nor is a release past the end of support, whose suite has
stopped. The host page's "Security repository" row shows the suite and its
age. Set `security_repo_stale_after_days = 0` to turn this off, e.g. for a
local mirror that renames the suite. Agents before 0.9.0 don't report it.
- **Phased updates** (Ubuntu only): Ubuntu rolls some updates out gradually and
holds them back from a share of machines at first. apt doesn't offer these to
the host yet, so they aren't counted as available updates. They appear as