CLI-Anything Bundle #63 — Bootloader Trust Recon Pack
Four agent-native read-only harnesses that census the bootloader & firmware trust surface: the layer that decides WHAT the machine boots BEFORE any OS-level security applies — GRUB2's generated + hand config, the grubenv saved-state block, EFI boot variables, and the initramfs generator configs. No other bundle owns this surface — #14 keeps the RUNNING kernel's boot state (cmdline/kmods/sysctl/dmesg), #52 keeps the kernel probe layer, #60 keeps web-server configs (census: 0 exact / 0 name-class substring token collisions across the whole shipping catalog, 137 Gumroad products pulled fresh). The bootloader config layer itself is unclaimed census territory.
- grubconfpeek — GRUB2 config census (/boot/grub/grub.cfg + /etc/default/grub + /boot/efi/EFI/*/grub.cfg). Menu entries with brace-depth parsing; password_pbkdf2 rows (user carried, hash masked len-only); bare plaintext password rows = PASSWORD_PLAIN finding; /etc/default/grub GRUB_PASSWORD: grub.pbkdf2 value = ENCRYPTED good row (masked), anything else = GRUB_PASSWORD_PLAIN finding, no row at all = GRUB_PASSWORD_ABSENT finding (console-edit takeover surface — anyone at the console can append init=/bin/bash); GRUB_DISABLE_RECOVERY law; /etc/grub.d + /boot/grub file census with file-perm stat law (grub.d bytes NEVER read); honest absence rc6.
- grubenvpeek — grubenv saved-state census (/boot/grub/grubenv + /boot/grub2/grubenv + /boot/efi/EFI/*/grubenv). KEY=*** rows verbatim; GRUB_SAVEDEFAULT ON + GRUB_DEFAULT not 'saved' = SAVEDEFAULT_MISMATCH finding (cross-file, both provenances); duplicate keys = KEY_DUP finding (per-file, file:line on both); world-writable = GRUBENV_WORLD_WRITABLE finding; symlink single-hop with DANGLING carried; 1024-byte pad-format note row; unused-entry drift named; honest rc6.
- efivarpeek — EFI variable trust census (/sys/firmware/efi/efivars). Var files censused BY NAME ONLY (Name-GUID grammar, odd names classed honestly; bytes NEVER read — efivarfs writes are kernel-panic class); Boot0000-… entry rows + BootOrder/BootCurrent/BootNext presence; SecureBoot/SetupMode/PK/KEK/db SECUREBOOT_STATE_PRESENT rows (presence-only); VAR_WORLD_READABLE / VAR_NOT_ROOT_OWNER stat findings; absent efivars = EFIVARS_ABSENT honest rc6 (non-EFI boot named, never invented).
- initramfspeek — initramfs generator census, multi-manager honesty: initramfs-tools (/etc/initramfs-tools/), dracut (/etc/dracut*.conf*), mkinitcpio (/etc/mkinitcpio*). First readable manager wins; others named NOT_PRESENT; MODULES=/RESUME=/COMPRESS= rows verbatim (UUID carried as-written, never resolved); hooks dir name+stat census only (hooks bytes NEVER read); world-writable hook = FILE_WORLD_WRITABLE finding; nothing anywhere = honest rc6 NOTHING_READABLE.
The contract
Every tool: rc0 clean / rc4 findings / rc6 honest nothing-readable / rc2 usage; --json emits the full report; --conf points the census at one config file, --dir replaces the root list — any tree or fixture. Pure Python stdlib — zero subprocesses, zero writes, zero sockets, zero network; boot configs are parsed, paths statted once, and passwords, hashes and EFI variable contents are masked by name with length only. The census never "fixes" an exposed posture — it names it.
Self-test battery inside
698 fixture-based executed assertions (checks.py + runner_count.py per bundle norm) — verified as: builder double-fires per tool (196/0 + 134/0 + 177/0 + 191/0, identical consecutive), three green fires from the merged tree incl. a post-canary re-fire, and two clean-room fires from THIS exact shipping zip (698/0 both). The battery pins rc laws, every finding code, the mask law (planted grub.pbkdf2 values must never appear in any output), grammar edges, caps, stat hygiene, and write-nothing fingerprints.
Who this is for
Admins who inherited machines nobody can honestly say "no one can edit the boot line" about; hardening teams proving GRUB password enforcement, recovery-mode posture, EFI variable hygiene, and initramfs config trust; agent builders who want their AI to census bootloader trust posture without ever mutating it. The census reads — the boot stack is never touched.
MIT licensed · Python 3.8+ · 40 files · stdlib-only