[PATCH] [bugfix] Updated selinux_bootloader_notdisabled per ticket 391

Shawn Wells shawn.d.wells at gmail.com
Sun Sep 1 15:24:22 UTC 2013


-------------- next part --------------
>From 1253b6e4048f575d0be802b8db0c1a0964ec6619 Mon Sep 17 00:00:00 2001
From: Shawn Wells <shawn at redhat.com>
Date: Sun, 1 Sep 2013 11:19:48 -0400
Subject: [PATCH] [bugfix] Updated selinux_bootloader_notdisabled per ticket 391

- regex wrong
- obj/test names updated
- oval signoff

[root at rhel6 checks]# vim /etc/grub.conf ; grep enforcing=0 /etc/grub.conf ; ./testcheck.py selinux_bootloader_notdisabled.xml
	kernel /vmlinuz-2.6.32-358.6.1.el6.x86_64 ro root=/dev/mapper/vg_rhel6-lv_root rd_LVM_LV=vg_rhel6/lv_root rd_LVM_LV=vg_rhel6/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us audit=1 crashkernel=auto rhgb quiet g enforcing=0
	kernel /vmlinuz-2.6.32-358.2.1.el6.x86_64 ro root=/dev/mapper/vg_rhel6-lv_root rd_LVM_LV=vg_rhel6/lv_root rd_LVM_LV=vg_rhel6/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us audit=1 crashkernel=auto rhgb quiet g enforcing=0
Evaluating with OVAL tempfile : /tmp/selinux_bootloader_notdisabledyJ5ssL.xml
Writing results to : /tmp/selinux_bootloader_notdisabledyJ5ssL.xml-results
Definition oval:scap-security-guide.testing:def:217: false
Evaluation done.

[root at rhel6 checks]# vim /etc/grub.conf ; grep enforcing=0 /etc/grub.conf ; ./testcheck.py selinux_bootloader_notdisabled.xml
Evaluating with OVAL tempfile : /tmp/selinux_bootloader_notdisabledtSgRwM.xml
Writing results to : /tmp/selinux_bootloader_notdisabledtSgRwM.xml-results
Definition oval:scap-security-guide.testing:def:217: true
Evaluation done.
---
 .../checks/selinux_bootloader_notdisabled.xml      |   28 ++++++++++++--------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/RHEL6/input/checks/selinux_bootloader_notdisabled.xml b/RHEL6/input/checks/selinux_bootloader_notdisabled.xml
index a064052..368902d 100644
--- a/RHEL6/input/checks/selinux_bootloader_notdisabled.xml
+++ b/RHEL6/input/checks/selinux_bootloader_notdisabled.xml
@@ -1,23 +1,29 @@
 <def-group>
-  <definition class="compliance"
-  id="selinux_bootloader_notdisabled" version="1">
+  <definition class="compliance" id="selinux_bootloader_notdisabled" version="1">
     <metadata>
-      <title>Enable SELinux</title>
+      <title>Enable SELinux in /etc/grub.conf</title>
       <affected family="unix">
         <platform>Red Hat Enterprise Linux 6</platform>
       </affected>
-      <description>SELinux should be enabled</description>
+      <description>
+        Check if selinux=0 OR enforcing=0 within /etc/grub.conf lines, fail if found.
+      </description>
+      <reference source="swells" ref_id="20130901" ref_url="test_attestation" />
     </metadata>
     <criteria>
-      <criterion test_ref="test_20104" />
+      <criterion comment="check value selinux|enforcing=0 in /etc/grub.conf, fail if found" test_ref="test_selinux_grub" />
     </criteria>
   </definition>
-  <ind:textfilecontent54_test check="all" check_existence="none_exist" comment="do it" id="test_20104" version="1">
-    <ind:object object_ref="obj_20104" />
+  <ind:textfilecontent54_test check="all" check_existence="none_exist"
+  comment="check value selinux|enforcing=0 in /etc/grub.conf, fail if found"
+  id="test_selinux_grub" version="1">
+    <ind:object object_ref="object_selinux_grub" />
   </ind:textfilecontent54_test>
-  <ind:textfilecontent54_object id="obj_20104" version="1">
-    <ind:filepath>/boot/grub/grub.conf</ind:filepath>
-    <ind:pattern operation="pattern match">^\s*kernel\s+.*(selinux|enforcing)=0.*$</ind:pattern>
-    <ind:instance datatype="int">1</ind:instance>
+  <ind:textfilecontent54_object id="object_selinux_grub" 
+  comment="check value selinux|enforcing=0 in /etc/grub.conf, fail if found"
+  version="1">
+    <ind:filepath>/etc/grub.conf</ind:filepath>
+    <ind:pattern operation="pattern match">^[\s]*kernel[\s]+.*(selinux|enforcing)=0.*$</ind:pattern>
+    <ind:instance datatype="int" operation="equals">1</ind:instance>
   </ind:textfilecontent54_object>
 </def-group>
-- 
1.7.1



More information about the scap-security-guide mailing list