-
Notifications
You must be signed in to change notification settings - Fork 0
/
RHEL-06-000093.sh
executable file
·88 lines (77 loc) · 3.28 KB
/
RHEL-06-000093.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
#!/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-000093
# Group Title: SRG-OS-999999
#
# Rule ID: RHEL-06-000093_rule
# Severity: low
# Rule Version (STIG-ID): RHEL-06-000093
# Rule Title: The system must ignore ICMPv4 bogus error responses.
#
# Vulnerability Discussion: Ignoring bogus ICMP error responses reduces
# log size, although some activity would not be logged.
#
# Responsibility:
# IAControls:
#
# Check Content:
#
# The status of the "net.ipv4.icmp_ignore_bogus_error_responses" kernel
# parameter can be queried by running the following command:
# $ sysctl net.ipv4.icmp_ignore_bogus_error_responses
# The output of the command should indicate a value of "1". If this value
# is not the default value, investigate how it could have been adjusted at
# runtime, and verify it is not set improperly in "/etc/sysctl.conf".
# If the correct value is not returned, this is a finding.
#
# Fix Text:
#
# To set the runtime status of the
# "net.ipv4.icmp_ignore_bogus_error_responses" kernel parameter, run the
# following command:
# sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1
# If this is not the system's default value, add the following line to
# "/etc/sysctl.conf":
# net.ipv4.icmp_ignore_bogus_error_responses = 1
#######################DISA INFORMATION##################################
#
# Global Variables
PDI=RHEL-06-000093
#BEGIN_CHECK
. ./aqueduct_functions
MOD_MSG="sysctl ignore bogus icmp responses"
KERNEL_VAR=`sysctl net.ipv4.icmp_ignore_bogus_error_responses | awk '{ print $NF }'`
#END_CHECK
#BEGIN_REMEDY
if [ $KERNEL_VAR -ne 1 ]; then
edit_file /etc/sysctl.conf $PDI "net.ipv4.icmp_ignore_bogus_error_responses = 1" "net.ipv4.icmp_ignore_bogus_error_responses"
show_message $PDI "$MOD_MSG" fixed
else
show_message $PDI "$MOD_MSG" pass
fi
# This is just for the limited SCC tool. It doesn't check the real value so we have to write this
# to /etc/sysctl.conf manually
if ! grep -q net.ipv4.icmp_ignore_bogus_error_responses /etc/sysctl.conf; then
edit_file /etc/sysctl.conf $PDI "net.ipv4.icmp_ignore_bogus_error_responses = 1" "net.ipv4.icmp_ignore_bogus_error_responses"
fi
# END_REMEDY