-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRHEL-06-000019.sh
executable file
·91 lines (81 loc) · 2.8 KB
/
RHEL-06-000019.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
86
87
88
89
90
#!/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
# 1.1 | Script add test and fix | Leam Hall | 3-OCT-2013
#
#
#######################DISA INFORMATION##################################
# Group ID (Vulid): RHEL-06-000019
# Group Title: SRG-OS-000248
#
# Rule ID: RHEL-06-000019_rule
# Severity: high
# Rule Version (STIG-ID): RHEL-06-000019
# Rule Title: There must be no .rhosts or hosts.equiv files on the system.
#
# Vulnerability Discussion: Trust files are convenient, but when used in
# conjunction with the R-services, they can allow unauthenticated access to
# a system.
#
# Responsibility:
# IAControls:
#
# Check Content:
#
# The existence of the file "/etc/hosts.equiv" or a file named ".rhosts"
# inside a user home directory indicates the presence of an Rsh trust
# relationship.
# If these files exist, this is a finding.
#
# Fix Text:
#
# The files "/etc/hosts.equiv" and "~/.rhosts" (in each user's home
# directory) list remote hosts and users that are trusted by the local
# system when using the rshd daemon. To remove these files, run the
# following command to delete them from any location.
# rm /etc/hosts.equiv
# $ rm ~/.rhosts
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000019
SEVERITY=high
#
#BEGIN_CHECK
. ./aqueduct_functions
#END_CHECK
#BEGIN_REMEDY
if [ -f /etc/hosts.equiv ]
then
show_message $PDI "rm /etc/hosts.equiv" fixed
rm /etc/hosts.equiv
else
show_message $PDI "/etc/hosts.equiv not detected" pass
fi
for i in `cat /etc/passwd | awk -F":" '{ print $6 }' `
do
if [ -f ${i}/.rhosts ]
then
show_message $PDI "rm $i/.rhosts" fixed
rm ${i}/.rhosts
else
show_message $PDI "$i/hosts.equiv not detected" pass
fi
done
#END_REMEDY