From 2cfc60b975075f5c4a46e80ed26daeb9256f907b Mon Sep 17 00:00:00 2001 From: Michael Larabel Date: Tue, 28 Oct 2008 13:53:34 -0400 Subject: pts-core: Add support for checking if SELinux is enabled/running --- pts-core/functions/pts-functions-run.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'pts-core/functions/pts-functions-run.php') diff --git a/pts-core/functions/pts-functions-run.php b/pts-core/functions/pts-functions-run.php index 9a4a7e2..358f1c9 100644 --- a/pts-core/functions/pts-functions-run.php +++ b/pts-core/functions/pts-functions-run.php @@ -194,6 +194,24 @@ function pts_generate_test_notes($test_type) pts_add_test_note(pts_process_running_string($check_processes)); + // Check if Security Enhanced Linux was enforcing, permissive, or disabled + if(is_file("/etc/sysconfig/selinux")) + { + $selinux_file = file_get_contents("/etc/sysconfig/selinux"); + if(stripos($selinux_file, "selinux=disabled") === false) + { + pts_add_test_note("SELinux was enabled."); + } + } + else if(is_file("/boot/grub/menu.lst")) + { + $grub_file = file_get_contents("/boot/grub/menu.lst"); + if(stripos($grub_file, "selinux=1") !== false) + { + pts_add_test_note("SELinux was enabled."); + } + } + // Power Saving Technologies? pts_add_test_note(pts_processor_power_savings_enabled()); pts_add_test_note(system_power_mode()); -- cgit