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.stig.rhel10os:def:281231
# RHEL 10 must be configured so that the Network File System (NFS) is configured to use RPCSEC_GSS.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# NFS mounts have the sec option
# textfilecontent54_object (textfilecontent54_test)
test_1() {
(sed -En 's/^\s*[^#\s][^\s]*\s+[^\s]+\s+nfs[^\s]*\s+([^\s]+)/\1/p' '/etc/fstab') | grep -Pq '(^|,)sec=[^,]+(,|$)'
}
# NFS mounts have one or more sec=krb5p:krb5i:krb5 options
# textfilecontent54_object (textfilecontent54_test)
test_2() {
(sed -En 's/^\s*[^#\s][^\s]*\s+[^\s]+\s+nfs[^\s]*\s+([^\s]+)/\1/p' '/etc/fstab') | grep -Pq '(^|,)sec=([^:,]*:)?krb5[pi]?(:|,|$)'
}
# NFS mounts do not have the sec=sys option
# textfilecontent54_object (textfilecontent54_test)
test_3() {
(sed -En 's/^\s*[^#\s][^\s]*\s+[^\s]+\s+nfs[^\s]*\s+([^\s]+)/\1/p' '/etc/fstab') | grep -Pq '(^|,)sec=([^:,]*:)?sys(:|,|$)'
}
if ( test_1 && test_2 && test_3 ); 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:mil.disa.stig.rhel10os:def:281231
if [ ! -f "/etc/fstab" ]; then
echo "PASS"
exit 0
fi
grep -q '^\\s*[^#\\s][^\\s]*\\s+[^\\s]+\\s+nfs[^\\s]*\\s+([^\\s]+)' /etc/fstab || \
echo "PASS" && exit 0
grep -q '(^|,)sec=([^:,]*:)?krb5[pi]?(:|,|$)' /etc/fstab || \
echo "FAIL" && exit 1
grep -q '(^|,)sec=([^:,]*:)?sys(:|,|$)' /etc/fstab || \
echo "PASS" && exit 0
echo "FAIL"
exit 1