<def-group>
  <definition class="compliance" id="sshd_ipfiltering" version="1">
    <metadata>
      <title>Ensure IP Filtering For SSH</title>
      <affected family="unix">
        <platform>CentOS 4</platform>
		<platform>CentOS 5</platform>
		<platform>Red Hat Enterprise Linux 4</platform>
		<platform>Red Hat Enterprise Linux 5</platform>
      </affected>
      <description>The SSH daemon must be configured for IP filtering.</description>
    </metadata>
    <criteria comment="SSH is not being used or conditions are met" operator="OR">
      <extend_definition comment="rpm package openssh-server removed" definition_ref="package_openssh-server_removed" />
      <criterion comment="Check sshd in /etc/hosts.allow" test_ref="test_sshd_ipfiltering_allow" />
      <criterion comment="Check sshd in /etc/hosts.deny" test_ref="test_sshd_ipfiltering_deny" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="sshd exists" id="test_sshd_ipfiltering_allow" version="1">
    <ind:object object_ref="object_sshd_ipfiltering_allow" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_sshd_ipfiltering_allow" version="2">
    <ind:path>/etc</ind:path>
    <ind:filename>hosts.allow</ind:filename>
    <ind:pattern operation="pattern match">^[\s]*sshd</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="sshd exists" id="test_sshd_ipfiltering_deny" version="1">
    <ind:object object_ref="object_sshd_ipfiltering_deny" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_sshd_ipfiltering_deny" version="2">
    <ind:path>/etc</ind:path>
    <ind:filename>hosts.deny</ind:filename>
    <ind:pattern operation="pattern match">^[\s]*sshd</ind:pattern>
    <ind:instance operation="greater than or equal" datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

</def-group>
