-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRHEL-06-000023.sh
executable file
·56 lines (51 loc) · 1.76 KB
/
RHEL-06-000023.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
#!/bin/bash
##########################################################################
#Red Hat Enterprise Linux 6 - DISA STIG Compliance Remediation Content
#
#######################DISA INFORMATION##################################
# Group ID (Vulid): RHEL-06-000023
# Group Title: SRG-OS-999999
#
# Rule ID: RHEL-06-000023_rule
# Severity: medium
# Rule Version (STIG-ID): RHEL-06-000023
# Rule Title: The system must use a Linux Security Module configured to enforce limits on system services.
#
# Vulnerability Discussion: Setting the SELinux policy to "targeted" or a more specialized policy ensures the system will confine processes that are likely to be targeted for exploitation, such as network or system services.
#
#
# Responsibility:
# IAControls:
#
# Check Content:
#
#Check the file "/etc/selinux/config" and ensure the following line appears:
#
#SELINUXTYPE=targeted
#
#If it does not, this is a finding.
#
# Fix Text:
#
#The SELinux "targeted" policy is appropriate for general-purpose desktops and servers, as well as systems in many other roles. To configure the system to use this policy, add or correct the following line in "/etc/selinux/config":
#
#SELINUXTYPE=targeted
#
#Other policies, such as "mls", provide additional security labeling and greater confinement but are not compatible with many general-purpose use cases.
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000023
SEVERITY=medium
#
#BEGIN_CHECK
. ./aqueduct_functions
if ! grep -q SELINUXTYPE=targeted /etc/selinux/config ; then
#END_CHECK
#BEGIN_REMEDY
sed -i 's/^SELINUXTYPE=.*/SELINUXTYPE=targeted/' /etc/selinux/config
show_message $PDI "SELINUXTYPE=targeted" fixed
else
show_message $PDI "SELINUXTYPE=targeted" pass
fi
#END_REMEDY