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:373
# The Network File System (NFS) server must not allow remote root access.
# 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:
# - variable_object (variable_test) -- all_squash or root_squash are used in each nfs otpions: no extractor for field "value"
# No entries exist in /etc/exports
# textfilecontent54_object (textfilecontent54_test)
test_1() {
! ( grep -Pq '^\s*([^\n#]+)' '/etc/exports' &>/dev/null )
}
# nfs empty options
# textfilecontent54_object (textfilecontent54_test)
test_2() {
(sed -En 's/^\s*([^\n#]+)/\1/p' '/etc/exports') | grep -Pq 'no_root_squash'
}
# all export lines have an option set defined
# textfilecontent54_object (textfilecontent54_test)
test_4() {
(sed -En 's/^\s*([^\n#]+)/\1/p' '/etc/exports') | grep -Pq '.*\(.*'
}
if ! ( test_1 || ! ( test_2 && test_4 ) ); 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:373
if [ ! -f "/etc/exports" ]; then echo "PASS"; exit 0; fi
if grep -q "no_root_squash" /etc/exports && ! grep -q "root_squash" /etc/exports && ! grep -q "all_squash" /etc/exports; then echo "FAIL"; exit 1; fi
echo "PASS"
exit 0