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:13
# An X server must have none of the following options enabled: -ac, -core (except for debugging purposes), or -nolock.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
#
# MANUAL REVIEW REQUIRED -- the module(s) below could not be reconstructed
# into working code from curated SCC reference data, and are excluded from
# the automated result:
# - process58_object (process58_test) -- -ac does not exist: no extractor for field "command_line"
# - process58_object (process58_test) -- -core does not exist: no extractor for field "command_line"
# - process58_object (process58_test) -- -nolock does not exist: no extractor for field "command_line"
# X Windows package is not installed
# rpminfo_object (rpminfo_test)
test_1() {
! ( rpm -q --quiet 'xorg-x11-server-Xorg' &>/dev/null )
}
# /usr/bin/X and /usr/bin/Xorg are not running
# process58_object (process58_test)
test_2() {
! ( ps -eo args | grep -P '^(/usr/bin/Xorg|/usr/bin/X)' &>/dev/null )
}
if ! ( test_1 || ! test_2 ); then
echo "PASS (automated portion only -- MANUAL REVIEW still required, see notes above)"
else
echo "FAIL (or see MANUAL REVIEW note above)"
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:13
if [ ! -f "/usr/bin/Xorg" ] && [ ! -f "/usr/bin/X" ]; then echo "PASS"; exit 0; fi
if [ -f "/etc/gdm/custom.conf" ]; then
grep -qFv "-ac" "/etc/gdm/custom.conf" || { echo "FAIL"; exit 1; }
grep -qFv "-core" "/etc/gdm/custom.conf" || { echo "FAIL"; exit 1; }
grep -qFv "-nolock" "/etc/gdm/custom.conf" || { echo "FAIL"; exit 1; }
else
echo "PASS"; exit 0;
fi
if [ -d "$HOME" ]; then
for file in "$HOME"/.xserverrc; do
if [ -f "$file" ]; then
grep -qFv "-ac" "$file" || { echo "FAIL"; exit 1; }
grep -qFv "-core" "$file" || { echo "FAIL"; exit 1; }
grep -qFv "-nolock" "$file" || { echo "FAIL"; exit 1; }
fi
done
fi
echo "PASS"; exit 0