# CLI-Anything Bundle #62 — Hypervisor & VM Trust Recon Pack
CLI-Anything Bundle #62 — Hypervisor & VM Trust Recon Pack
CLI-Anything Bundle #62 — Hypervisor & VM Trust Recon Pack
Four agent-native read-only harnesses that census the hypervisor & VM trust surface: the config layers where the libvirt daemon family, the QEMU driver, the guest domain XML, and the storage pool XML decide who owns and reaches a host's virtual machines — the daemon configs and the /etc/libvirt tree, the qemu.conf run-as pedestal, the per-guest domain definitions (emulator binaries, disk images, sandbox posture), and the pool definitions themselves (target dirs, permissions blocks, auth/secret references). No other bundle owns this surface — #53 keeps the audit-rule layer, #57 keeps the database layer, #58 keeps the VPN tunnel layer, #60 keeps the web-server config layer, #61 keeps the SNMP daemon layer (census: 0 exact / 0 name-class substring token collisions across the whole shipping catalog, 136 Gumroad products pulled fresh). The libvirt/qemu trust surface was unclaimed census territory.
- libvirtpeek — libvirt daemon configs + one-level /etc/libvirt tree census. listen_tcp truthy or listen_tls falsy = LISTEN_TCP_PLAINTEXT finding; auth_tcp none = AUTH_TCP_NONE finding; auth_tls none = AUTH_TLS_NONE finding; unix_sock_rw_perms carrying the world-write bit = UNIX_SOCK_WORLD_WRITABLE (mode judged octal-wise); unix_sock_dir / log_output dirs / TLS paths statted note-class (SOCKET_DIR_*/LOG_DIR_*); key_file/cert_file/ca_file = TLS_KEY/TLS_CERT/TLS_CA + TLS_STAT probes — key world-readable = TLS_KEY_WORLD_READABLE, not-root-owned = TLS_KEY_NOT_ROOT; unknown directives capped 40 (cap named); password-ish unknown values masked len-only; tree law — world-writable file = FILE_WORLD_WRITABLE, world-writable /etc/libvirt itself = LIBVIRT_DIR_WORLD_WRITABLE; honest CONF_ABSENT notes per daemon pick; lstat + single-hop symlink law, dangling carried never judged; honest absence rc6.
- qemuconfpeek — /etc/libvirt/qemu.conf hypervisor-config census. user/group both effectively root = RUN_AS_ROOT finding (both absent = RUN_DEFAULT_ROOT, the named variant; one-sided roots as notes, values compared strictly against 'root'); dynamic_ownership 0 = DYNAMIC_OWNERSHIP_OFF (every zeroed occurrence named); security_driver none = SECURITY_DRIVER_NONE (case-insensitive enum); per-file DUPLICATE_DIRECTIVE rows, verdicts read the last occurrence; unknown caps 40; sensitive unknown values masked len-only even inside quotes; CONF_STAT row per parsed conf (CONF_WORLD_WRITABLE / CONF_NOT_ROOT_OWNED notes, DANGLING_SYMLINK carried); honest absence rc6.
- domcfgpeek — /etc/libvirt/qemu/*.xml per-guest domain trust census (elementwise parse, namespaced qemu: args included). <emulator> statted — EMULATOR_WORLD_READABLE note, EMULATOR_NOT_ROOT_OWNED row, missing/dangling = EMULATOR_MISSING finding; every disk source statted ONCE per path run-wide — DISK_WORLD_WRITABLE, DISK_GROUP_WRITABLE / DISK_NOT_ROOT_OWNED rows, DISK_NOT_DEFAULT_RUN_USER (run users libvirt-qemu/qemu resolved via pwd, unresolved carried honestly), absent/empty source attribute = DISK_SOURCE_ABSENT, unstatable path = DISK_FILE_MISSING honest carry; raw/qcow2 format law as DISK_FORMAT row; <commandline> args — -sandbox off/0 = SECCOMP_SANDBOX_OFF, no -sandbox arg at all = SECCOMP_SANDBOX_ABSENT note (posture always named); memballoon none = MEMBALLOON_NONE; console/serial sockets statted (CONSOLE_SOCK_WORLD_WRITABLE); LOADER rows + LOADER_MISSING note; title/description presence-only — text NEVER printed; per-class caps + DIRLIMIT cap named; MALFORMED_XML finding (parser error text never printed); honest rc6.
- storpoolpeek — /etc/libvirt/storage/*.xml pool trust census. <pool> type/name as written + <uuid> verbatim; every target <path> statted ONCE per path — POOL_DIR_WORLD_WRITABLE, POOL_GROUP_WRITABLE / POOL_NOT_ROOT_OWNED rows, missing/dangling = POOL_PATH_MISSING (a <target> with no <path> child carries the same missing-path shape); <permissions> block rows as written — a mode with group/world-write bits = POOL_XML_PERM_WRITABLE, unparseable modes carried honestly; iscsi/netfs/dir sources verbatim, NEVER resolved; password/passphrase/secret/username attributes, <secret> uuid + <secret>/<password> text masked len-only as AUTH_CREDENTIAL rows — values never printed, the pool's own <uuid> stays verbatim; per-class caps + DIRLIMIT; honest rc6.
The contract
Every tool: rc0 clean / rc4 findings / rc6 honest nothing-readable / rc2 usage; --json emits the full report (exactly six keys; the rc rides the summary); --conf points the census at one config or xml file, --dir replaces the root list — any tree or fixture. Pure Python stdlib — zero subprocesses, zero writes, zero sockets, zero network; libvirt/qemu configs and domain/pool XML are parsed, paths statted once, and secret-ish values are masked by name with length only. The census never "fixes" an exposed posture — it names it.
Self-test battery inside
831 fixture-based executed assertions (checks.py + runner_count.py per bundle norm) — verified as: two green fires from the shipping kit (831/0 each) and two clean-room fires from THIS exact shipping zip (831/0 both). The battery pins rc laws, every finding code, the stat-only secret law (planted secrets must never appear in any output), the single-hop symlink law, grammar edges, caps, and write-nothing fingerprints.
Who this is for
Virtualization admins who inherited a libvirt estate nobody fully trusts; hardening teams proving guests only run what they should — no plaintext TCP listener, no root run-as pedestal with ownership management off, no sandbox-less qemu command lines, no world-writable disk images or pool target dirs; agent builders who want their AI to census hypervisor trust posture without ever mutating it. The census reads — the hypervisor is never touched.
MIT licensed · Python 3.8+ · 40 files · stdlib-only