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.aix11:def:135
# All shell files must have mode 0755 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) -- Test the mode of each listed shell to make sure it is 0755 or less permissive.: no extractor for field "sticky"
# - file_object (file_test) -- Test the mode of each listed shell to make sure it is 0755 or less permissive.: no extractor for field "sticky"
# Test if /etc/security/login.cfg has any shells listed.
# textfilecontent54_object (textfilecontent54_test)
test_1() {
grep -Pq '^[^\*]*\s*[sS][hH][eE][lL][lL][sS][ ]=[ ](\S+)\s*$' '/etc/security/login.cfg' &>/dev/null
}
# Test if /etc/shells has any shells listed.
# textfilecontent54_object (textfilecontent54_test)
test_3() {
grep -Pq '^\s*([^\:\*\#\s]+)\s*$' '/etc/shells' &>/dev/null
}
if ( test_1 && test_3 ); 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.aix11:def:135
if [ ! -f "/etc/security/login.cfg" ]; then echo "PASS"; exit 0; fi
if [ ! -p "/etc/security/login.cfg" ]; then echo "PASS"; exit 0; fi
grep -q "^[^\\*]*\\s*[sS][hH][eE][lL][lL][sS][ ]=[ ](\\S+)\\s*$" /etc/security/login.cfg || exit 0
for shell in $(grep -o "^[^\\*]*\\s*[sS][hH][eE][lL][lL][sS][ ]=[ ](\\S+)\\s*$" /etc/security/login.cfg); do
[ ! -f "/$shell" ] && continue
stat -c "%a %n" "/$shell" | awk '{if ($1 > 0755) {print "FAIL"; exit 1}}'
done
if [ ! -f "/etc/shells" ]; then echo "PASS"; exit 0; fi
if [ ! -p "/etc/shells" ]; then echo "PASS"; exit 0; fi
grep -q "^\\s*([^\\:\\*\\#\\s]+)\\s*$" /etc/shells || exit 0
for shell in $(grep -o "^\\s*([^\\:\\*\\#\\s]+)\\s*$" /etc/shells); do
[ ! -f "/$shell" ] && continue
stat -c "%a %n" "/$shell" | awk '{if ($1 > 0755) {print "FAIL"; exit 1}}'
done
echo "PASS"; exit 0