feat(hardening): virtualization and CPU vendor, and installing the CPU microcode, 4.53.0 (NetOrk/netork#2838) #141

Merged
christianmanivong merged 1 commits from feature/cpu-microcode into main 2026-11-28 23:10:04 +00:00
Owner

For NetOrk/netork#2838: where an unmitigated CPU vulnerability is fixed.

  • get_hardening() reads virtualization (systemd-detect-virt: none on bare metal, else the hypervisor or container engine; without it vm/none from the cpuinfo hypervisor flag) and cpu_vendor (vendor_id).
  • New cpu_microcode module: microcode_package(os_ids, cpu_vendor) (Debian/Ubuntu intel-microcode/amd64-microcode, Red Hat family microcode_ctl/linux-firmware, SUSE ucode-intel/ucode-amd, else none), firmware_component(codename), add_component(text, component, *, deb822).
  • CpuMicrocodeMixin.install_cpu_microcode(): steps read (refuses a guest or an unknown placement, and a host without a package), sources (on Debian only: adds the firmware component to Debian's own enabled sources that have main, writes each file whole, reloads the index through _reload_package_index), install (ensure_package). Nothing restarts; the microcode loads at the next boot.

4.53.0. Tests: 2169 passed, coverage 97.4% (cpu_microcode.py 100%); ruff, mypy, napalm-standard check/ratchet clean.

For NetOrk/netork#2838: where an unmitigated CPU vulnerability is fixed. - `get_hardening()` reads `virtualization` (`systemd-detect-virt`: `none` on bare metal, else the hypervisor or container engine; without it `vm`/`none` from the cpuinfo `hypervisor` flag) and `cpu_vendor` (`vendor_id`). - New `cpu_microcode` module: `microcode_package(os_ids, cpu_vendor)` (Debian/Ubuntu `intel-microcode`/`amd64-microcode`, Red Hat family `microcode_ctl`/`linux-firmware`, SUSE `ucode-intel`/`ucode-amd`, else none), `firmware_component(codename)`, `add_component(text, component, *, deb822)`. - `CpuMicrocodeMixin.install_cpu_microcode()`: steps `read` (refuses a guest or an unknown placement, and a host without a package), `sources` (on Debian only: adds the firmware component to Debian's own enabled sources that have `main`, writes each file whole, reloads the index through `_reload_package_index`), `install` (`ensure_package`). Nothing restarts; the microcode loads at the next boot. 4.53.0. Tests: 2169 passed, coverage 97.4% (`cpu_microcode.py` 100%); ruff, mypy, `napalm-standard check`/`ratchet` clean.
christianmanivong added 1 commit 2026-11-28 23:07:18 +00:00
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
7451fc9dfc
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.
christianmanivong merged commit e2970831f8 into main 2026-11-28 23:10:04 +00:00
christianmanivong deleted branch feature/cpu-microcode 2026-11-28 23:10:05 +00:00
Sign in to join this conversation.