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.stig.solaris11:def:137
# The system must disable accounts after three consecutive unsuccessful login attempts.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# LOCK_AFTER_RETRIES == YES in /etc/security/policy.conf
# textfilecontent54_object (textfilecontent54_test)
test_1() {
(sed -En 's/^\s*LOCK_AFTER_RETRIES=(\S+)\s*$/\1/p' '/etc/security/policy.conf') | grep -qxF 'YES'
}
# RETRIES <= 3 in /etc/default/login
# textfilecontent54_object (textfilecontent54_test)
test_2() {
[ "$(sed -En 's/^\s*RETRIES=(\d+)\s*$/\1/p' '/etc/default/login')" -le 3 ]
}
# lock_after_retries != no in /etc/user_attr
# textfilecontent54_object (textfilecontent54_test)
test_3() {
(sed -En 's/^[^:#]+:[^:#]*:[^:#]*:[^:#]*:[^:#]*(?:[^:#]*;)?lock_after_retries=([^;\s]+)(?:;|\s|$)/\1/p' '/etc/user_attr') | grep -qxF 'no'
}
if ( test_1 && test_2 && test_3 ); 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.stig.solaris11:def:137
if grep -q '^\\s*LOCK_AFTER_RETRIES=YES\\s*$' /etc/security/policy.conf && \
grep -q '^\\s*RETRIES=[0-3]\\s*$' /etc/default/login && \
! grep -q '^[^:#]+:[^:#]*:[^:#]*:[^:#]*:[^:#]*(?:[^:#]*;)?lock_after_retries=no(?:;|\\s|$)' /etc/user_attr
then
echo "PASS"
else
echo "FAIL"
fi
exit 1