<def-group>
  <definition class="compliance" id="selinux_policytype" version="1">
    <metadata>
      <title>Enable SELinux</title>
      <affected family="unix">
        <platform>multi_platform_rhel</platform>
      </affected>
      <description>The SELinux policy should be set appropriately.</description>
      <reference source="MED" ref_id="20130819" ref_url="test_attestation" />
      <!-- RHEL7 <reference source="SDW" ref_id="20131222" ref_url="test_attestation" /> -->
    </metadata>
    <criteria>
      <criterion test_ref="test_selinux_policy" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="Tests the value of the ^[\s]*SELINUXTYPE[\s]*=[\s]*([^#]*) expression in the /etc/selinux/config file"
  id="test_selinux_policy" version="1">
    <ind:object object_ref="obj_selinux_policy" />
    <ind:state state_ref="state_selinux_policy" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_state id="state_selinux_policy" version="1">
    <ind:subexpression operation="equals" var_check="all"
    var_ref="var_selinux_policy_name" />
  </ind:textfilecontent54_state>

  <external_variable comment="External variable: name of selinux policy in /etc/selinux/config"
  datatype="string" id="var_selinux_policy_name" version="1" />

  <ind:textfilecontent54_object id="obj_selinux_policy" version="1">
    <ind:filepath>/etc/selinux/config</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*SELINUXTYPE[\s]*=[\s]*([^\s]*)</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
