


<def-group>
  <definition class="compliance" id="accounts_password_pam_ocredit" version="3">
    <metadata>
        <title>Ensure PAM Enforces Password Requirements - Minimum Special Characters</title>
        
    <affected family="unix">
    <platform>Ubuntu 22.04</platform>
    </affected>
        <description>The password ocredit should meet minimum requirements</description>
    </metadata>
    <criteria operator="AND" comment="conditions for ocredit are satisfied">
      <extend_definition comment="pwquality.so exists in system-auth" definition_ref="accounts_password_pam_pwquality" />
      <criteria operator="OR">
        <criterion comment="pwquality.conf" test_ref="test_password_pam_pwquality_ocredit" />
      </criteria>
      
    </criteria>
  </definition>

  

  <ind:textfilecontent54_test check="all" state_operator="AND"
    comment="check the configuration of ^/etc/security/pwquality.conf$"
    id="test_password_pam_pwquality_ocredit" version="3">
    <ind:object object_ref="obj_password_pam_pwquality_ocredit" />
    <ind:state state_ref="state_password_pam_ocredit" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="obj_password_pam_pwquality_ocredit" version="3">
    <ind:filepath operation="pattern match">^/etc/security/pwquality.conf$</ind:filepath>
    <ind:pattern operation="pattern match">^\s*ocredit[\s]*=[\s]*(-?\d+)(?:[\s]|$)</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_password_pam_ocredit" version="3">
    <ind:subexpression datatype="int" operation="less than or equal" var_ref="var_password_pam_ocredit" />
  </ind:textfilecontent54_state>

  <external_variable comment="External variable for pam_ocredit" datatype="int" id="var_password_pam_ocredit" version="3" />
</def-group>