-
Notifications
You must be signed in to change notification settings - Fork 0
/
RHEL-06-000027.sh
executable file
·86 lines (77 loc) · 2.71 KB
/
RHEL-06-000027.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#
##########################################################################
#Red Hat Enterprise Linux 6 - DISA STIG Compliance Remediation Content
#Copyright (C) 2013
#Vincent C. Passaro ([email protected])
#
##########################################################################
#
###################### Buddha Labs LLC ################################
# By Vincent C. Passaro #
# Buddha Labs LLC. #
# vince[@]buddhalabs[.]com #
# www.buddhalabs.com #
###################### Buddha Labs LLC ################################
#_________________________________________________________________________
# Version | Change Information | Author | Date
#-------------------------------------------------------------------------
# 1.0 | Initial Script Creation | Vincent Passaro | 1-JUNE-2013
#
#
#######################DISA INFORMATION##################################
# Group ID (Vulid): RHEL-06-000027
# Group Title: SRG-OS-000109
#
# Rule ID: RHEL-06-000027_rule
# Severity: medium
# Rule Version (STIG-ID): RHEL-06-000027
# Rule Title: The system must prevent the root account from logging in
# from virtual consoles.
#
# Vulnerability Discussion: Preventing direct root login to virtual
# console devices helps ensure accountability for actions taken on the
# system using the root account.
#
# Responsibility:
# IAControls:
#
# Check Content:
#
# To check for virtual console entries which permit root login, run the
# following command:
# grep '^vc/[0-9]' /etc/securetty
# If any output is returned, then root logins over virtual console devices
# is permitted.
# If root login over virtual console devices is permitted, this is a
# finding.
#
# Fix Text:
#
# To restrict root logins through the (deprecated) virtual console
# devices, ensure lines of this form do not appear in "/etc/securetty":
# vc/1
# vc/2
# vc/3
# vc/4
# Note: Virtual console entries are not limited to those listed above.
# Any lines starting with "vc/" followed by numerals should be removed.
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000027
SEVERITY=medium
#
#BEGIN_CHECK
. ./aqueduct_functions
PKG_CONFIG=/etc/securetty
MOD_MSG="restrict root from virtual consoles"
if grep -q '^vc/[0-9]' $PKG_CONFIG; then
#END_CHECK
#BEGIN_REMEDY
sed -i -r -e '/^(\s*)vc\/[0-9]+/d' /etc/securetty
show_message $PDI "$MOD_MSG" fixed
else
show_message $PDI "$MOD_MSG" pass
fi
#END_REMEDY