
<def-group>
  <definition class="compliance" id="accounts_password_pam_enforce_local" version="1">
    <metadata>
        <title>Ensure PAM Enforces Password Requirements - Enforce for Local Accounts Only</title>
        
    <affected family="unix">
    <platform>Ubuntu 22.04</platform>
    </affected>
        <description>Check presence of local_users_only in /etc/security/pwquality.conf</description>
    </metadata>
    <criteria operator="AND" comment="Test conditions - presence of the file plus 1 extra definitions.">
     <extend_definition comment="extend_definition added explicitly" definition_ref="accounts_password_pam_pwquality" />
      <criterion comment="Check that /etc/security/pwquality.conf contains a line with certain text" test_ref="test_accounts_password_pam_enforce_local" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all"
  comment="tests the presence of 'local_users_only' setting in the /etc/security/pwquality.conf file"
  id="test_accounts_password_pam_enforce_local" version="1">
  <ind:object object_ref="obj_accounts_password_pam_enforce_local" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="obj_accounts_password_pam_enforce_local" version="1">
    <ind:filepath>/etc/security/pwquality.conf</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*local_users_only[\s]*$</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>