Disable USB mass storage endpoints on Linux endpoints by unloading and blacklisting the kernel module
This Automox Worklet™ prevents USB mass storage endpoints from being used on Linux endpoints. The Worklet disables USB storage at the kernel level by unloading the usb-storage module and creating a configuration file that prevents the module from loading on future boots.
The Worklet creates a configuration file in /etc/modprobe.d/ that redirects USB storage module loading to /bin/true, effectively blocking the module. Before making changes, it removes any existing USB storage configurations to prevent conflicts.
The Worklet includes a revert option that can re-enable USB storage by removing the blocking configuration and reloading the kernel module. This allows you to temporarily lift restrictions when needed.
USB storage endpoints enable immediate data exfiltration without network monitoring detection. Users copy sensitive files to thumb drives, bypassing DLP controls that scan network traffic. Attackers with physical access insert malicious USB endpoints that deliver ransomware, keyloggers, or lateral movement tools directly to endpoints, circumventing perimeter security.
Compliance audits fail when removable media controls are missing. PCI-DSS, HIPAA, and SOC 2 frameworks require documented restrictions on USB storage, creating audit findings when endpoints allow unrestricted removable media access. CIS Benchmarks specifically flag enabled USB storage on systems without documented business justification.
Evaluation phase: The Worklet uses lsmod to check if the usb-storage or usb_storage kernel module is currently loaded. If the module is loaded, the endpoint is flagged for remediation. If the module is not loaded, the endpoint is already compliant.
Remediation phase: The Worklet removes any existing USB storage rules from /etc/modprobe.d/, creates a new configuration file with install usb-storage /bin/true to block module loading, then executes rmmod usb-storage to unload the currently loaded module.
Linux endpoint with modprobe configuration support
Root or sudo privileges for kernel module management
Optional: Set module_config_file_name to customize the configuration filename (default: ax-usb-storage.conf)
Optional: Set revert=true in remediation script to re-enable USB storage
USB mass storage endpoints fail to mount, preventing data exfiltration through removable media. Running lsmod | grep usb-storage returns no output, confirming the module stays unloaded across reboots. Your organization meets PCI-DSS, HIPAA, and SOC 2 removable media control requirements with documented kernel-level restrictions.
USB keyboards, mice, and non-storage peripherals continue functioning normally. Users attempting to connect thumb drives or external hard drives find endpoints unrecognized, protecting sensitive data from unauthorized copying. Your compliance audits pass removable media checks with persistent configuration files in /etc/modprobe.d/ providing audit evidence.
Run this Worklet on a pilot Linux endpoint and review evaluation output for disable usb storage.
Confirm Automox activity logs show successful completion and exit code 0.
Verify endpoint state using checks aligned to evaluation script logic, such as function, else, check_usb_storage_module.
Validate remediation effects from script operations such as function, else, touch, then rerun evaluation for compliance.
After remediation, endpoints reflect the target disable usb storage configuration and report compliant status in Automox.
You can confirm results by correlating activity logs with evaluation checks (function, else, check_usb_storage_module) and remediation actions (function, else, touch).


By submitting this form you agree to our Master Services Agreement and Privacy Policy.
Already have an account? Log in
Consider Worklets your easy button
A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklet automation scripts perform configuration, remediation, and the installation or removal of applications and settings across Windows, macOS, and Linux.

AUTOMOX + WORKLETS™
Uncover new possibilities with simple, powerful automation.
By submitting this form you agree to our Master Services Agreement and Privacy Policy