<def-group>
  <definition class="compliance" id="no_rsh_trust_files" version="1">
    {{{ oval_metadata("There should not be any .rhosts or hosts.equiv files on the system.", rule_title=rule_title) }}}
    <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 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 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" 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 in /root" id="object_no_rsh_trust_files_root" version="1">
    <unix:path operation="equals">/root</unix:path>
    <unix:filename operation="pattern match">^\.rhosts$</unix:filename>
  </unix:file_object>
  <unix:file_object comment="look for .rhosts 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">^\.rhosts$</unix:filename>
  </unix:file_object>
  <unix:file_object comment="look for /etc/hosts.equiv" id="object_no_rsh_trust_files_etc" version="1">
    <unix:path operation="equals">/etc</unix:path>
    <unix:filename operation="pattern match">^hosts\.equiv$</unix:filename>
  </unix:file_object>
</def-group>
