
   


<def-group>
  <definition class="compliance" id="accounts_passwords_pam_faildelay_delay" version="3">
    <metadata>
        <title>Enforce Delay After Failed Logon Attempts</title>
        
    <affected family="unix">
    <platform>Ubuntu 22.04</platform>
    </affected>
        <description>Configure PAM module</description>
    </metadata>
    <criteria operator="AND" comment="Make sure arguments are properly configured">


      <criterion test_ref="test_pam_auth_pam_faildelay_delay" comment="Verify delay is set to the desired state" />


    </criteria>
  </definition>



  <ind:textfilecontent54_test id="test_pam_auth_pam_faildelay_delay"
  check="all"
  comment="Verify delay configuation of pam_faildelay.so" version="1">
    <ind:object object_ref="object_pam_auth_pam_faildelay_delay" />
    <ind:state state_ref="state_pam_auth_pam_faildelay_delay" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_pam_auth_pam_faildelay_delay" comment="Check delay configuration of PAM pam_faildelay.so module" version="1">
    <ind:filepath>/etc/pam.d/common-auth</ind:filepath>
    <ind:pattern operation="pattern match">^\s*auth\s+required\s+pam_faildelay.so.*\sdelay=(-?\d+)(?:\s+.*)?</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_pam_auth_pam_faildelay_delay" version="3">
    <ind:subexpression datatype="int" operation="greater than or equal" var_ref="var_password_pam_delay" />
  </ind:textfilecontent54_state>

  <external_variable comment="PAM external variable var_password_pam_delay" datatype="int" id="var_password_pam_delay" version="1" />


</def-group>