CLI-Anything Bundle #68 — USB Guardian Trust Recon Pack
Four agent-native read-only harnesses that census the USBGuard device-authorization trust surface: the layer that decides whether this host's USB device policy can still be TRUSTED — the usbguard-daemon.conf posture, the rules.conf device-trust grammar, the DBus/group/notifier integration fleet, and the sysfs bus authorization state. No other bundle owns this surface — #63 keeps the bootloader/EFI layer, #66 keeps the AIDE integrity layer, #67 keeps the firejail sandbox layer (census: 0 exact / 0 name-class substring token collisions across the whole shipping catalog, 141 Gumroad products pulled fresh). USBGuard's own config, rules, integration and bus-authorization layers are unclaimed census territory.
- usbguardpeek — daemon & package posture census (main config statted mode/owner/size + parsed in the key=value grammar; PERMISSIVE_TARGET / AUDIT_UNCONFIGURED / AUDIT_BACKEND_UNKNOWN postures, UNK_KEY typo-defeats, DUP_KEY, RulesFile pointer law RULES_FILE_EXTERNAL / RULES_FILE_MISSING; fixed binary paths stat-only, PATH never resolved, neither/both-found honest; usbguard.service unit + drop-in dir parsed never started — ExecStart/User/PIDFile; open-mode/owner stat findings; masking len-only; CONF_ABSENT / DIR_ABSENT / UNIT_ABSENT / BINARY_ABSENT honest rc6; ROOT/CONF/UNITROOT overrides).
- usbrulespeek — rules.conf device-trust grammar census (one-rule-per-line grammar — target allow|block|reject + match conditions id/idMatch/serial/hash/parent-hash/via-port/with-interface/with-connect-type/conditions, glued-#-is-data comment law; postures BARE_ALLOW_ALL / WILD_ID_ALLOW / PINNED_ALLOW vs SERIALLESS_ALLOW, DUP_RULE, target histogram + wildcard-vs-pinned subcounts, with-interface class coverage, 2 MiB capped reads; serial/hash device-identifying values masked len-only; world-writable rules stat finding; RULES_ABSENT / DIR_ABSENT honest rc6; CONF/ROOT overrides).
- usbauthpeek — authorization & integration census (daemon conf IPC postures IMPLICIT_ALLOW / IPC_UNRESTRICTED_USERS / IPC_GROUP_WIDE vs the clean {root,usbguard} set; usbguard group existence truth from /etc/group with member COUNT only, never names; group referenced-but-absent IPC_GROUP_NOGROUP; DBus policy drop-in listdir-only filename law with keyword rows, never file text; notifier/applet binaries stat-only; NO_INTEGRATION honest rc6; CONF/ROOT/GROUPROOT/DBUSROOT overrides).
- usbportspeek — sysfs bus authorization census (/sys/bus/usb/devices listdir classification — usbN root hubs bDeviceClass=09, device and :C.I interface dirs; per-entry authorized 0/1 with UNAUTHORIZED_DEVICES counts; usbcore authorized_default 1 = clean AUTHORIZED_DEFAULT_ON / 0 = DEFAULT_UNAUTHORIZED / 2 carried verbatim; autosuspend params; interface-class histogram; PRIVACY LAW: serial/product/manufacturer/devpath NEVER read or carried, battery-pinned; SYS_ABSENT honest rc6; SYS/MODROOT overrides).
The contract
Every tool: rc0 clean / rc4 findings / rc6 honest nothing-readable / rc2 usage; --json emits one report object; per-tool root/conf/unit/group/dbus/sys/mod overrides point the census at any tree or fixture. Pure Python stdlib — zero subprocesses, zero writes, zero sockets, zero network, zero process enumeration; USBGuard artifacts are only ever READ and statted, binaries are never executed, and device-identifying values are masked by length only. The census never "fixes" an exposed posture — it names it.
Self-test battery inside
789 fixture-based executed assertions (checks.py + runner_count.py per bundle norm) — verified as: three green fires from the shipping tree and two clean-room fires from THIS exact shipping zip (789/0 every fire). The battery pins rc laws, every finding code, the never-execute + no-process-enumeration laws, grammar edges, caps, the serial/hash masking laws, stat hygiene, and write-nothing fingerprints with zero scratch remnants.
Who this is for
Admins who can't honestly answer what their USBGuard daemon would allow right now; hardening teams proving the rules file, integration glue and bus authorization still form a closed loop; agent builders who want their AI to census a host's device-authorization trust posture without ever mutating it. The census reads — the USB device policy is never touched.
MIT licensed · Python 3.8+ · 40 files · stdlib-only