<?xml version='1.0' encoding='utf-8'?>
<oval-def:oval_definitions xmlns:ind="http://oval.mitre.org/XMLSchema/oval-definitions-5#independent" xmlns:linux="http://oval.mitre.org/XMLSchema/oval-definitions-5#linux" xmlns:oval="http://oval.mitre.org/XMLSchema/oval-common-5" xmlns:oval-def="http://oval.mitre.org/XMLSchema/oval-definitions-5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://oval.mitre.org/XMLSchema/oval-common-5 oval-common-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5 oval-definitions-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5#independent independent-definitions-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5#unix unix-definitions-schema.xsd  http://oval.mitre.org/XMLSchema/oval-definitions-5#linux linux-definitions-schema.xsd">
  <oval-def:generator>
    <oval:product_name>OVALFileLinker from SCAP Security Guide</oval:product_name>
    <oval:product_version>ssg: [0, 1, 80], python: 3.10.12</oval:product_version>
    <oval:schema_version>5.11.2</oval:schema_version>
    <oval:timestamp>2025-12-02T22:12:11</oval:timestamp>
  </oval-def:generator>
  <oval-def:definitions>
    <oval-def:definition id="oval:ssg-disable_host_auth:def:1" version="1" class="compliance">
      <oval-def:metadata>
        <oval-def:title>Disable Host-Based Authentication</oval-def:title>
        <oval-def:affected family="unix">
          <oval-def:platform>Ubuntu 22.04</oval-def:platform>
        </oval-def:affected>
        <oval-def:reference ref_id="disable_host_auth" source="ssg" />
        <oval-def:description>Ensure 'HostbasedAuthentication' is configured with value 'no' in /etc/ssh/sshd_config or in /etc/ssh/sshd_config.d</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria comment="sshd is configured correctly or is not installed" operator="OR">
        <oval-def:criteria comment="sshd is not installed" operator="AND">
          <oval-def:extend_definition comment="sshd is not required or requirement is unset" definition_ref="oval:ssg-sshd_not_required_or_unset:def:1" />
          <oval-def:extend_definition comment="rpm package openssh-server removed" definition_ref="oval:ssg-package_openssh-server_removed:def:1" />
        </oval-def:criteria>
        <oval-def:criteria comment="sshd is installed and configured" operator="AND">
          <oval-def:extend_definition comment="sshd is required or requirement is unset" definition_ref="oval:ssg-sshd_required_or_unset:def:1" />
          <oval-def:extend_definition comment="rpm package openssh-server installed" definition_ref="oval:ssg-package_openssh-server_installed:def:1" />
          <oval-def:criteria comment="sshd is configured correctly" operator="AND">
            <oval-def:criteria comment="the configuration is correct if it exists" operator="AND">
              <oval-def:criterion comment="Check the HostbasedAuthentication in /etc/ssh/sshd_config if any" test_ref="oval:ssg-test_disable_host_auth:tst:1" />
              <oval-def:criterion comment="Check the HostbasedAuthentication in /etc/ssh/sshd_config.d if any" test_ref="oval:ssg-test_disable_host_auth_config_dir:tst:1" />
            </oval-def:criteria>
            <oval-def:criterion comment="the configuration exists" test_ref="oval:ssg-test_HostbasedAuthentication_present_disable_host_auth:tst:1" />
          </oval-def:criteria>
        </oval-def:criteria>
      </oval-def:criteria>
    </oval-def:definition>
    <oval-def:definition id="oval:ssg-package_openssh-server_installed:def:1" version="1" class="compliance">
      <oval-def:metadata>
        <oval-def:title>Install the OpenSSH Server Package</oval-def:title>
        <oval-def:affected family="unix">
          <oval-def:platform>Ubuntu 22.04</oval-def:platform>
        </oval-def:affected>
        <oval-def:reference ref_id="package_openssh-server_installed" source="ssg" />
        <oval-def:description>The DPKG package openssh-server should be installed.</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria operator="AND">
        <oval-def:criterion comment="package openssh-server is installed" test_ref="oval:ssg-test_package_openssh-server_installed:tst:1" />
      </oval-def:criteria>
    </oval-def:definition>
    <oval-def:definition id="oval:ssg-package_openssh-server_removed:def:1" version="1" class="compliance">
      <oval-def:metadata>
        <oval-def:title>Remove the OpenSSH Server Package</oval-def:title>
        <oval-def:affected family="unix">
          <oval-def:platform>Ubuntu 22.04</oval-def:platform>
        </oval-def:affected>
        <oval-def:reference ref_id="package_openssh-server_removed" source="ssg" />
        <oval-def:description>The DPKG package openssh-server should be removed.</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria operator="AND">
        <oval-def:criterion comment="package openssh-server is removed" test_ref="oval:ssg-test_package_openssh-server_removed:tst:1" />
      </oval-def:criteria>
    </oval-def:definition>
    <oval-def:definition id="oval:ssg-sshd_not_required_or_unset:def:1" version="1" class="compliance">
      <oval-def:metadata>
        <oval-def:title>SSHD is not required to be installed or requirement not set</oval-def:title>
        <oval-def:affected family="unix">
          <oval-def:platform>Ubuntu 22.04</oval-def:platform>
        </oval-def:affected>
        <oval-def:reference ref_id="sshd_not_required_or_unset" source="ssg" />
        <oval-def:description>If SSHD is not required, we check it is not installed. If SSH requirement is unset, we are good.</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria comment="SSH not required or not set" operator="OR">
        <oval-def:criterion test_ref="oval:ssg-test_sshd_not_required:tst:1" />
        <oval-def:extend_definition comment="SSH requirement is unset" definition_ref="oval:ssg-sshd_requirement_unset:def:1" />
      </oval-def:criteria>
    </oval-def:definition>
    <oval-def:definition id="oval:ssg-sshd_required_or_unset:def:1" version="1" class="compliance">
      <oval-def:metadata>
        <oval-def:title>SSHD is required to be installed or requirement not set</oval-def:title>
        <oval-def:affected family="unix">
          <oval-def:platform>Ubuntu 22.04</oval-def:platform>
        </oval-def:affected>
        <oval-def:reference ref_id="sshd_required_or_unset" source="ssg" />
        <oval-def:description>If SSHD is required, we check it is installed. If SSH requirement is unset, we are good.</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria comment="SSH required or not set" operator="OR">
        <oval-def:criterion test_ref="oval:ssg-test_sshd_required:tst:1" />
        <oval-def:extend_definition comment="SSH requirement is unset" definition_ref="oval:ssg-sshd_requirement_unset:def:1" />
      </oval-def:criteria>
    </oval-def:definition>
    <oval-def:definition id="oval:ssg-sshd_requirement_unset:def:1" version="1" class="compliance">
      <oval-def:metadata>
        <oval-def:title>It doesn't matter if sshd is installed or not</oval-def:title>
        <oval-def:affected family="unix">
          <oval-def:platform>Ubuntu 22.04</oval-def:platform>
        </oval-def:affected>
        <oval-def:reference ref_id="sshd_requirement_unset" source="ssg" />
        <oval-def:description>Test if value sshd_required is 0.</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria operator="AND">
        <oval-def:criterion test_ref="oval:ssg-test_sshd_requirement_unset:tst:1" />
      </oval-def:criteria>
    </oval-def:definition>
  </oval-def:definitions>
  <oval-def:tests>
    <ind:textfilecontent54_test id="oval:ssg-test_disable_host_auth:tst:1" version="1" check="all" comment="tests the value of HostbasedAuthentication setting in the /etc/ssh/sshd_config file" check_existence="any_exist" state_operator="AND">
      <ind:object object_ref="oval:ssg-obj_disable_host_auth:obj:1" />
      <ind:state state_ref="oval:ssg-state_disable_host_auth:ste:1" />
    </ind:textfilecontent54_test>
    <ind:textfilecontent54_test id="oval:ssg-test_disable_host_auth_config_dir:tst:1" version="1" check="all" comment="tests the value of HostbasedAuthentication setting in the /etc/ssh/sshd_config.d file" check_existence="any_exist" state_operator="AND">
      <ind:object object_ref="oval:ssg-obj_disable_host_auth_config_dir:obj:1" />
      <ind:state state_ref="oval:ssg-state_disable_host_auth_config_dir:ste:1" />
    </ind:textfilecontent54_test>
    <ind:textfilecontent54_test id="oval:ssg-test_HostbasedAuthentication_present_disable_host_auth:tst:1" version="1" check="all" comment="Verify that the value of HostbasedAuthentication is present" state_operator="AND">
      <ind:object object_ref="oval:ssg-obj_collection_obj_disable_host_auth:obj:1" />
    </ind:textfilecontent54_test>
    <linux:dpkginfo_test id="oval:ssg-test_package_openssh-server_installed:tst:1" version="1" check="all" comment="package openssh-server is installed" check_existence="all_exist" state_operator="AND">
      <linux:object object_ref="oval:ssg-obj_test_package_openssh-server_installed:obj:1" />
    </linux:dpkginfo_test>
    <linux:dpkginfo_test id="oval:ssg-test_package_openssh-server_removed:tst:1" version="1" check="all" comment="package openssh-server is removed" check_existence="none_exist" state_operator="AND">
      <linux:object object_ref="oval:ssg-obj_test_package_openssh-server_removed:obj:1" />
    </linux:dpkginfo_test>
    <ind:variable_test id="oval:ssg-test_sshd_not_required:tst:1" version="1" check="all" comment="Verify if Profile set Value sshd_required as not required" state_operator="AND">
      <ind:object object_ref="oval:ssg-object_sshd_not_required:obj:1" />
      <ind:state state_ref="oval:ssg-state_sshd_not_required:ste:1" />
    </ind:variable_test>
    <ind:variable_test id="oval:ssg-test_sshd_required:tst:1" version="1" check="all" comment="Verify if Profile set Value sshd_required as required" state_operator="AND">
      <ind:object object_ref="oval:ssg-object_sshd_required:obj:1" />
      <ind:state state_ref="oval:ssg-state_sshd_required:ste:1" />
    </ind:variable_test>
    <ind:variable_test id="oval:ssg-test_sshd_requirement_unset:tst:1" version="1" check="all" comment="Verify if Value of sshd_required is the default" state_operator="AND">
      <ind:object object_ref="oval:ssg-object_sshd_requirement_unknown:obj:1" />
      <ind:state state_ref="oval:ssg-state_sshd_requirement_unset:ste:1" />
    </ind:variable_test>
  </oval-def:tests>
  <oval-def:objects>
    <ind:textfilecontent54_object id="oval:ssg-obj_disable_host_auth:obj:1" version="1">
      <ind:filepath>/etc/ssh/sshd_config</ind:filepath>
      <ind:pattern operation="pattern match">^[ \t]*(?i)HostbasedAuthentication(?-i)[ \t]+(.+?)[ \t]*(?:$|#)</ind:pattern>
      <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
    </ind:textfilecontent54_object>
    <ind:textfilecontent54_object id="oval:ssg-obj_disable_host_auth_config_dir:obj:1" version="1">
      <ind:path>/etc/ssh/sshd_config.d</ind:path>
      <ind:filename operation="pattern match">.*\.conf$</ind:filename>
      <ind:pattern operation="pattern match">^[ \t]*(?i)HostbasedAuthentication(?-i)[ \t]+(.+?)[ \t]*(?:$|#)</ind:pattern>
      <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
    </ind:textfilecontent54_object>
    <ind:textfilecontent54_object id="oval:ssg-obj_collection_obj_disable_host_auth:obj:1" version="1" comment="All confs collection">
      <oval-def:set>
        <oval-def:object_reference>oval:ssg-obj_disable_host_auth:obj:1</oval-def:object_reference>
        <oval-def:object_reference>oval:ssg-obj_disable_host_auth_config_dir:obj:1</oval-def:object_reference>
      </oval-def:set>
    </ind:textfilecontent54_object>
    <linux:dpkginfo_object id="oval:ssg-obj_test_package_openssh-server_installed:obj:1" version="1">
      <linux:name>openssh-server</linux:name>
    </linux:dpkginfo_object>
    <linux:dpkginfo_object id="oval:ssg-obj_test_package_openssh-server_removed:obj:1" version="1">
      <linux:name>openssh-server</linux:name>
    </linux:dpkginfo_object>
    <ind:variable_object id="oval:ssg-object_sshd_not_required:obj:1" version="1">
      <ind:var_ref>oval:ssg-sshd_required:var:1</ind:var_ref>
    </ind:variable_object>
    <ind:variable_object id="oval:ssg-object_sshd_required:obj:1" version="1">
      <ind:var_ref>oval:ssg-sshd_required:var:1</ind:var_ref>
    </ind:variable_object>
    <ind:variable_object id="oval:ssg-object_sshd_requirement_unknown:obj:1" version="1">
      <ind:var_ref>oval:ssg-sshd_required:var:1</ind:var_ref>
    </ind:variable_object>
  </oval-def:objects>
  <oval-def:states>
    <ind:textfilecontent54_state id="oval:ssg-state_disable_host_auth:ste:1" version="1" operator="AND">
      <ind:subexpression datatype="string" operation="pattern match">^no$</ind:subexpression>
    </ind:textfilecontent54_state>
    <ind:textfilecontent54_state id="oval:ssg-state_disable_host_auth_config_dir:ste:1" version="1" operator="AND">
      <ind:subexpression datatype="string" operation="pattern match">^no$</ind:subexpression>
    </ind:textfilecontent54_state>
    <ind:variable_state id="oval:ssg-state_sshd_not_required:ste:1" version="1" operator="AND">
      <ind:value operation="equals" datatype="int">1</ind:value>
    </ind:variable_state>
    <ind:variable_state id="oval:ssg-state_sshd_required:ste:1" version="1" operator="AND">
      <ind:value operation="equals" datatype="int">2</ind:value>
    </ind:variable_state>
    <ind:variable_state id="oval:ssg-state_sshd_requirement_unset:ste:1" version="1" operator="AND">
      <ind:value operation="equals" datatype="int">0</ind:value>
    </ind:variable_state>
  </oval-def:states>
  <oval-def:variables>
    <oval-def:external_variable id="oval:ssg-sshd_required:var:1" version="1" datatype="int" comment="May be defined by Profiles to explicitly say if sshd is required or not" />
  </oval-def:variables>
</oval-def:oval_definitions>