<def-group>
  <definition class="compliance" id="selinux_state" version="1">
    <metadata>
      <title>SELinux Enforcing</title>
      <affected family="unix">
        <platform>multi_platform_rhel</platform>
      </affected>
      <description>The SELinux state should be enforcing the local policy.</description>
      <reference source="MED" ref_id="20130819" ref_url="test_attestation" />
    </metadata>
    <criteria operator="AND">
      <criterion comment="enforce is disabled" test_ref="test_etc_selinux_config" />
    </criteria>
  </definition>

  <ind:textfilecontent54_test check="all" check_existence="all_exist"
  comment="/selinux/enforce is 1" id="test_etc_selinux_config" version="1">
    <ind:object object_ref="object_etc_selinux_config" />
    <ind:state state_ref="state_etc_selinux_config" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_etc_selinux_config" version="1">
    <ind:filepath>/etc/selinux/config</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*SELINUX[\s]*=[\s]*(.*)[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <ind:textfilecontent54_state id="state_etc_selinux_config" version="1">
    <ind:subexpression datatype="string" operation="equals" var_check="all" var_ref="var_selinux_state" />
  </ind:textfilecontent54_state>

  <external_variable comment="external variable for selinux state"
  datatype="string" id="var_selinux_state" version="1" />
</def-group>
