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:3
# The audit system must alert the System Administrator (SA) if there is any type of audit failure.
# 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 )
}
# There must be an audit_warn entry listed in /etc/mail/aliases.
# textfilecontent54_object (textfilecontent54_test)
test_7() {
grep -Pq '^audit_warn:\s*\S+\s*$' '/etc/mail/aliases' &>/dev/null
}
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:3
if [ "$(uname -r | grep -oE '[0-9]+\.[0-3]')" != "$(uname -v | grep -oE '[0-9]+\.[0-3]')" ]; then
echo "PASS"
exit 0
fi
if [ ! -f /etc/zones/index ]; then
echo "PASS"
exit 0
fi
if [ "$(grep -c ^global: /etc/zones/index)" -ge 1 ]; then
if [ ! -f /etc/mail/aliases ]; then
echo "PASS"
exit 0
fi
if [ "$(grep -c audit_warn: /etc/mail/aliases)" -eq 0 ]; then
echo "FAIL"
exit 1
else
echo "PASS"
exit 0
fi
else
echo "PASS"
exit 0
fi