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.redhat.rhel6:def:2992
# The system must require administrator action to unlock an account locked by excessive failed login attempts.
# Per-module read mechanism curated from static teardown of DISA's SCC tool
# (SCAP Compliance Checker) -- see the SCC Automation Reference above.
# authfail default unlock_time is set to 0, between 900 and 604800 inclusive, or never for sytem-auth
# textfilecontent54_object (textfilecontent54_test)
test_1() {
( [ "$(sed -En 's/^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth')" -ge 900 ] ) || ( (sed -En 's/^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth') | grep -qxF 'never' ) || ( [ "$(sed -En 's/^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth')" -eq 0 ] )
}
# authsucc unlock_time is set to 0, between 900 and 604800 inclusive, or never for system-auth
# textfilecontent54_object (textfilecontent54_test)
test_2() {
( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+authsucc.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth')" -ge 900 ] ) || ( (sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+authsucc.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth') | grep -qxF 'never' ) || ( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+authsucc.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth')" -eq 0 ] )
}
# preauth default unlock_time is set to 0, between 900 and 604800 inclusive, or never for system-auth
# textfilecontent54_object (textfilecontent54_test)
test_3() {
( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth\s+(?:silent)?.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth')" -ge 900 ] ) || ( (sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth\s+(?:silent)?.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth') | grep -qxF 'never' ) || ( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth\s+(?:silent)?.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/system-auth')" -eq 0 ] )
}
# account required pam-faillock.so is set for system-auth
# textfilecontent54_object (textfilecontent54_test)
test_4() {
grep -Pq '^\s*account\s+(?:(?:required))\s+pam_faillock\.so\s*$' '/etc/pam.d/system-auth' &>/dev/null
}
# authfail default unlock_time is set to 0, between 900 and 604800 inclusive, or never for password-auth
# textfilecontent54_object (textfilecontent54_test)
test_5() {
( [ "$(sed -En 's/^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth')" -ge 900 ] ) || ( (sed -En 's/^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth') | grep -qxF 'never' ) || ( [ "$(sed -En 's/^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth')" -eq 0 ] )
}
# authsucc unlock_time is set to 0, between 900 and 604800 inclusive, or never for password-auth
# textfilecontent54_object (textfilecontent54_test)
test_6() {
( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+authsucc.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth')" -ge 900 ] ) || ( (sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+authsucc.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth') | grep -qxF 'never' ) || ( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+authsucc.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth')" -eq 0 ] )
}
# preauth default unlock_time is set to 0, between 900 and 604800 inclusive, or never for password-auth
# textfilecontent54_object (textfilecontent54_test)
test_7() {
( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth\s+(?:silent)?.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth')" -ge 900 ] ) || ( (sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth\s+(?:silent)?.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth') | grep -qxF 'never' ) || ( [ "$(sed -En 's/^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth\s+(?:silent)?.*\s+unlock_time=([0-9]+|never).*$/\1/p' '/etc/pam.d/password-auth')" -eq 0 ] )
}
# account required pam-faillock.so is set for password-auth
# textfilecontent54_object (textfilecontent54_test)
test_8() {
grep -Pq '^\s*account\s+(?:(?:required))\s+pam_faillock\.so\s*$' '/etc/pam.d/password-auth' &>/dev/null
}
if ( ( test_1 && ( test_2 || ( test_3 && test_4 ) ) ) && ( test_5 && ( test_6 || ( test_7 && test_8 ) ) ) ); 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
# DISA STIG RHEL6 oval:mil.disa.fso.redhat.rhel6:def:2992
if [ ! -f "/etc/pam.d/system-auth" ]; then echo "PASS"; exit 0; fi
if grep -q "^\\s*auth\\s+required\\s+pam_faillock\\.so\\s+preauth\\s+silent\\s+deny=3\\s+unlock_time=900\\s+fail_interval=900" /etc/pam.d/system-auth && grep -q "^\\s*auth\\s+\\[default=die\\]\\s+pam_faillock\\.so\\s+authfail\\s+deny=3\\s+unlock_time=" /etc/pam.d/system-auth ]; then echo "PASS"; exit 0; else echo "FAIL"; exit 1; fi