<def-group>
  <definition class="compliance" id="accounts_password_pam_tally_deny" version="1">
    <metadata>
      <title>Lock out account after failed login attempts</title>
      <affected family="unix">
        <platform>CentOS 4</platform>
		<platform>CentOS 5</platform>
		<platform>Red Hat Enterprise Linux 4</platform>
		<platform>Red Hat Enterprise Linux 5</platform>
      </affected>
      <description>The number of allowed failed logins should be set correctly.</description>
    </metadata>
    <criteria>
      <criterion comment="default is set to 3" test_ref="test_accounts_password_pam_tally2_deny_system-auth" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="check maximum failed login attempts allowed in /etc/pam.d/system-auth" id="test_accounts_password_pam_tally2_deny_system-auth" version="1">
    <ind:object object_ref="object_accounts_password_pam_tally2_deny_system-auth" />
    <ind:state state_ref="state_accounts_password_pam_tally2_deny_system-auth" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_accounts_password_pam_tally2_deny_system-auth" version="1">
    <ind:path>/etc/pam.d</ind:path>
    <ind:filename>system-auth</ind:filename>
    <ind:pattern operation="pattern match">^auth[\s]+required[\s]+(?:/lib/security/(?:\$ISA/)*)*pam_tally2\.so.*deny=([0-9]*).*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_accounts_password_pam_tally2_deny_system-auth" version="1">
    <ind:subexpression datatype="int" operation="equals" var_ref="var_accounts_password_pam_tally_deny" />
  </ind:textfilecontent54_state>

  <external_variable comment="number of failed login attempts allowed" datatype="int" id="var_accounts_password_pam_tally_deny" version="1" />
</def-group>
