<def-group>
  <definition class="compliance" id="file_permissions_systemmap" version="1">
    {{{ oval_metadata("
        Checks that /boot/System.map-* are only readable by root.
      ") }}}
    <criteria operator="AND">
      <criterion test_ref="test_permissions_systemmap_files" />
    </criteria>
  </definition>

  <unix:file_test  check="all" check_existence="all_exist" comment="system.map files readable only by root" id="test_permissions_systemmap_files" version="1">
    <unix:object object_ref="object_file_permissions_systemmap_files" />
    <unix:state state_ref="state_owner_systemmap" />
    <unix:state state_ref="state_file_permissions_systemmap" />
  </unix:file_test>

  <unix:file_object comment="system.mapfiles" id="object_file_permissions_systemmap_files" version="1">
    <!-- Check that /boot/System.map-* files is readable only by root -->
    <unix:path>/boot</unix:path>
    <unix:filename operation="pattern match">^System\.map.*$</unix:filename>
  </unix:file_object>

  <unix:file_state id="state_owner_systemmap" version="1">
    <unix:user_id datatype="int" operation="equals">0</unix:user_id>
  </unix:file_state>

  <unix:file_state id="state_file_permissions_systemmap" version="1">
    <unix:suid datatype="boolean">false</unix:suid>
    <unix:sgid datatype="boolean">false</unix:sgid>
    <unix:sticky datatype="boolean">false</unix:sticky>
    <unix:uexec datatype="boolean">false</unix:uexec>
    <unix:gread datatype="boolean">false</unix:gread>
    <unix:gwrite datatype="boolean">false</unix:gwrite>
    <unix:gexec datatype="boolean">false</unix:gexec>
    <unix:oread datatype="boolean">false</unix:oread>
    <unix:owrite datatype="boolean">false</unix:owrite>
    <unix:oexec datatype="boolean">false</unix:oexec>
  </unix:file_state>

</def-group>
