<def-group>
  <definition class="compliance" id="accounts_passwords_pam_faillock_interval" version="2">
    <metadata>
      <title>Lock out account after failed login attempts</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 6</platform>
      </affected>
      <description>The number of allowed failed logins should be set correctly.</description>
      <reference source="swells" ref_id="20131025" ref_url="test_attestation" />
    </metadata>
    <criteria>
      <criterion comment="preauth default is set to 900" test_ref="test_accounts_passwords_pam_faillock_fail_interval_system-auth" />
      <criterion comment="authfail default is set to 900" test_ref="test_accounts_passwords_pam_faillock_authfail_fail_interval_system-auth" />
      <criterion comment="authfail default is set to 900" test_ref="test_accounts_passwords_pam_faillock_fail_interval_password-auth" />
      <criterion comment="preauth default is set to 900" test_ref="test_accounts_passwords_pam_faillock_preauth_fail_interval_password-auth" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="check maximum preauth fail_interval allowed in /etc/pam.d/system-auth" id="test_accounts_passwords_pam_faillock_fail_interval_system-auth" version="2">
    <ind:object object_ref="object_accounts_passwords_pam_faillock_fail_interval_system-auth" />
    <ind:state state_ref="state_accounts_passwords_pam_faillock_fail_interval_system-auth" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="check maximum authfail fail_interval allowed in /etc/pam.d/system-auth" id="test_accounts_passwords_pam_faillock_authfail_fail_interval_system-auth" version="2">
    <ind:object object_ref="object_accounts_passwords_pam_faillock_authfail_fail_interval_system-auth" />
    <ind:state state_ref="state_accounts_passwords_pam_faillock_fail_interval_system-auth" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="check maximum authfail fail_interval allowed in /etc/pam.d/password-auth" id="test_accounts_passwords_pam_faillock_fail_interval_password-auth" version="2">
    <ind:object object_ref="object_accounts_passwords_pam_faillock_fail_interval_password-auth" />
    <ind:state state_ref="state_accounts_passwords_pam_faillock_fail_interval_password-auth" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="check maximum preauth fail_interval allowed in /etc/pam.d/password-auth" id="test_accounts_passwords_pam_faillock_preauth_fail_interval_password-auth" version="2">
    <ind:object object_ref="object_accounts_passwords_pam_faillock_preauth_fail_interval_password-auth" />
    <ind:state state_ref="state_accounts_passwords_pam_faillock_fail_interval_password-auth" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_accounts_passwords_pam_faillock_fail_interval_system-auth" version="2">
    <ind:filepath>/etc/pam.d/system-auth</ind:filepath>
    <ind:pattern operation="pattern match">^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth.*fail_interval=([0-9]*).*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_object id="object_accounts_passwords_pam_faillock_authfail_fail_interval_system-auth" version="2">
    <ind:filepath>/etc/pam.d/system-auth</ind:filepath>
    <ind:pattern operation="pattern match">^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*fail_interval=([0-9]*).*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_object id="object_accounts_passwords_pam_faillock_fail_interval_password-auth" version="2">
    <ind:filepath>/etc/pam.d/password-auth</ind:filepath>
    <ind:pattern operation="pattern match">^\s*auth\s+(?:(?:sufficient)|(?:\[default=die\]))\s+pam_faillock\.so\s+authfail.*fail_interval=([0-9]*).*$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_object id="object_accounts_passwords_pam_faillock_preauth_fail_interval_password-auth" version="2">
    <ind:filepath>/etc/pam.d/password-auth</ind:filepath>
    <ind:pattern operation="pattern match">^\s*auth\s+(?:(?:required))\s+pam_faillock\.so\s+preauth.*fail_interval=([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_passwords_pam_faillock_fail_interval_system-auth" version="2">
    <ind:subexpression datatype="int" operation="greater than or equal" var_ref="var_accounts_passwords_pam_faillock_fail_interval" />
  </ind:textfilecontent54_state>

  <ind:textfilecontent54_state id="state_accounts_passwords_pam_faillock_fail_interval_password-auth" version="2">
    <ind:subexpression datatype="int" operation="greater than or equal" var_ref="var_accounts_passwords_pam_faillock_fail_interval" />
  </ind:textfilecontent54_state>

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