infra-modulejail

Blocks unneeded Linux kernel modules via runtime modprobe overrides without bricking remote hosts.

1|Updated Jun 23, 2026
One-click install
npx skills add https://github.com/bitranox/bitranox-skills --skill infra-modulejail-bitranox
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: infra-modulejail
Source: https://github.com/bitranox/bitranox-skills/tree/main/plugins/bitranox/skills/infra-modulejail
Command: npx skills add https://github.com/bitranox/bitranox-skills --skill infra-modulejail-bitranox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Hardening a Linux host by blocking unused kernel modules is risky: a wrong module list can leave a remote or relocating host unbootable and unreachable, and silent modprobe overrides make failures nearly impossible to diagnose. This skill provides the safe procedure for jailing the kernel module namespace while keeping every mistake recoverable over SSH. ## Core Features & Use Cases - Allowlist-then-block method: Build a KEEP set from loaded modules, a baseline profile, and an explicit whitelist, expand it to its full dependency closure, then block everything else as a runtime-only modprobe override (never baked into the initramfs). - Safety gates: An invariant gate validated against a known-negative, a boot-critical hard-exempt tier (storage, NIC, KVM/LXC modules), and a mandatory cold-reboot test while the host is still physically recoverable. - Runtime-discovery loop: Diagnose silent blocks (modprobe exits 0 loading nothing, "Dependency failed" units) by logging refusals via a logger-based install directive and reading them back from journalctl. - Use Case: Hardening a Proxmox/LXC host before relocating it to a site with no console or out-of-band power, jailing roughly 97% of the module tree while guests, NICs, and storage keep working across cold reboots. ## Quick Start Ask the AI to safely block all unneeded kernel modules on a remote Linux host using a runtime-only modprobe allowlist with a reboot-recovery gate.

Frequently Asked Questions about infra-modulejail

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I block unused kernel modules on Linux safely?▼

Build a KEEP set from currently loaded modules, a baseline profile, and an explicit whitelist, expand it to its dependency closure with modprobe --show-depends, then block everything else via install directives in /etc/modprobe.d. Keep the block runtime-only and never bake it into the initramfs.

Why does modprobe exit 0 but the module never loads?▼

An install override like 'install X /bin/true' runs instead of inserting the module, so modprobe prints nothing and exits 0 while loading nothing. Check lsmod and query journalctl -t modulejail for logged refusals if the logger form of the directive was used.

What is the difference between blacklist and install overrides in modprobe.d?▼

A blacklist entry only stops alias-based autoloading; an explicit modprobe of the name still loads the module. An 'install X /bin/true' override intercepts every future load attempt, which is what a real module jail requires.

Why should the module block not be baked into the initramfs?▼

A runtime /etc/modprobe.d block takes effect after root is mounted and userspace started, so a wrong entry stays fixable over SSH. Baked into the initramfs, a wrong entry can stop the boot before the disk or NIC driver loads, bricking a host with no console or out-of-band power.

Why does a whitelisted module fail with 'Unknown symbol' after jailing?▼

A dependency of the whitelisted module was blocked. The dependency closure must be computed for every kept module, and runtime request_module() helpers like crypto API backends are invisible to --show-depends and must be discovered by exercising the feature and reading the refusal log.

When should I not apply a kernel module jail?▼

Do not apply it on a machine whose hardware and workload you cannot enumerate and reboot-test first, or where you have no recovery path such as console access, out-of-band power, or on-site hands. Fix the recovery path before hardening.