<def-group>
  <definition class="compliance" id="sssd_ldap_configure_tls_ca_dir" version="1">
    {{{ oval_metadata("Configure SSSD to implement cryptography to protect the integrity of LDAP remote access sessions.") }}}
    <criteria>
      <criterion test_ref="test_sssd_ldap_tls_ca_dir" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="Ensures that LDAP TLS CA certificate directory is set"
  id="test_sssd_ldap_tls_ca_dir" version="1">
    <ind:object object_ref="object_sssd_ldap_tls_ca_dir" />
    <ind:state state_ref="state_sssd_ldap_tls_ca_dir" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_state id="state_sssd_ldap_tls_ca_dir" version="1">
    <ind:subexpression operation="equals" var_check="all"
    var_ref="var_sssd_ldap_tls_ca_dir" />
  </ind:textfilecontent54_state>

  <external_variable comment="External variable: path of the X.509 certificates in /etc/sssd/sssd.conf"
  datatype="string" id="var_sssd_ldap_tls_ca_dir" version="1" />

  <ind:textfilecontent54_object id="object_sssd_ldap_tls_ca_dir" version="2">
    <ind:filepath operation="pattern match">/etc/sssd/(sssd\.conf|conf.d/[^/]+\.conf)</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*\[domain\/[^]]*](?:[^\n[\]]*\n+)+?[\s]*ldap_tls_cacertdir[\s]+=[\s]+([^\s]+)[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
