-
Notifications
You must be signed in to change notification settings - Fork 8
/
vagrant.yaml
345 lines (307 loc) · 10.1 KB
/
vagrant.yaml
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
unknown_user_default: kill
user_profiles:
- user: vagrant
## Process monitoring section
unknown_binary_default: mfa
binaries:
## Allowed binaries
/usr/bin/ssh-probe-auth: allow
/bin/bash: allow
/bin/sh: allow
/usr/bin/mkdir: allow
/usr/bin/rm: allow
/usr/bin/grep: allow
/usr/bin/uname: allow
/usr/bin/dircolors: allow
/usr/bin/ls: allow
/usr/bin/awk: allow
/usr/bin/wc: allow
/usr/bin/hg: allow
/usr/bin/sudo: allow # Don't forget that "socket_creation" and read access to "/etc/shadow" are required to execute a sudo command and "privilege_elevation" is required to become root
/usr/bin/su: allow
/usr/bin/groups: allow
/usr/bin/locale-check: allow
/usr/bin/id: allow
/usr/bin/lesspipe: allow
/usr/bin/basename: allow
/usr/bin/dirname: allow
/usr/bin/cat: allow
/usr/bin/clear_console: allow
/usr/lib/command-not-found: allow
/usr/bin/snap: allow
/usr/bin/touch: allow
/usr/bin/zsh: allow
/usr/sbin/insmod: allow
/usr/bin/vim: allow
/usr/bin/clear: allow
/usr/bin/dig: allow
/usr/bin/ps: allow
/usr/bin/strace: allow
## Blocked binaries
/usr/bin/apt: block
/usr/bin/apt-get: block
/usr/bin/dpkg: block
## Binaries only allowed with MFA
/usr/bin/docker: block # Use nsenter instead. If you really need docker, don't forget to allow "nsenter" and "socket_creation" if you need to docker exec into a container
/usr/bin/python3: mfa
/usr/bin/wget: mfa # Don't forget to allow "socket_creation" if you need network access
/usr/bin/ping: mfa
## Binaries that trigger the kill switch
/usr/bin/passwd: kill
/usr/sbin/adduser: kill
/usr/bin/nc: kill
/usr/sbin/reboot: kill
## File Integrity Monitoring section
unknown_file_default: allow
fim:
## If a file is selected by multiple patterns, on the last match will take effect
- pattern: /etc/*
access_right: write
action: block
- pattern: /etc/passwd
access_right: write
action: kill
- pattern: /etc/shadow
access_right: read
action: mfa # required to change user
- pattern: /etc/shadow
access_right: write
action: kill
- pattern: /etc/gshadow
access_right: read
action: mfa
- pattern: /etc/gshadow
access_right: write
action: kill
## sensitive files
- pattern: /home/*/.ssh/*
access_right: any
action: kill
- pattern: /home/*/.bashrc
access_right: write
action: kill
- pattern: /home/*/.bash_history
access_right: any
action: mfa # an attacker would probably clean its tracks anyway, so let's not let them find interesting things in the history
- pattern: /home/*/.bash_logout
access_right: write
action: block
- pattern: /home/*/.python_history
access_right: any
action: block
- pattern: /root/.ssh/*
access_right: any
action: block
- pattern: /root/.bashrc
access_right: write
action: block
- pattern: /root/.bash_history
access_right: any
action: block # remember that is means that you won't be able to see what users did ... although an attacker would probably clean its tracks anyway, so let's not let them find interesting things in the history
- pattern: /root/.python_history
access_right: any
action: block
## stop binaries modifications
- pattern: /bin/*
access_right: write
action: kill
- pattern: /sbin/*
access_right: write
action: kill
- pattern: /usr/bin/*
access_right: write
action: kill
- pattern: /usr/sbin/*
access_right: write
action: kill
- pattern: /usr/local/bin/*
access_right: write
action: kill
- pattern: /usr/local/sbin/*
access_right: write
action: kill
- pattern: /usr/lib/command-not-found
access_right: write
action: kill
## stop shared libraries modifications
- pattern: /lib/x86_64-linux-gnu/*
access_right: write
action: kill
## protect ssh-probe from being disabled
- pattern: /sys/kernel/debug/tracing/kprobe_events
access_right: any
action: kill
## Module persistence (Drovorub)
- pattern: /etc/modules
access_right: any
action: kill
- pattern: /etc/modules-load.d/*
access_right: any
action: kill
- pattern: /proc/modules
access_right: any
action: kill
deletions_and_moves: allow # deletions and moves can be used to bypass FIM and process monitoring. They are disabled by default.
## Socket creation section
socket_creation: mfa
## process level protections
process_level_protections: kill
## os level protections
os_level_protections: allow
## performance monitoring
performance_monitoring: mfa
## kill
kill: mfa
## privilege elevation
privilege_elevation: allow
- user: root
## Process monitoring section
unknown_binary_default: mfa
binaries:
## Allowed binaries
/usr/bin/ssh-probe-auth: allow
/bin/bash: allow
/bin/sh: allow
/usr/bin/mkdir: allow
/usr/bin/rm: allow
/usr/bin/grep: allow
/usr/bin/uname: allow
/usr/bin/dircolors: allow
/usr/bin/ls: allow
/usr/bin/awk: allow
/usr/bin/wc: allow
/usr/bin/hg: allow
/usr/bin/sudo: allow # Don't forget that "socket_creation" and read access to "/etc/shadow" are required to execute a sudo command and "privilege_elevation" is required to become root
/usr/bin/su: allow
/usr/bin/groups: allow
/usr/bin/locale-check: allow
/usr/bin/id: allow
/usr/bin/lesspipe: allow
/usr/bin/basename: allow
/usr/bin/dirname: allow
/usr/bin/cat: allow
/usr/bin/clear_console: allow
/usr/lib/command-not-found: allow
/usr/bin/snap: allow
/usr/bin/touch: allow
/usr/bin/zsh: allow
/usr/sbin/insmod: allow
/usr/bin/vim: allow
/usr/bin/clear: allow
/usr/bin/dig: allow
## Blocked binaries
/usr/bin/apt: block
/usr/bin/apt-get: block
/usr/bin/dpkg: block
## Binaries only allowed with MFA
/usr/bin/docker: block # Use nsenter instead. If you really need docker, don't forget to allow "nsenter" and "socket_creation" if you need to docker exec into a container
/usr/bin/python3: mfa
/usr/bin/wget: mfa # Don't forget to allow "socket_creation" if you need network access
/usr/bin/ping: mfa
## Binaries that trigger the kill switch
/usr/bin/passwd: kill
/usr/sbin/adduser: kill
/usr/bin/nc: kill
/usr/sbin/reboot: kill
## File Integrity Monitoring section
fim:
## If a file is selected by multiple patterns, on the last match will take effect
- pattern: /etc/*
access_right: write
action: block
- pattern: /etc/passwd
access_right: write
action: kill
- pattern: /etc/shadow
access_right: read
action: mfa # required to change user
- pattern: /etc/shadow
access_right: write
action: kill
- pattern: /etc/gshadow
access_right: read
action: mfa
- pattern: /etc/gshadow
access_right: write
action: kill
## sensitive files
- pattern: /home/*/.ssh/*
access_right: any
action: kill
- pattern: /home/*/.bashrc
access_right: write
action: kill
- pattern: /home/*/.bash_history
access_right: any
action: mfa # an attacker would probably clean its tracks anyway, so let's not let them find interesting things in the history
- pattern: /home/*/.bash_logout
access_right: write
action: block
- pattern: /home/*/.python_history
access_right: any
action: block
- pattern: /root/.ssh/*
access_right: any
action: block
- pattern: /root/.bashrc
access_right: write
action: block
- pattern: /root/.bash_history
access_right: any
action: block # remember that is means that you won't be able to see what users did ... although an attacker would probably clean its tracks anyway, so let's not let them find interesting things in the history
- pattern: /root/.python_history
access_right: any
action: block
## stop binaries modifications
- pattern: /bin/*
access_right: write
action: kill
- pattern: /sbin/*
access_right: write
action: kill
- pattern: /usr/bin/*
access_right: write
action: kill
- pattern: /usr/sbin/*
access_right: write
action: kill
- pattern: /usr/local/bin/*
access_right: write
action: kill
- pattern: /usr/local/sbin/*
access_right: write
action: kill
- pattern: /usr/lib/command-not-found
access_right: write
action: kill
## stop shared libraries modifications
- pattern: /lib/x86_64-linux-gnu/*
access_right: write
action: kill
## protect ssh-probe from being disabled
- pattern: /sys/kernel/debug/tracing/kprobe_events
access_right: any
action: kill
## Module persistence (Drovorub)
- pattern: /etc/modules
access_right: any
action: kill
- pattern: /etc/modules-load.d/*
access_right: any
action: kill
- pattern: /proc/modules
access_right: any
action: kill
deletions_and_moves: mfa # deletions and moves can be used to bypass FIM and process monitoring. They are disabled by default.
## Socket creation section
socket_creation: mfa
## process level protections
process_level_protections: kill
## os level protections
os_level_protections: kill
## performance monitoring
performance_monitoring: mfa
## kill
kill: mfa
## privilege elevation
privilege_elevation: mfa