<def-group>
  <definition class="compliance" id="sshd_disable_rhosts_rsa" version="1">
    {{{ oval_metadata("SSH can allow authentication through the obsolete rsh command
      through the use of the authenticating user's SSH keys. This should be disabled.") }}}
    <criteria comment="SSH is configured correctly or is not installed"
    operator="OR">
      <criteria comment="sshd is not installed" operator="AND">
        <extend_definition comment="sshd is not required or requirement is unset"
        definition_ref="sshd_not_required_or_unset" />
        {{% if product in ['opensuse', 'sle12', 'sle15'] %}}
        <extend_definition comment="rpm package openssh removed"
        definition_ref="package_openssh_removed" />
        {{% else %}}
        <extend_definition comment="rpm package openssh-server removed"
        definition_ref="package_openssh-server_removed" />
        {{% endif %}}
      </criteria>
      <criteria comment="sshd is installed and configured" operator="AND">
        <extend_definition comment="sshd is required or requirement is unset"
        definition_ref="sshd_required_or_unset" />
        {{% if product in ['opensuse', 'sle12', 'sle15'] %}}
        <extend_definition comment="rpm package openssh installed"
        definition_ref="package_openssh_installed" />
        {{% else %}}
        <extend_definition comment="rpm package openssh-server installed"
        definition_ref="package_openssh-server_installed" />
        {{% endif %}}
        <criteria comment="SSH version is equal or higher than 7.4 has deprecated RhostsRSAAuthentication" operator="OR">
          <extend_definition comment="OpenSSH version 7.4 or higher has deprecated RhostsRSAAuthentication" definition_ref="sshd_version_equal_or_higher_than_74" />
          <criterion comment="Check RhostsRSAAuthentication in /etc/ssh/sshd_config"
          negate="true" test_ref="test_sshd_disable_rhosts_rsa" />
        </criteria>
      </criteria>
    </criteria>
  </definition>
  <ind:textfilecontent54_test check="all" check_existence="none_exist"
  comment="Tests the value of the RhostsRSAAuthentication[\s]*(&lt;:nocomment:&gt;*) setting in the /etc/ssh/sshd_config file"
  id="test_sshd_disable_rhosts_rsa" version="1">
    <ind:object object_ref="obj_sshd_disable_rhosts_rsa" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="obj_sshd_disable_rhosts_rsa"
  version="2">
    <ind:filepath>/etc/ssh/sshd_config</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*(?i)RhostsRSAAuthentication(?-i)[\s]+no[\s]*(?:#.*)?$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
