<def-group>
 <!-- THIS FILE IS GENERATED by create_sysctl_checks.py.  DO NOT EDIT.  -->
  <definition class="compliance" id="sysctl_kernel_exec_shield" version="2">
    <metadata>
      <title>Kernel Runtime Parameter "kernel.exec-shield" Check</title>
      <affected family="unix">
        <platform>Red Hat Enterprise Linux 7</platform>
        <platform>multi_platform_fedora</platform>
      </affected>
      <description>The kernel runtime parameter "kernel.exec-shield" should not be disabled and set to 1 on 32-bit systems.</description>
      <reference source="galford" ref_id="201410" ref_url="test_attestation" />
    </metadata>
    <criteria operator="OR">
      <criteria operator="AND" comment="system is RHEL6">
        <extend_definition comment="RHEL6 installed" definition_ref="installed_OS_is_rhel6" />
        <criterion comment="kernel runtime parameter kernel.exec-shield set to 1" test_ref="test_runtime_sysctl_kernel_exec_shield" />
        <criterion comment="kernel /etc/sysctl.conf parameter kernel.exec-shield set to 1" test_ref="test_static_sysctl_kernel_exec_shield" />
      </criteria>
      <criteria operator="AND">
        <extend_definition comment="32-bit system" definition_ref="system_info_architecture_x86" />
        <criterion comment="kernel runtime parameter kernel.exec-shield set to 1" test_ref="test_runtime_sysctl_kernel_exec_shield" />
        <criterion comment="kernel /etc/sysctl.conf parameter kernel.exec-shield set to 1" test_ref="test_static_sysctl_kernel_exec_shield" />
      </criteria>
      <criteria operator="AND">
        <extend_definition comment="64-bit system" definition_ref="system_info_architecture_x86_64" />
        <criterion comment="NX is supported and is not disabled" test_ref="test_nx_disabled_grub" />
      </criteria>
    </criteria>
  </definition>

  <!-- Check for RHEL6 and 32bit systems  -->
  <unix:sysctl_test check="all" check_existence="all_exist" comment="kernel runtime parameter kernel.exec-shield set to 1" id="test_runtime_sysctl_kernel_exec_shield" version="1">
    <unix:object object_ref="object_sysctl_kernel_exec_shield" />
    <unix:state state_ref="state_sysctl_kernel_exec_shield" />
  </unix:sysctl_test>

  <ind:textfilecontent54_test check="all" check_existence="all_exist" comment="kernel.exec-shield static configuration" id="test_static_sysctl_kernel_exec_shield" version="1">
    <ind:object object_ref="object_static_sysctl_kernel_exec_shield" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_static_sysctl_kernel_exec_shield" version="1">
    <ind:filepath>/etc/sysctl.conf</ind:filepath>
    <ind:pattern operation="pattern match">^[\s]*kernel.exec-shield[\s]*=[\s]*1[\s]*$</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>

  <unix:sysctl_object id="object_sysctl_kernel_exec_shield" version="1">
    <unix:name>kernel.exec-shield</unix:name>
  </unix:sysctl_object>

  <unix:sysctl_state id="state_sysctl_kernel_exec_shield" version="1">
    <unix:value datatype="int" operation="equals">1</unix:value>
  </unix:sysctl_state>

  <!-- Check for 64-bit systems -->
  <ind:textfilecontent54_test check="all" check_existence="none_exist" comment="NX is disabled" id="test_nx_disabled_grub" version="1">
    <ind:object object_ref="object_nx_disabled_grub" />
  </ind:textfilecontent54_test>

  <ind:textfilecontent54_object id="object_nx_disabled_grub" version="1">
    <ind:filepath>/boot/grub2/grub.cfg</ind:filepath>
    <ind:pattern operation="pattern match">[\s]*noexec[\s]*=[\s]*off</ind:pattern>
    <ind:instance datatype="int">1</ind:instance>
  </ind:textfilecontent54_object>
</def-group>
