<def-group>
  <definition class="compliance" id="no_rsh_trust_files" version="1">
    <metadata>
      <title>No Legacy .rhosts Or hosts.equiv Files</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 6</platform>
      </affected>
      <description>There should not be any .rhosts or hosts.equiv files on the system.</description>
      <reference source="MED" ref_id="20130807" ref_url="test_attestation" />
    </metadata>
    <criteria operator="AND">
      <criterion test_ref="test_no_rsh_trust_files_root" negate="true" />
      <criterion test_ref="test_no_rsh_trust_files_home" negate="true" />
      <criterion test_ref="test_no_rsh_trust_files_etc" negate="true" />
    </criteria>
  </definition>
  <unix:file_test check="all" check_existence="at_least_one_exists" comment="look for .rhosts or .shosts in /root" id="test_no_rsh_trust_files_root" version="1">
    <unix:object object_ref="object_no_rsh_trust_files_root" />
  </unix:file_test>
  <unix:file_test check="all" check_existence="at_least_one_exists" comment="look for .rhosts or .shosts in /home" id="test_no_rsh_trust_files_home" version="1">
    <unix:object object_ref="object_no_rsh_trust_files_home" />
  </unix:file_test>
  <unix:file_test check="all" check_existence="at_least_one_exists" comment="look for /etc/hosts.equiv or /etc/shosts.equiv" id="test_no_rsh_trust_files_etc" version="1">
    <unix:object object_ref="object_no_rsh_trust_files_etc" />
  </unix:file_test>
  <unix:file_object comment="look for .rhosts or .shosts in /root" id="object_no_rsh_trust_files_root" version="1">
    <unix:path operation="equals">/root</unix:path>
    <unix:filename operation="pattern match">^\.(r|s)hosts$</unix:filename>
  </unix:file_object>
  <unix:file_object comment="look for .rhosts or .shosts in /home" id="object_no_rsh_trust_files_home" version="1">
    <unix:behaviors recurse="directories" recurse_direction="down" max_depth="1" recurse_file_system="all" />
    <unix:path operation="equals">/home</unix:path>
    <unix:filename operation="pattern match">^\.(r|s)hosts$</unix:filename>
  </unix:file_object>
  <unix:file_object comment="look for /etc/hosts.equiv or /etc/shosts.equiv" id="object_no_rsh_trust_files_etc" version="1">
    <unix:path operation="equals">/etc</unix:path>
    <unix:filename operation="pattern match">^s?hosts\.equiv$</unix:filename>
  </unix:file_object>
</def-group>
