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.hpux11:def:105
# All global initialization files must be group-owned by root, sys, bin, other system, or the system default.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# check /etc/.login file is group-owned by root, bin, sys, or other
# file_object (file_test)
test_1() {
( [ "$(stat -c '%g' '/etc/.login')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/etc/.login')" -eq 1 ] ) || ( [ "$(stat -c '%g' '/etc/.login')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/etc/.login')" -eq 3 ] )
}
# check /etc/profile file is group-owned by root, bin, sys, or other
# file_object (file_test)
test_2() {
( [ "$(stat -c '%g' '/etc/profile')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/etc/profile')" -eq 1 ] ) || ( [ "$(stat -c '%g' '/etc/profile')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/etc/profile')" -eq 3 ] )
}
# check /etc/bashrc file is group-owned by root, bin, sys, or other
# file_object (file_test)
test_3() {
( [ "$(stat -c '%g' '/etc/bashrc')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/etc/bashrc')" -eq 1 ] ) || ( [ "$(stat -c '%g' '/etc/bashrc')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/etc/bashrc')" -eq 3 ] )
}
# check /etc/environment file is group-owned by root, bin, sys, or other
# file_object (file_test)
test_4() {
( [ "$(stat -c '%g' '/etc/environment')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/etc/environment')" -eq 1 ] ) || ( [ "$(stat -c '%g' '/etc/environment')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/etc/environment')" -eq 3 ] )
}
# check /etc/security/environ file is group-owned by root, bin, sys, or other
# file_object (file_test)
test_5() {
( [ "$(stat -c '%g' '/etc/security/environ')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/etc/security/environ')" -eq 1 ] ) || ( [ "$(stat -c '%g' '/etc/security/environ')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/etc/security/environ')" -eq 3 ] )
}
# check /etc/csh.login file is group-owned by root, bin, sys, or other
# file_object (file_test)
test_6() {
( [ "$(stat -c '%g' '/etc/csh.login')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/etc/csh.login')" -eq 1 ] ) || ( [ "$(stat -c '%g' '/etc/csh.login')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/etc/csh.login')" -eq 3 ] )
}
# check /etc/csh.cshrc file is group-owned by root, bin, sys, or other
# file_object (file_test)
test_7() {
( [ "$(stat -c '%g' '/etc/csh.cshrc')" -eq 0 ] ) || ( [ "$(stat -c '%g' '/etc/csh.cshrc')" -eq 1 ] ) || ( [ "$(stat -c '%g' '/etc/csh.cshrc')" -eq 2 ] ) || ( [ "$(stat -c '%g' '/etc/csh.cshrc')" -eq 3 ] )
}
if ( test_1 && test_2 && test_3 && test_4 && test_5 && test_6 && test_7 ); 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.hpux11:def:105
if [ ! -d "/etc" ]; then echo "PASS"; exit 0; fi
if [ -f "/etc/.login" ]; then
gid=$(stat -c "%g" "/etc/.login")
if [ "$gid" != "0" ] && [ "$gid" != "1" ] && [ "$gid" != "2" ] && [ "$gid" != "3" ]; then echo "FAIL"; exit 1; fi
fi
if [ -f "/etc/profile" ]; then
gid=$(stat -c "%g" "/etc/profile")
if [ "$gid" != "0" ] && [ "$gid" != "1" ] && [ "$gid" != "2" ] && [ "$gid" != "3" ]; then echo "FAIL"; exit 1; fi
fi
if [ -f "/etc/bashrc" ]; then
gid=$(stat -c "%g" "/etc/bashrc")
if [ "$gid" != "0" ] && [ "$gid" != "1" ] && [ "$gid" != "2" ] && [ "$gid" != "3" ]; then echo "FAIL"; exit 1; fi
fi
if [ -f "/etc/environment" ]; then
gid=$(stat -c "%g" "/etc/environment")
if [ "$gid" != "0" ] && [ "$gid" != "1" ] && [ "$gid" != "2" ] && [ "$gid" != "3" ]; then echo "FAIL"; exit 1; fi
fi
echo "PASS"; exit 0