feat(hardening): where the OS runs and whose CPU it is, and installing the CPU microcode, 4.53.0 (NetOrk/netork#2838)
driver / standard (pull_request) Successful in 16s
driver / lint (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Successful in 1m12s
driver / test (3.13) (pull_request) Successful in 1m5s
driver / lowest (pull_request) Successful in 34s
driver / build (pull_request) Successful in 27s
driver / types (pull_request) Successful in 1m50s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m12s
driver / publish (pull_request) Skipped

get_hardening() reads virtualization (systemd-detect-virt, else the cpuinfo
hypervisor flag) and cpu_vendor. CpuMicrocodeMixin.install_cpu_microcode()
refuses a guest, picks the package of the distribution and CPU vendor
(microcode_package), adds Debian's firmware component to Debian's own sources
where it is missing, reloads the index and installs the package; it loads at
the next boot.
This commit is contained in:
christianmanivong committed 2026-11-29 00:06:50 +01:00
1 parent 5faf9a1021
commit 7451fc9dfc
8 files changed
+913 -3

No files matched your search

+24
View File
@@ -7,6 +7,30 @@ recorded here; their history is the git log.
## [Unreleased]
## [4.53.0] - 2026-11-28
### Added
- `get_hardening()` reads whether the host runs on its own hardware, and whose CPU it is
(NetOrk/netork#2838): `virtualization`, `systemd-detect-virt`'s word (`none` on bare
metal, else the hypervisor or container engine, lowercased), else `vm` or `none` from the
`hypervisor` flag of `/proc/cpuinfo` where systemd-detect-virt is not installed; and
`cpu_vendor`, the first `vendor_id` of `/proc/cpuinfo` (`GenuineIntel`, `AuthenticAMD`;
None without one, as on ARM). Read-only, like the rest of the reading.
- `CpuMicrocodeMixin.install_cpu_microcode()`: the CPU vendor's microcode on a host that
runs on its own CPU, in three steps. `read` refuses a guest (a guest loads no microcode,
its host does) and a host whose virtualization could not be told, and picks the package
(`microcode_package`): `intel-microcode`/`amd64-microcode` on Debian and Ubuntu,
`microcode_ctl`/`linux-firmware` on Enterprise Linux and Fedora,
`ucode-intel`/`ucode-amd` on SUSE; none elsewhere. `sources`, on a Debian host only,
adds Debian's firmware component (`firmware_component`: `non-free-firmware`, `non-free`
up to bullseye) to every enabled source of Debian's own archive that has `main`, and
loads the package index again; another vendor's source is never touched
(`add_component`). `install` is `ensure_package`'s. The microcode loads at the next boot;
the restart is the caller's. Returns `CpuMicrocodeFixDict` (the fix, `package`,
`sources_changed`). On no role base: a driver mixes it in. The index is loaded again through
`_reload_package_index`, `refresh_available_updates` by default; a driver whose refresh only
starts a task overrides it with one that waits.
## [4.52.0] - 2026-11-28
### Added