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:361
# The SSH daemon must be configured with the Department of Defense (DoD) logon banner.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# Conditions are satisfied with the filepath defined for banner in /etc/ssh/sshd_config
# textfilecontent54_object (textfilecontent54_test)
test_1() {
grep -P '(^\s*You\s+are\s+accessing\s+a\s+U\.S\.\s+Government\s+\(USG\)\s+Information\s+System\s+\(IS\)\s+that\s+is\s+provided\s+for\s+USG[-]authorized\s+use\s+only\.\s+By\s+using\s+this\s+IS\s+\(which\s+includes\s+any\s+device\s+attached\s+to\s+this\s+IS\),\s+you\s+consent\s+to\s+the\s+following\s+conditions:\s+[-]+\s*The\s+USG\s+routinely\s+intercepts\s+and\s+monitors\s+communications\s+on\s+this\s+IS\s+for\s+purposes\s+including,\s+but\s+not\s+limited\s+to,\s+penetration\s+testing,\s+COMSEC\s+monitoring,\s+network\s+operations\s+and\s+defense,\s+personnel\s+misconduct\s+\(PM\),\s+law\s+enforcement\s+\(LE\),\s+and\s+counterintelligence\s+\(CI\)\s+investigations\.\s+[-]+\s*At\s+any\s+time,\s+the\s+USG\s+may\s+inspect\s+and\s+seize\s+data\s+stored\s+on\s+this\s+IS\.\s+[-]+\s*Communications\s+using,\s+or\s+data\s+stored\s+on,\s+this\s+IS\s+are\s+not\s+private,\s+are\s+subject\s+to\s+routine\s+monitoring,\s+interception,\s+and\s+search,\s+and\s+may\s+be\s+disclosed\s+or\s+used\s+for\s+any\s+USG[-]authorized\s+purpose\.\s+[-]+\s*This\s+IS\s+includes\s+security\s+measures\s+\(e\.g\.,\s+authentication\s+and\s+access\s+controls\)\s+to\s+protect\s+USG\s+interests[-]+\s*[-]+\s*not\s+for\s+your\s+personal\s+benefit\s+or\s+privacy\.\s+[-]+\s*Notwithstanding\s+the\s+above,\s+using\s+this\s+IS\s+does\s+not\s+constitute\s+consent\s+to\s+PM,\s+LE\s+or\s+CI\s+investigative\s+searching\s+or\s+monitoring\s+of\s+the\s+content\s+of\s+privileged\s+communications,\s+or work product,\s+related\s+to\s+personal\s+representation\s+or\s+services\s+by\s+attorneys,\s+psychotherapists,\s+or\s+clergy,\s+and\s+their\s+assistants\.\s+Such\s+communications\s+and\s+work\s+product\s+are\s+private\s+and\s+confidential\.\s+See\s+User\s+Agreement\s+for\s+details\.|I've\s+read\s+&\s+consent\s+to\s+terms\s+in\s+IS\s+user\s+agreem't\.)' &>/dev/null
}
# Banner is defined in /etc/ssh/sshd_config
# textfilecontent54_object (textfilecontent54_test)
test_2() {
grep -Pq '^\s*[Bb][Aa][Nn][Nn][Ee][Rr]\s+(\S+)\s*$' '/etc/ssh/sshd_config' &>/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:361
if [ ! -f "/etc/issue" ] || ! grep -q "^You are accessing a U\.S\. Government \(USG\) Information System \(IS\) that is provided for USG-authorized use only\.$" "/etc/issue"; then
echo "FAIL"
exit 1
fi
if [ ! -f "/etc/ssh/sshd_config" ] || ! grep -q "^Banner /etc/issue$" "/etc/ssh/sshd_config"; then
echo "FAIL"
exit 1
fi
echo "PASS"
exit 0