<def-group>
  <definition class="compliance" id="aide_verify_ext_attributes" version="1">
    {{{ oval_metadata("AIDE should be configured to verify extended file attributes.", rule_title=rule_title) }}}
    <criteria operator="AND">
      <extend_definition comment="Aide is installed" definition_ref="package_aide_installed" />
      <criterion comment="xattrs is set in {{{ aide_conf_path }}}" test_ref="test_aide_verify_ext_attributes" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test id="test_aide_verify_ext_attributes"
  comment="xattrs is set in {{{ aide_conf_path }}}" check="all"
  check_existence="all_exist" version="1">
    <ind:object object_ref="object_aide_verify_ext_attributes" />
    <ind:state state_ref="state_aide_verify_ext_attributes" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_aide_verify_ext_attributes"
  version="2">
    <ind:filepath>{{{ aide_conf_path }}}</ind:filepath>
    {{% if "debian" in product %}}
    <ind:pattern operation="pattern match">^(?!ALLXTRAHASHES)InodeData[\s]*=[\s]*([a-zA-Z0-9\+]*)$</ind:pattern>
    {{% else %}}
    <ind:pattern operation="pattern match">^(?!ALLXTRAHASHES)[A-Z][a-zA-Z_]*[\s]*=[\s]*([a-zA-Z0-9\+]*)$</ind:pattern>
    {{% endif %}}
    <ind:instance datatype="int" operation="greater than or equal">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_aide_verify_ext_attributes" version="1">
    <ind:subexpression operation="pattern match">^.*xattrs.*$</ind:subexpression>
  </ind:textfilecontent54_state>

</def-group>
