<def-group>
  <definition class="compliance" id="bootloader_password_hash" version="1">
    <metadata>
      <title>Set Boot Loader Password Hash</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 grub boot loader password should use a compliant hash.</description>
    </metadata>
    <criteria>
      <criterion comment="make sure a compliant password hash is defined in /boot/grub/grub.conf" test_ref="test_bootloader_password_hash" />
    </criteria>
  </definition>
  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="make sure a compliant password hash is defined in /boot/grub/grub.conf" id="test_bootloader_password_hash" version="1">
    <ind:object object_ref="object_bootloader_password_hash" />
    <ind:state state_ref="state_bootloader_password_hash" />
  </ind:textfilecontent54_test>
  <ind:textfilecontent54_object id="object_bootloader_password_hash" version="1">
    <ind:path>/boot/grub</ind:path>
    <ind:filename>grub.conf</ind:filename>
    <ind:pattern operation="pattern match">^[\s]*password[\s]+--([a-zA-Z0-9-]+)[\s]+[\S]+$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_bootloader_password_hash" version="1">
    <ind:subexpression operation="pattern match">^(md5|sha1|sha-256|sha-512)$</ind:subexpression>
  </ind:textfilecontent54_state>
  
</def-group>
