-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRHEL-06-000031.sh
executable file
·76 lines (71 loc) · 2.63 KB
/
RHEL-06-000031.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
#!/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-000031
# Group Title: SRG-OS-999999
#
# Rule ID: RHEL-06-000031_rule
# Severity: medium
# Rule Version (STIG-ID): RHEL-06-000031
# Rule Title: The /etc/passwd file must not contain password hashes.
#
# Vulnerability Discussion: The hashes for all user account passwords
# should be stored in the file "/etc/shadow" and never in "/etc/passwd",
# which is readable by all users.
#
# Responsibility:
# IAControls:
#
# Check Content:
#
# To check that no password hashes are stored in "/etc/passwd", run the
# following command:
# awk -F: '($2 != "x") {print}' /etc/passwd
# If it produces any output, then a password hash is stored in
# "/etc/passwd".
# If any stored hashes are found in /etc/passwd, this is a finding.
#
# Fix Text:
#
# If any password hashes are stored in "/etc/passwd" (in the second
# field, instead of an "x"), the cause of this misconfiguration should be
# investigated. The account should have its password reset and the hash
# should be properly stored, or the account should be deleted entirely.
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000031
SEVERITY=medium
MOD_MSG="/etc/passwd file must not contain password hashes"
#
#BEGIN_CHECK
. ./aqueduct_functions
#END_CHECK
#BEGIN_REMEDY
if /bin/awk -F: '($2 != "x") {print $1}' /etc/passwd; then
show_message $PDI "$MOD_MSG" pass
exit 0
else
show_message $PDI "$MOD_MSG" fixed
pwconv
fi
#END_REMEDY