<?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-11-23T12:44:14</oval:timestamp>
  </oval-def:generator>
  <oval-def:definitions>
    <oval-def:definition id="oval:ssg-sshd_set_maxstartups:def:1" version="2" class="compliance">
      <oval-def:metadata>
        <oval-def:title>Ensure SSH MaxStartups is configured</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_set_maxstartups" source="ssg" />
        <oval-def:description>Ensure 'MaxStartups' is properly configured in SSH configuration files.</oval-def:description>
      </oval-def:metadata>
      <oval-def:criteria comment="sshd MaxStartups parameter is properly configured if sshd is 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 is removed" definition_ref="oval:ssg-package_openssh-server_removed:def:1" />
        </oval-def:criteria>
        <oval-def:criteria operator="AND">
          <oval-def:criterion comment="SSH MaxStartups start parameter is less than or equal to 10" test_ref="oval:ssg-tst_maxstartups_start_parameter:tst:1" />
          <oval-def:criterion comment="SSH MaxStartups rate parameter is greater than or equal to 30" test_ref="oval:ssg-tst_maxstartups_rate_parameter:tst:1" />
          <oval-def:criterion comment="SSH MaxStartups full parameter is less than or equal to 100" test_ref="oval:ssg-tst_maxstartups_full_parameter:tst:1" />
        </oval-def:criteria>
      </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_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-tst_maxstartups_start_parameter:tst:1" version="2" check="all" comment="SSH MaxStartups start parameter is less than or equal to the expected value" state_operator="AND">
      <ind:object object_ref="oval:ssg-obj_sshd_config_maxstartups_first_parameter:obj:1" />
      <ind:state state_ref="oval:ssg-ste_sshd_config_start_parameter_valid:ste:1" />
    </ind:textfilecontent54_test>
    <ind:textfilecontent54_test id="oval:ssg-tst_maxstartups_rate_parameter:tst:1" version="2" check="all" comment="SSH MaxStartups rate parameter is greater than or equal to the expected value" state_operator="AND">
      <ind:object object_ref="oval:ssg-obj_sshd_config_maxstartups_second_parameter:obj:1" />
      <ind:state state_ref="oval:ssg-ste_sshd_config_rate_parameter_valid:ste:1" />
    </ind:textfilecontent54_test>
    <ind:textfilecontent54_test id="oval:ssg-tst_maxstartups_full_parameter:tst:1" version="2" check="all" comment="SSH MaxStartups full parameter is less than or equal to the expected value" state_operator="AND">
      <ind:object object_ref="oval:ssg-obj_sshd_config_maxstartups_third_parameter:obj:1" />
      <ind:state state_ref="oval:ssg-ste_sshd_config_full_parameter_valid:ste:1" />
    </ind:textfilecontent54_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_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_sshd_config_maxstartups_first_parameter:obj:1" version="2">
      <ind:path operation="pattern match">/etc/(ssh|ssh/sshd_config.d)</ind:path>
      <ind:filename operation="pattern match">(sshd_config|.*\.conf)$</ind:filename>
      <ind:pattern operation="pattern match" datatype="string">(?i)^\s*MaxStartups\s+(\d+):\d+:\d+\s*$</ind:pattern>
      <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
    </ind:textfilecontent54_object>
    <ind:textfilecontent54_object id="oval:ssg-obj_sshd_config_maxstartups_second_parameter:obj:1" version="2">
      <ind:path operation="pattern match">/etc/(ssh|ssh/sshd_config.d)</ind:path>
      <ind:filename operation="pattern match">(sshd_config|.*\.conf)$</ind:filename>
      <ind:pattern operation="pattern match" datatype="string">(?i)^\s*MaxStartups\s+\d+:(\d+):\d+\s*$</ind:pattern>
      <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
    </ind:textfilecontent54_object>
    <ind:textfilecontent54_object id="oval:ssg-obj_sshd_config_maxstartups_third_parameter:obj:1" version="2">
      <ind:path operation="pattern match">/etc/(ssh|ssh/sshd_config.d)</ind:path>
      <ind:filename operation="pattern match">(sshd_config|.*\.conf)$</ind:filename>
      <ind:pattern operation="pattern match" datatype="string">(?i)^\s*MaxStartups\s+\d+:\d+:(\d+)\s*$</ind:pattern>
      <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
    </ind:textfilecontent54_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_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-ste_sshd_config_start_parameter_valid:ste:1" version="2" operator="AND">
      <ind:subexpression datatype="int" operation="less than or equal" var_ref="oval:ssg-var_sshd_set_maxstartups_first:var:1" />
    </ind:textfilecontent54_state>
    <ind:textfilecontent54_state id="oval:ssg-ste_sshd_config_rate_parameter_valid:ste:1" version="2" operator="AND">
      <ind:subexpression datatype="int" operation="greater than or equal" var_ref="oval:ssg-var_sshd_set_maxstartups_second:var:1" />
    </ind:textfilecontent54_state>
    <ind:textfilecontent54_state id="oval:ssg-ste_sshd_config_full_parameter_valid:ste:1" version="2" operator="AND">
      <ind:subexpression datatype="int" operation="less than or equal" var_ref="oval:ssg-var_sshd_set_maxstartups_third:var:1" />
    </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_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-var_sshd_set_maxstartups:var:1" version="1" datatype="string" comment="Expected value for MaxStartups parameter" />
    <oval-def:local_variable id="oval:ssg-var_sshd_set_maxstartups_first:var:1" version="1" datatype="int" comment="First number from MaxStartup parameter value.">
      <oval-def:regex_capture pattern="(\d+):\d+:\d+">
        <oval-def:variable_component var_ref="oval:ssg-var_sshd_set_maxstartups:var:1" />
      </oval-def:regex_capture>
    </oval-def:local_variable>
    <oval-def:local_variable id="oval:ssg-var_sshd_set_maxstartups_second:var:1" version="1" datatype="int" comment="Second number from MaxStartup parameter value.">
      <oval-def:regex_capture pattern="\d+:(\d+):\d+">
        <oval-def:variable_component var_ref="oval:ssg-var_sshd_set_maxstartups:var:1" />
      </oval-def:regex_capture>
    </oval-def:local_variable>
    <oval-def:local_variable id="oval:ssg-var_sshd_set_maxstartups_third:var:1" version="1" datatype="int" comment="Third number from MaxStartup parameter value.">
      <oval-def:regex_capture pattern="\d+:\d+:(\d+)">
        <oval-def:variable_component var_ref="oval:ssg-var_sshd_set_maxstartups:var:1" />
      </oval-def:regex_capture>
    </oval-def:local_variable>
    <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>