<def-group>
  <definition class="compliance" id="file_permissions_local_var_log_messages" version="1">
    <metadata>
        <title>Verify that /var/log/messages is readable only by root</title>
      <affected family="unix">
        <platform>multi_platform_sle</platform>
        <platform>multi_platform_slmicro</platform>
      </affected>
      <description>
          Checks that /var/log/messages is only readable by root.
      </description>
    </metadata>
    <criteria operator="OR">
      <extend_definition comment="Check if syslog service is disabled" definition_ref="service_syslog_disabled" />
      <criterion test_ref="test_permissions_var_log_messages_files" />
    </criteria>
  </definition>

  <unix:file_test  check="all" check_existence="all_exist" comment="system.map files readable only by root" id="test_permissions_var_log_messages_files" version="1">
    <unix:object object_ref="object_file_permissions_local_var_log_messages_files" />
    <unix:state state_ref="state_owner_var_log_messages" />
    <unix:state state_ref="state_file_permissions_local_var_log_messages" />
  </unix:file_test>

  <unix:file_object comment="system.mapfiles" id="object_file_permissions_local_var_log_messages_files" version="1">
    <unix:filepath>/var/log/messages</unix:filepath>
  </unix:file_object>

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

  <unix:file_state id="state_file_permissions_local_var_log_messages" 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: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>
