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:79
# System log files must have mode 0640 or less permissive.
# 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:
# - file_object (file_test) -- Check /var/log permissions: <set> composition (base object oval:mil.disa.fso.solaris11:obj:7900): member unresolved -- no extractor for field "gexec"
# - file_object (file_test) -- Check /var/adm permissions: <set> composition (base object oval:mil.disa.fso.solaris11:obj:7902): member unresolved -- no extractor for field "gexec"
# Check /var/log/syslog permissions
# file_object (file_test)
test_2() {
( (stat -c '%A' '/var/log/syslog' | awk '{print (substr($0,7,1)=="x" || substr($0,7,1)=="s")?"true":"false"}') | grep -qxF 'false' ) && ( (stat -c '%A' '/var/log/syslog' | awk '{print (substr($0,10,1)=="x" || substr($0,10,1)=="t")?"true":"false"}') | grep -qxF 'false' ) && ( (stat -c '%A' '/var/log/syslog' | awk '{print (substr($0,8,1)=="r")?"true":"false"}') | grep -qxF 'false' ) && ( (stat -c '%A' '/var/log/syslog' | awk '{print (substr($0,9,1)=="w")?"true":"false"}') | grep -qxF 'false' ) && ( (stat -c '%A' '/var/log/syslog' | awk '{print (substr($0,6,1)=="w")?"true":"false"}') | grep -qxF 'false' ) && ( (stat -c '%A' '/var/log/syslog' | awk '{print (substr($0,4,1)=="x" || substr($0,4,1)=="s")?"true":"false"}') | grep -qxF 'false' )
}
if ! test_2; 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.fso.solaris11:def:79
if [ ! -d "/var/log" ]; then echo "PASS"; exit 0; fi; for path in /var/log/*; do [ -f "$path" ] && stat -c "%a" "$path" | grep -q "^[0-6]{3}$" || echo "FAIL"; exit 1; done; if [ ! -f "/var/log/syslog" ]; then echo "PASS"; exit 0; fi; stat -c "%a" /var/log/syslog | grep -q "^[0-6]{3}$" || echo "FAIL"; exit 1; if [ ! -d "/var/adm" ]; then echo "PASS"; exit 0; fi; for path in /var/adm/*; do [ -f "$path" ] && stat -c "%a" "$path" | grep -q "^[0-6]{3}$" || echo "FAIL"; exit 1; done; echo "PASS"; exit 0