<def-group>
  <definition class="compliance" id="accounts_password_pam_ocredit" version="2">
    <metadata>
      <title>Set Password ocredit Requirements</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 7</platform>
        <platform>multi_platform_fedora</platform>
      </affected>
      <description>The password ocredit should meet minimum requirements</description>
      <reference source="galford" ref_id="20141010" ref_url="test_attestation" />
    </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" />
      <criterion comment="pwquality.conf" test_ref="test_password_pam_pwquality_ocredit" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all"
  comment="check the configuration of /etc/security/pwquality.conf"
  id="test_password_pam_pwquality_ocredit" version="1">
    <ind:object object_ref="obj_password_pam_pwquality_ocredit" />
    <ind:state state_ref="state_password_pam_pwquality_ocredit" />
  </ind:textfilecontent54_test>

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

  <ind:textfilecontent54_state id="state_password_pam_pwquality_ocredit" version="1">
    <ind:instance datatype="int">1</ind:instance>
    <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_pwquality ocredit" datatype="int" id="var_password_pam_ocredit" version="1" />

</def-group>
