-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRHEL-06-000015.sh
executable file
·87 lines (78 loc) · 2.8 KB
/
RHEL-06-000015.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
#!/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-000015
# Group Title: SRG-OS-000103
#
# Rule ID: RHEL-06-000015_rule
# Severity: low
# Rule Version (STIG-ID): RHEL-06-000015
# Rule Title: The system package management tool must cryptographically
# verify the authenticity of all software packages during installation.
#
# Vulnerability Discussion: Ensuring all packages' cryptographic
# signatures are valid prior to installation ensures the provenance of the
# software and protects against malicious tampering.
#
# Responsibility:
# IAControls:
#
# Check Content:
#
# To determine whether "yum" has been configured to disable "gpgcheck"
# for any repos, inspect all files in "/etc/yum.repos.d" and ensure the
# following does not appear in any sections:
# gpgcheck=0
# A value of "0" indicates that "gpgcheck" has been disabled for that repo.
# If GPG checking is disabled, this is a finding.
# If the "yum" system package management tool is not used to update the
# system, verify with the SA that installed packages are cryptographically
# signed.
#
# Fix Text:
#
# To ensure signature checking is not disabled for any repos, remove any
# lines from files in "/etc/yum.repos.d" of the form:
# gpgcheck=0
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000015
SEVERITY=low
#
#BEGIN_CHECK
. ./aqueduct_functions
if [ -d /etc/yum.repos.d ]
then
#END_CHECK
#BEGIN_REMEDY
for i in `ls /etc/yum.repos.d/*.repo`
do
if grep -q gpgcheck=0 $i; then
show_message $PDI "$i gpgcheck" fixed
sed -i "s/gpgcheck=0/gpgcheck=1/g" $i
else
show_message $PDI "$i gpgcheck" pass
fi
done
fi
#END_REMEDY