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.solaris11:def:125
# Logins to the root account must be restricted to the system console only.
# 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:
# - uname_object (uname_test) -- OS version is less than 11.4: no extractor for field "os_version"
# - uname_object (uname_test) -- OS version is not less than 11.4: no extractor for field "os_version"
# /etc/zones/index does not exist
# file_object (file_test)
test_2() {
! ( test -e '/etc/zones/index' &>/dev/null )
}
# /etc/zones/index contains global
# textfilecontent54_object (textfilecontent54_test)
test_3() {
grep -Pq '^global:' '/etc/zones/index' &>/dev/null
}
# /var/share/zones/index.json does not exist
# file_object (file_test)
test_5() {
! ( test -e '/var/share/zones/index.json' &>/dev/null )
}
# /var/share/zones/index.json does not contain 'path:/'
# textfilecontent54_object (textfilecontent54_test)
test_6() {
! ( grep -Pq '"path":\s+"/"' '/var/share/zones/index.json' &>/dev/null )
}
# /etc/default/login CONSOLE=/dev/console
# textfilecontent54_object (textfilecontent54_test)
test_7() {
(sed -En 's/^\s*CONSOLE=(\S+)\s*$/\1/p' '/etc/default/login') | grep -qxF '/dev/console'
}
if ( ( ( test_2 || test_3 ) && ( test_5 || test_6 ) ) || test_7 ); 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.stig.solaris11:def:125
if [ ! -f "/etc/default/login" ]; then echo "PASS"; exit 0; fi
if [ ! $(grep -q "^CONSOLE=/dev/console" /etc/default/login) ]; then echo "FAIL"; exit 1; fi
if [ ! -f "/etc/zones/index" ]; then echo "PASS"; exit 0; fi
if [ $(grep -q "^global:" /etc/zones/index) ]; then echo "FAIL"; exit 1; fi
if [ ! -f "/var/share/zones/index.json" ]; then echo "PASS"; exit 0; fi
if [ $(grep -q "\"path\":\"/" /var/share/zones/index.json) ]; then echo "FAIL"; exit 1; fi
echo "PASS"; exit 0