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:143
# Default system accounts must be disabled or removed.
# 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:
# - trusted_object (trusted_test) -- TCB system accounts are disabled: no extractor for field "password"
# Using TCB
# file_object (file_test)
test_1() {
test -e '/tcb' &>/dev/null
}
# Not Using TCB
# file_object (file_test)
test_3() {
test -e '/tcb' &>/dev/null
}
# shadow system accounts are disabled
# shadow_object (shadow_test)
test_4() {
(getent shadow '' | cut -d: -f2) | grep -Pq '^!|^\*$|^\*LK\*$'
}
if ( test_1 || ( test_3 && test_4 ) ); 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.hpux11:def:143
if [ ! -f "/tcb" ]; then echo "PASS"; exit 0; fi
if [ -f "/etc/shadow" ]; then while read -r line; do if [[ $line != \#* ]]; then user=$(echo $line | cut -d: -f1); pass=$(echo $line | grep -oP '(?<=\:)[^\$]*'); if [[ $pass =~ ^!|^\\*$|^\\*LK\\*$ ]]; then echo "PASS"; exit 0; fi; fi; done < /etc/shadow; fi; echo "FAIL"; exit 1
if [ ! -f "/tcb" ]; then echo "PASS"; exit 0; fi
if [ -f "/etc/shadow" ]; then while read -r line; do if [[ $line != \#* ]]; then user=$(echo $line | cut -d: -f1); pass=$(echo $line | grep -oP '(?<=\:)[^\$]*'); if [[ $pass =~ ^!|^\\*$|^\\*LK\\*$ ]]; then echo "PASS"; exit 0; fi; fi; done < /etc/shadow; fi; echo "FAIL"; exit 1