-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRHEL-06-000020.sh
executable file
·58 lines (51 loc) · 1.69 KB
/
RHEL-06-000020.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
#!/bin/bash
##########################################################################
#Red Hat Enterprise Linux 6 - DISA STIG Compliance Remediation Content
#
#######################DISA INFORMATION##################################
# Group ID (Vulid): RHEL-06-000020
# Group Title: SRG-OS-999999
#
# Rule ID: RHEL-06-000020_rule
# Severity: medium
# Rule Version (STIG-ID): RHEL-06-000020
# Rule Title: The system must use a Linux Security Module configured to enforce limits on system services.
#
# Vulnerability Discussion: Setting the SELinux state to enforcing ensures SELinux is able to confine potentially compromised processes to the security policy, which is designed to prevent them from causing damage to the system or further elevating their privileges.
#
#
# Responsibility:
# IAControls:
#
# Check Content:
#
#
#Check the file "/etc/selinux/config" and ensure the following line appears:
#
#SELINUX=enforcing
#
#If SELINUX is not set to enforcing, this is a finding.
#
# Fix Text:
#
#The SELinux state should be set to "enforcing" at system boot time. In the file "/etc/selinux/config", add or correct the following line to configure the system to boot into enforcing mode:
#
#SELINUX=enforcing
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000020
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=enforcing /etc/selinux/config ; then
#END_CHECK
#BEGIN_REMEDY
sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config
show_message $PDI "SELINUX=enforcing" fixed
else
show_message $PDI "SELINUX=enforcing" pass
fi
#END_REMEDY