-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRHEL-06-000017.sh
executable file
·62 lines (50 loc) · 1.68 KB
/
RHEL-06-000017.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
##########################################################################
#Red Hat Enterprise Linux 6 - DISA STIG Compliance Remediation Content
#
#######################DISA INFORMATION##################################
# Group ID (Vulid): RHEL-06-000017
# Group Title: SRG-OS-999999
#
# Rule ID: RHEL-06-000017_rule
# Severity: medium
# Rule Version (STIG-ID): RHEL-06-000017
# Rule Title: The system must use a Linux Security Module at boot time.
#
# Vulnerability Discussion: Disabling a major host protection feature, such as SELinux,
# at boot time prevents it from confining system services at boot time.
#
# Responsibility:
# IAControls:
#
# Check Content:
#
#
# Inspect "/etc/grub.conf" for any instances of "selinux=0" in the kernel boot arguments. Presence of "selinux=0" indicates that SELinux is disabled at boot time. If SELinux is disabled at boot time, this is a finding.
#
# If the selinux is not disabled, this is a finding.
#
# Fix Text:
#
# To ensure all selinux is not disabled, remove the selinux=0 arguement from
# the kernel line in "/etc/grub.conf", in the manner below:
# kernel /vmlinuz-version ro vga=ext root=/dev/VolGroup00/LogVol00 rhgb
# quiet selinux=0
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000017
SEVERITY=medium
#
#BEGIN_CHECK
#Think this is on by default...but not 100% since the check isn't very specific
. ./aqueduct_functions
if grep -q selinux=0 /boot/grub/grub.conf ; then
#END_CHECK
#BEGIN_REMEDY
sed -i 's/selinux=0//' /boot/grub/grub.conf
show_message $PDI "kernel remove selinux=0" fixed
else
show_message $PDI "kernel selinux=0 not detected" pass
fi
#END_REMEDY