<def-group>
  <definition class="compliance" id="configure_libreswan_crypto_policy" version="1">
    {{{ oval_metadata("Libreswan should be configured to use the system-wide crypto policy setting.") }}}
    <criteria operator="OR">
      <extend_definition comment="Check if package libreswan is not installed" definition_ref="package_libreswan_installed" negate="true" />
      <criterion test_ref="test_configure_libreswan_crypto_policy"
        comment="Check that the libreswan configuration includes the crypto policy config file" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test id="test_configure_libreswan_crypto_policy"
    comment="Check that the libreswan configuration includes the crypto policy config file"
    check="all" check_existence="all_exist" version="1">
    <ind:object object_ref="object_configure_libreswan_crypto_policy" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_configure_libreswan_crypto_policy"
  version="1">
    <ind:filepath>/etc/ipsec.conf</ind:filepath>
    <ind:pattern operation="pattern match">^\s*include\s+/etc/crypto-policies/back-ends/libreswan.config\s*(?:#.*)?$</ind:pattern>
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
