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.solaris11:def:158
# System audit tool executables must be group-owned by root, bin, or sys.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# Default comment, please change
# file_object (file_test)
test_1() {
( [ "$(stat -c '%g' '/usr/sbin/auditd')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/auditd')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/auditd')" -eq 3 ] )
}
# Default comment, please change
# file_object (file_test)
test_2() {
( [ "$(stat -c '%g' '/usr/sbin/audit')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/audit')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/audit')" -eq 3 ] )
}
# Default comment, please change
# file_object (file_test)
test_3() {
( [ "$(stat -c '%g' '/usr/sbin/bsmrecord')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/bsmrecord')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/bsmrecord')" -eq 3 ] )
}
# Default comment, please change
# file_object (file_test)
test_4() {
( [ "$(stat -c '%g' '/usr/sbin/auditreduce')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/auditreduce')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/auditreduce')" -eq 3 ] )
}
# Default comment, please change
# file_object (file_test)
test_5() {
( [ "$(stat -c '%g' '/usr/sbin/praudit')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/praudit')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/praudit')" -eq 3 ] )
}
# Default comment, please change
# file_object (file_test)
test_6() {
( [ "$(stat -c '%g' '/usr/sbin/auditconfig')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/auditconfig')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/usr/sbin/auditconfig')" -eq 3 ] )
}
if ! ( test_1 && test_2 && test_3 && test_4 && test_5 && test_6 ); 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.solaris11:def:158
if [ ! -e "/usr/sbin/auditd" ] || [ ! -e "/usr/sbin/audit" ] || [ ! -e "/usr/sbin/bsmrecord" ]; then echo "PASS"; exit 0; fi; if [ "$(stat -c '%G' /usr/sbin/auditd 2>/dev/null)" != root ] && [ "$(stat -c '%G' /usr/sbin/audit 2>/dev/null)" != root ] && [ "$(stat -c '%G' /usr/sbin/bsmrecord 2>/dev/null)" != root ]; then echo "FAIL"; exit 1; fi; if [ "$(stat -c '%G' /usr/sbin/auditd 2>/dev/null)" != bin ] && [ "$(stat -c '%G' /usr/sbin/audit 2>/dev/null)" != bin ] && [ "$(stat -c '%G' /usr/sbin/bsmrecord 2>/dev/null)" != bin ]; then echo "FAIL"; exit 1; fi; if [ "$(stat -c '%G' /usr/sbin/auditd 2>/dev/null)" != sys ] && [ "$(stat -c '%G' /usr/sbin/audit 2>/dev/null)" != sys ] && [ "$(stat -c '%G' /usr/sbin/bsmrecord 2>/dev/null)" != sys ]; then echo "FAIL"; exit 1; fi; echo "PASS"; exit 0