-
Notifications
You must be signed in to change notification settings - Fork 7
/
test_section_03_level1.yml
271 lines (258 loc) · 9.38 KB
/
test_section_03_level1.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
---
# CIS Ubuntu Linux 20.04 LTS Benchmark v1.0.0
#
# 3 Network Configuration
# 3.4 Uncommon Network Protocols: level 2
# 3.4.1 Ensure DCCP is disabled (Automated): level 2
# 3.4.2 Ensure SCTP is disabled (Automated): level 2
# 3.4.3 Ensure RDS is disabled (Automated: level 2
# 3.4.4 Ensure TIPC is disabled (Automated): level 2
# 3.5 Firewall Configuration
# 3.5.1 Configure Uncomplicated Firewall
# 3.5.1.1 Ensure Uncomplicated Firewall is installed (Automated): not implemented
# 3.5.1.2 Ensure iptables-persistent is not installed (Automated): not implemented
# 3.5.1.3 Ensure ufw service is enabled (Automated): not implemented
# 3.5.1.4 Ensure loopback traffic is configured (Automated): not implemented
# 3.5.1.5 Ensure outbound connections are configured (Manual): not implemented
# 3.5.1.6 Ensure firewall rules exist for all open ports (Manual): not implemented
# 3.5.1.7 Ensure default deny firewall policy (Automated): not implemented
# 3.5.2 Configure nftables
# 3.5.2.1 Ensure nftables is installed (Automated): not implemented
# 3.5.2.2 Ensure Uncomplicated Firewall is not installed or disabled (Automated): not implemented
# 3.5.2.3 Ensure iptables are flushed (Manual): not implemented
# 3.5.2.4 Ensure a table exists (Automated): not implemented
# 3.5.2.5 Ensure base chains exist (Automated): not implemented
# 3.5.2.6 Ensure loopback traffic is configured (Automated): not implemented
# 3.5.2.7 Ensure outbound and established connections are configured (Manual): not implemented
# 3.5.2.8 Ensure default deny firewall policy (Automated): not implemented
# 3.5.2.9 Ensure nftables service is enabled (Automated): not implemented
# 3.5.2.10 Ensure nftables rules are permanent (Automated): not implemented
# 3.5.3 Configure iptables
# 3.5.3.1 Configure software
# 3.5.3.1.1 Ensure iptables packages are installed (Automated): not implemented
# 3.5.3.1.2 Ensure nftables is not installed (Automated): not implemented
# 3.5.3.1.3 Ensure Uncomplicated Firewall is not installed or disabled (Automated): not implemented
# 3.5.3.2 Configure IPv4 iptables
# 3.5.3.2.1 Ensure default deny firewall policy (Automated): not implemented
# 3.5.3.2.2 Ensure loopback traffic is configured (Automated): not implemented
# 3.5.3.2.4 Ensure firewall rules exist for all open ports (Automated): not implemented
# 3.5.3.3 Configure IPv6 ip6tables
# 3.5.3.3.1 Ensure IPv6 default deny firewall policy (Automated): not implemented
# 3.5.3.3.2 Ensure IPv6 loopback traffic is configured (Automated): not implemented
# 3.5.3.3.3 Ensure IPv6 outbound and established connections are configured (Manual): not implemented
# 3.5.3.3.4 Ensure IPv6 firewall rules exist for all open ports (Manual): not implemented
command:
# 3.1 Disable unused network protocols and devices
# 3.1.1 Disable IPv6 (Manual)
grep "^\s*linux" /boot/grub/grub.cfg | grep -v "ipv6.disable=1":
exit-status: 1
stdout: []
# 3.1.2 Ensure wireless interfaces are disabled (Automated)
bash /tmp/test_section_03_level1/3-1-2.sh:
exit-status: 0
stderr: []
stdout:
- "Wireless is not enabled"
timeout: 10000
# 3.2 Network Parameters (Host Only)
# 3.2.1 Ensure packet redirect sending is disabled (Automated)
sysctl net.ipv4.conf.all.send_redirects:
exit-status: 0
stdout:
- "net.ipv4.conf.all.send_redirects = 0"
stderr: []
timeout: 10000
sysctl net.ipv4.conf.default.send_redirects:
exit-status: 0
stdout:
- "net.ipv4.conf.default.send_redirects = 0"
stderr: []
timeout: 10000
grep "^net\.ipv4\.conf\.all\.send_redirects=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
grep "^net\.ipv4\.conf\.default\.send_redirects=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
# 3.2.2 Ensure IP forwarding is disabled (Automated)
sysctl net.ipv4.ip_forward:
exit-status: 0
stdout:
- "net.ipv4.ip_forward = 0"
stderr: []
timeout: 10000
sysctl net.ipv6.conf.all.forwarding:
exit-status: 0
stdout:
- "net.ipv6.conf.all.forwarding = 0"
stderr: []
timeout: 10000
# 3.3 Network Parameters (Host and Router)
# 3.3.1 Ensure source routed packets are not accepted (Automated)
sysctl net.ipv4.conf.all.accept_source_route:
exit-status: 0
stdout:
- "net.ipv4.conf.all.accept_source_route = 0"
stderr: []
timeout: 10000
sysctl net.ipv4.conf.default.accept_source_route:
exit-status: 0
stdout:
- "net.ipv4.conf.default.accept_source_route = 0"
stderr: []
timeout: 10000
grep "^net\.ipv4\.conf\.all\.accept_source_route=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
grep "^net\.ipv4\.conf\.default\.accept_source_route=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
sysctl net.ipv6.conf.all.accept_source_route:
exit-status: 0
stdout:
- "net.ipv6.conf.all.accept_source_route = 0"
stderr: []
timeout: 10000
sysctl net.ipv6.conf.default.accept_source_route:
exit-status: 0
stdout:
- "net.ipv6.conf.default.accept_source_route = 0"
stderr: []
timeout: 10000
# 3.3.2 Ensure ICMP redirects are not accepted (Automated)
sysctl net.ipv4.conf.all.accept_redirects:
exit-status: 0
stdout:
- "net.ipv4.conf.all.accept_redirects = 0"
stderr: []
timeout: 10000
sysctl net.ipv4.conf.default.accept_redirects:
exit-status: 0
stdout:
- "net.ipv4.conf.default.accept_redirects = 0"
stderr: []
timeout: 10000
grep "^net\.ipv4\.conf\.all\.accept_redirects=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
grep "^net\.ipv4\.conf\.default\.accept_redirects=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
sysctl net.ipv6.conf.all.accept_redirects:
exit-status: 0
stdout:
- "net.ipv6.conf.all.accept_redirects = 0"
stderr: []
timeout: 10000
sysctl net.ipv6.conf.default.accept_redirects:
exit-status: 0
stdout:
- "net.ipv6.conf.default.accept_redirects = 0"
stderr: []
timeout: 10000
# 3.3.3 Ensure secure ICMP redirects are not accepted (Automated)
sysctl net.ipv4.conf.all.secure_redirects:
exit-status: 0
stdout:
- "net.ipv4.conf.all.secure_redirects = 0"
stderr: []
timeout: 10000
sysctl net.ipv4.conf.default.secure_redirects:
exit-status: 0
stdout:
- "net.ipv4.conf.default.secure_redirects = 0"
stderr: []
timeout: 10000
grep "^net\.ipv4\.conf\.all\.secure_redirects=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
grep "^net\.ipv4\.conf\.default\.secure_redirects=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
# 3.3.4 Ensure suspicious packets are logged (Automated)
sysctl net.ipv4.conf.all.log_martians:
exit-status: 0
stdout:
- "net.ipv4.conf.all.log_martians = 1"
stderr: []
timeout: 10000
sysctl net.ipv4.conf.default.log_martians:
exit-status: 0
stdout:
- "net.ipv4.conf.default.log_martians = 1"
stderr: []
timeout: 10000
grep "^net\.ipv4\.conf\.all\.log_martians=1" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
grep "^net\.ipv4\.conf\.default\.log_martians=1" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
# 3.3.5 Ensure broadcast ICMP requests are ignored (Automated)
sysctl net.ipv4.icmp_echo_ignore_broadcasts:
exit-status: 0
stdout:
- "net.ipv4.icmp_echo_ignore_broadcasts = 1"
stderr: []
timeout: 10000
grep "^net\.ipv4\.icmp_echo_ignore_broadcasts=1" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
# 3.3.6 Ensure bogus ICMP responses are ignored (Automated)
sysctl net.ipv4.icmp_ignore_bogus_error_responses:
exit-status: 0
stdout:
- "net.ipv4.icmp_ignore_bogus_error_responses = 1"
stderr: []
timeout: 10000
grep "^net.ipv4.icmp_ignore_bogus_error_responses=1" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
# 3.3.7 Ensure Reverse Path Filtering is enabled (Automated)
sysctl net.ipv4.conf.all.rp_filter:
exit-status: 0
stdout:
- "net.ipv4.conf.all.rp_filter = 1"
stderr: []
timeout: 10000
sysctl net.ipv4.conf.default.rp_filter:
exit-status: 0
stdout:
- "net.ipv4.conf.default.rp_filter = 1"
stderr: []
timeout: 10000
grep "^net\.ipv4\.conf\.all\.rp_filter=1" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
grep "^net\.ipv4\.conf\.default\.rp_filter=1" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
# 3.3.8 Ensure TCP SYN Cookies is enabled (Automated)
sysctl net.ipv4.tcp_syncookies:
exit-status: 0
stdout:
- "net.ipv4.tcp_syncookies = 1"
stderr: []
timeout: 10000
grep "^net\.ipv4\.tcp_syncookies=1" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
# 3.3.9 Ensure IPv6 router advertisements are not accepted (Automated)
sysctl net.ipv6.conf.all.accept_ra:
exit-status: 0
stdout:
- "net.ipv6.conf.all.accept_ra = 0"
stderr: []
timeout: 10000
sysctl net.ipv6.conf.default.accept_ra:
exit-status: 0
stdout:
- "net.ipv6.conf.default.accept_ra = 0"
stderr: []
timeout: 10000
grep "^net\.ipv6\.conf\.all\.accept_ra=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000
grep "^net\.ipv6\.conf\.default\.accept_ra=0" /etc/sysctl.conf /etc/sysctl.d/*:
exit-status: 0
timeout: 10000