-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjail.local
592 lines (538 loc) · 13 KB
/
jail.local
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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
[DEFAULT]
ignoreip = 127.0.0.1/8 ::1
# bantime is the number of seconds that a host is banned.
bantime = 600
# A host is banned when hits maxretry during the last findtime seconds.
findtime = 600
# maxretry is the number of failures before a host get banned.
maxretry = 3
[nginx-auth-main]
enabled = true
filter = nginx-auth-main
action = csfdeny[name=nginx-auth-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/*.error.log
bantime = 3600
maxretry = 3
findtime = 600
[nginx-auth]
enabled = true
filter = nginx-auth
action = csfdeny[name=nginx-auth]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
bantime = 3600
maxretry = 3
findtime = 600
[nginx-badrequests-main]
enabled = true
filter = nginx-badrequests-main
action = csfdeny[name=nginx-badrequests-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
bantime = 604800
maxretry = 1
[nginx-badrequests]
enabled = true
filter = nginx-badrequests
action = csfdeny[name=nginx-badrequests]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
bantime = 604800
maxretry = 1
[nginx-log4j-main]
enabled = true
filter = nginx-log4j-main
action = csfdeny[name=nginx-log4j-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
bantime = 86400
findtime = 86400
maxretry = 1
[nginx-log4j]
enabled = true
filter = nginx-log4j
action = csfdeny[name=nginx-log4j]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
bantime = 86400
findtime = 86400
maxretry = 1
[nginx-common-main]
enabled = true
filter = nginx-common-main
action = csfdeny[name=nginx-common-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
bantime = 604800
maxretry = 1
findtime = 43200
[nginx-common]
enabled = true
filter = nginx-common
action = csfdeny[name=nginx-common]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
bantime = 604800
maxretry = 1
findtime = 43200
[nginx-req-limit-main]
enabled = true
filter = nginx-req-limit
action = csfdeny[name=nginx-req-limit-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/*.error.log
findtime = 600
bantime = 7200
maxretry = 5
[nginx-req-limit]
enabled = true
filter = nginx-req-limit
action = csfdeny[name=nginx-req-limit]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/error.log
findtime = 600
bantime = 7200
maxretry = 5
# repeat offender monitor fail2ban log for banned nginx-req-limit
# entries >5 within 6 hours will be banned for longer 72hr time
[nginx-req-limit-repeat]
enabled = true
filter = nginx-req-limit-repeat
action = csfdeny[nginx-req-limit-repeat]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/fail2ban.log
bantime = 259200
maxretry = 5
findtime = 21600
[nginx-conn-limit-main]
enabled = true
filter = nginx-conn-limit-main
action = csfdeny[name=nginx-conn-limit-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/*.error.log
findtime = 600
bantime = 7200
maxretry = 5
[nginx-conn-limit]
enabled = true
filter = nginx-conn-limit
action = csfdeny[name=nginx-conn-limit]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/error.log
findtime = 600
bantime = 7200
maxretry = 5
[nginx-botsearch-main]
enabled = true
filter = nginx-botsearch-main
action = csfdeny[name=nginx-botsearch-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 2
[nginx-botsearch]
enabled = true
filter = nginx-botsearch
action = csfdeny[name=nginx-botsearch]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 2
#[nginx-get-f5-main]
#enabled = true
#filter = nginx-get-f5-main
#action = csfdeny[name=nginx-get-f5-main]
##action = cloudflare
#action = cloudflaretoken
#logpath = /var/log/nginx/localhost.access.log
#port = http,https
#maxretry = 15
#findtime = 1
#bantime = 600
#[nginx-get-f5]
#enabled = true
#filter = nginx-get-f5
#action = csfdeny[name=nginx-get-f5]
##action = cloudflare
#action = cloudflaretoken
#logpath = /home/nginx/domains/*/log/access.log
#port = http,https
#maxretry = 15
#findtime = 1
#bantime = 600
[nginx-xmlrpc-main]
enabled = true
filter = nginx-xmlrpc-main
action = csfdeny[name=nginx-xmlrpc-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 6
findtime = 60
[nginx-xmlrpc]
enabled = true
filter = nginx-xmlrpc
action = csfdeny[name=nginx-xmlrpc]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 6
findtime = 60
[nginx-401-main]
enabled = false
filter = nginx-401-main
action = csfdeny[name=nginx-401-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 10
findtime = 60
[nginx-401]
enabled = false
filter = nginx-401
action = csfdeny[name=nginx-401]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 10
findtime = 60
[nginx-403-main]
enabled = false
filter = nginx-403-main
action = csfdeny[name=nginx-403-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 10
findtime = 60
[nginx-403]
enabled = false
filter = nginx-403
action = csfdeny[name=nginx-403]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 10
findtime = 60
[nginx-404-main]
enabled = false
filter = nginx-404-main
action = csfdeny[name=nginx-404-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 10
findtime = 60
[nginx-404]
enabled = false
filter = nginx-404
action = csfdeny[name=nginx-404]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 10
findtime = 60
#[nginx-w00tw00t-main]
#enabled = true
#filter = nginx-w00tw00t-main
#action = csfdeny[name=nginx-w00tw00t-main]
##action = cloudflare
#action = cloudflaretoken
#logpath = /var/log/nginx/localhost.access.log
#port = http,https
#maxretry = 1
#bantime = 86400
#[nginx-w00tw00t]
#enabled = true
#filter = nginx-w00tw00t
#action = csfdeny[name=nginx-w00tw00t]
##action = cloudflare
#action = cloudflaretoken
#logpath = /home/nginx/domains/*/log/access.log
#port = http,https
#maxretry = 1
#bantime = 86400
[phpmyadmin-cmm]
enabled = false
filter = phpmyadmin-cmm
action = csfdeny[name=phpmyadmin-cmm]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
bantime = 3600
maxretry = 5
findtime = 60
[phpmyadmin-other]
enabled = false
filter = phpmyadmin-other
action = csfdeny[name=phpmyadmin-other]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
bantime = 3600
maxretry = 5
findtime = 60
[adminer-main]
enabled = false
filter = adminer-main
action = csfdeny[name=adminer-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
bantime = 3600
maxretry = 5
findtime = 60
[adminer]
enabled = false
filter = adminer
action = csfdeny[name=adminer]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
bantime = 3600
maxretry = 5
findtime = 60
[wordpress-auth-main]
enabled = true
filter = wordpress-auth-main
action = csfdeny[name=wordpress-auth-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 3
findtime = 60
[wordpress-auth]
enabled = true
filter = wordpress-auth
action = csfdeny[name=wordpress-auth]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 3
findtime = 60
[wordpress-comment-main]
enabled = true
filter = wordpress-comment-main
action = csfdeny[name=wordpress-comment-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
bantime = 3600
maxretry = 5
findtime = 60
[wordpress-comment]
enabled = true
filter = wordpress-comment
action = csfdeny[name=wordpress-comment]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
bantime = 3600
maxretry = 5
findtime = 60
[wordpress-pingback-main]
enabled = true
filter = wordpress-pingback-main
action = csfdeny[name=wordpress-pingback-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
#backend = polling
journalmatch =
port = http,https
bantime = 86400
maxretry = 1
findtime = 1
[wordpress-pingback]
enabled = true
filter = wordpress-pingback
action = csfdeny[name=wordpress-pingback]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
#backend = polling
journalmatch =
port = http,https
bantime = 86400
maxretry = 1
findtime = 1
# repeat offender monitor fail2ban log for banned wordpress-pingback
# entries >5 within 6 hours will be banned for longer 72hr time
[wordpress-pingback-repeat]
enabled = true
filter = wordpress-pingback-repeat
action = csfdeny[name=wordpress-pingback-repeat]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/fail2ban.log
bantime = 259200
maxretry = 5
findtime = 21600
# https://en-au.wordpress.org/plugins/sucuri-scanner/
# https://en-au.wordpress.org/plugins/wp-fail2ban/
[wordpress-fail2ban-plugin]
enabled = true
filter = wordpress-fail2ban-plugin
action = csfdeny[name=wordpress-fail2ban-plugin]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/auth.log
/var/log/secure
bantime = 259200
maxretry = 1
findtime = 7200
[vbulletin-main]
enabled = true
filter = vbulletin-main
action = csfdeny[name=vbulletin-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
bantime = 28800
maxretry = 3
findtime = 60
[vbulletin]
enabled = true
filter = vbulletin
action = csfdeny[name=vbulletin]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
bantime = 28800
maxretry = 3
findtime = 60
[shells-main]
enabled = true
filter = shells-main
action = csfdeny[name=shells-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
bantime = 604800
maxretry = 1
findtime = 86400
[shells]
enabled = true
filter = shells
action = csfdeny[name=shells]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
bantime = 604800
maxretry = 1
findtime = 86400
[http-xensec-main]
enabled = false
port = http,https
filter = http-xensec-main
logpath = /var/log/nginx/localhost.access.log
#number of occurances
maxretry = 5
findtime = 60
#ban for 5 days (in seconds)
bantime = 432000
action = csfdeny[name=http-xensec-main]
#action = cloudflare
#action = cloudflaretoken
#sendmail-whois[name=XenSec, dest=root]
[http-xensec]
enabled = false
port = http,https
filter = http-xensec
logpath = /home/nginx/domains/*/log/access.log
#number of occurances
maxretry = 5
findtime = 60
#ban for 5 days (in seconds)
bantime = 432000
action = csfdeny[name=http-xensec]
#action = cloudflare
#action = cloudflaretoken
#sendmail-whois[name=XenSec, dest=root]
[joomla-auth-main]
enabled = false
filter = joomla-auth-main
action = csfdeny[name=joomla-auth-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 5
bantime = 7200
findtime = 60
[joomla-auth]
enabled = false
filter = joomla-auth
action = csfdeny[name=joomla-auth]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 5
bantime = 7200
findtime = 60
[magento-main]
enabled = false
filter = magento-main
action = csfdeny[name=magento-main]
#action = cloudflare
#action = cloudflaretoken
logpath = /var/log/nginx/localhost.access.log
port = http,https
maxretry = 5
bantime = 7200
findtime = 60
[magento]
enabled = false
filter = magento
action = csfdeny[name=magento]
#action = cloudflare
#action = cloudflaretoken
logpath = /home/nginx/domains/*/log/access.log
port = http,https
maxretry = 5
bantime = 7200
findtime = 60
#[pure-ftpd]
#port = ftp,ftp-data,ftps,ftps-data
#logpath = %(pureftpd_log)s
#backend = %(pureftpd_backend)s
#[nsd]
#port = 53
#action = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
%(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
#logpath = /var/log/nsd.log