The reconstructed evaluation script behind this rule's OVAL check(s) — every module a compound check combines, with this rule's own concrete values and DISA's SCC tool's real per-module mechanism curated from static teardown of SCC releases.
#!/bin/bash
# Reconstructed from oval:mil.disa.fso.rhel11:def:439
# The system must have USB Mass Storage disabled unless needed.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# check USB storage /etc/modprobe.conf
# textfilecontent54_object (textfilecontent54_test)
test_1() {
grep -Pq '^install[ ]usb-storage[ ]/bin/true$' '/etc/modprobe.conf' &>/dev/null
}
# check USB storage /etc/modprobe.d/*
# textfilecontent54_object (textfilecontent54_test)
test_2() {
grep -rqP --include='*' '^install[ ]usb-storage[ ]/bin/true$' '/etc/modprobe.d' &>/dev/null
}
if ( test_1 || test_2 ); then
echo "PASS"
else
echo "FAIL"
fi Assessment Script Powered by AISandbox-executed
A standalone Shell script to assess this control automatically. Review before running it in your environment.
Syntax-checked and actually executed in an isolated sandbox (not the real system this checks) — confirmed to run without errors.
#!/bin/sh
# OVAL Definition: oval:mil.disa.fso.rhel11:def:439
if [ ! -f "/etc/modprobe.conf" ]; then echo "PASS"; exit 0; fi
if grep -q "^install[ \t]usb-storage[ \t]/bin/true$" /etc/modprobe.conf; then echo "PASS"; exit 0; fi
if [ ! -d "/etc/modprobe.d" ]; then echo "PASS"; exit 0; fi
for file in /etc/modprobe.d/*; do
if [ -f "$file" ]; then
if grep -q "^install[ \t]usb-storage[ \t]/bin/true$" "$file"; then echo "PASS"; exit 0; fi
fi
done
echo "FAIL"; exit 1