aboutsummaryrefslogtreecommitdiffstats
path: root/conf/metrics.conf
blob: a8eff289ceea2785c1b3714215647f69f2f71d78 (plain)
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
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# Metrics settings
# Please don't modify this file as your changes might be overwritten with
# the next update.
#
# You can modify '$LOCAL_CONFDIR/rspamd.conf.local.override' to redefine
# parameters defined on the top level
#
# You can modify '$LOCAL_CONFDIR/rspamd.conf.local' to add
# parameters defined on the top level
#
# For specific modules or configuration you can also modify
# '$LOCAL_CONFDIR/local.d/file.conf' - to add your options or rewrite defaults
# '$LOCAL_CONFDIR/override.d/file.conf' - to override the defaults
#
# See https://rspamd.com/doc/tutorials/writing_rules.html for details

metric {
    name = "default";
    # If this param is set to non-zero
    # then a metric would accept all symbols
    # unknown_weight = 1.0

    actions {
      reject = 15;
      add_header = 6;
      greylist = 4;
    }

    group "excessqp" {
        max_score = 2.4;
    }
    group "excessb64" {
        max_score = 3.0;
    }
    group "header" {
        symbol "FORGED_SENDER" {
            weight = 0.30;
            description = "Sender is forged (different From: header and smtp MAIL FROM: addresses)";
        }
        symbol "R_MIXED_CHARSET" {
            weight = 5.0;
            description = "Mixed characters in a message";
            one_shot = true;
        }
        symbol "R_MIXED_CHARSET_URL" {
            weight = 7.0;
            description = "Mixed characters in a URL inside message";
            one_shot = true;
        }
        symbol "FORGED_RECIPIENTS" {
            weight = 2.0;
            description = "Recipients are not the same as RCPT TO: mail command";
        }
        symbol "FORGED_RECIPIENTS_MAILLIST" {
            weight = 0.0;
            description = "Recipients are not the same as RCPT TO: mail command, but a message from a maillist";
        }
        symbol "FORGED_SENDER_MAILLIST" {
            weight = 0.0;
            description = "Sender is not the same as MAIL FROM: envelope, but a message is from a maillist";
        }
        symbol "ONCE_RECEIVED" {
            weight = 0.1;
            description = "One received header in a message";
        }
        symbol "RDNS_NONE" {
            weight = 1.0;
            description = "Cannot resolve reverse DNS for sender's IP";
        }
        symbol "ONCE_RECEIVED_STRICT" {
            weight = 4.0;
            description = "One received header with 'bad' patterns inside";
        }
        symbol "MAILLIST" {
            weight = -0.2;
            description = "Message seems to be from maillist";
        }
    }

    group "subject" {
        max_score = 6.0;
    }

    group "mua" {
        symbol "FORGED_MUA_MAILLIST" {
            weight = 0.0;
            description = "Avoid false positives for FORGED_MUA_* in maillist";
        }
    }

    group "rbl" {
        symbol "DNSWL_BLOCKED" {
            weight = 0.0;
            description = "Resolver blocked due to excessive queries";
        }
        symbol "RCVD_IN_DNSWL" {
            weight = 0.0;
            description = "Unrecognised result from dnswl.org";
        }
        symbol "RCVD_IN_DNSWL_NONE" {
            weight = 0.0;
            description = "Sender listed at http://www.dnswl.org, low none";
        }
        symbol "RCVD_IN_DNSWL_LOW" {
            weight = 0.0;
            description = "Sender listed at http://www.dnswl.org, low trust";
        }
        symbol "RCVD_IN_DNSWL_MED" {
            weight = 0.0;
            description = "Sender listed at http://www.dnswl.org, medium trust";
        }
        symbol "RCVD_IN_DNSWL_HI" {
            weight = 0.0;
            description = "Sender listed at http://www.dnswl.org, high trust";
        }

        symbol "RBL_SPAMHAUS" {
            weight = 0.0;
            description = "Unrecognised result from Spamhaus zen";
        }
        symbol "RBL_SPAMHAUS_SBL" {
            weight = 2.0;
            description = "From address is listed in zen sbl";
        }
        symbol "RBL_SPAMHAUS_CSS" {
            weight = 2.0;
            description = "From address is listed in zen css";
        }
        symbol "RBL_SPAMHAUS_XBL" {
            weight = 4.0;
            description = "From address is listed in zen xbl";
        }
        symbol "RBL_SPAMHAUS_XBL_ANY" {
            weight = 4.0;
            description = "From or receive address is listed in zen xbl (any list)";
        }
        symbol "RBL_SPAMHAUS_PBL" {
            weight = 2.0;
            description = "From address is listed in zen pbl (ISP list)";
        }
        symbol "RBL_SPAMHAUS_DROP" {
            weight = 7.0;
            description = "From address is listed in zen drop bl";
        }
        symbol "RECEIVED_SPAMHAUS_XBL" {
            weight = 3.0;
            description = "Received address is listed in zen xbl";
            one_shot = true;
        }

        symbol "RBL_SENDERSCORE" {
            weight = 2.0;
            description = "From address is listed in senderscore.com BL";
        }
        symbol "RBL_ABUSECH" {
            weight = 1.0;
            description = "From address is listed in ABUSE.CH BL";
        }
        symbol "MAILSPIKE" {
            weight = 0.0;
            description = "Unrecognised result from Mailspike";
        }
        symbol "RWL_MAILSPIKE_NEUTRAL" {
            weight = 0.0;
            description = "Neutral result from Mailspike";
        }
        symbol "RBL_MAILSPIKE_WORST" {
            weight = 2.0;
            description = "From address is listed in RBL - worst possible reputation";
        }
        symbol "RBL_MAILSPIKE_VERYBAD" {
            weight = 1.5;
            description = "From address is listed in RBL - very bad reputation";
        }
        symbol "RBL_MAILSPIKE_BAD" {
            weight = 1.0;
            description = "From address is listed in RBL - bad reputation";
        }
        symbol "RWL_MAILSPIKE_POSSIBLE" {
            weight = 0.0;
            description = "From address is listed in RWL - possibly legit";
        }
        symbol "RWL_MAILSPIKE_GOOD" {
            weight = 0.0;
            description = "From address is listed in RWL - good reputation";
        }
        symbol "RWL_MAILSPIKE_VERYGOOD" {
            weight = 0.0;
            description = "From address is listed in RWL - very good reputation";
        }
        symbol "RWL_MAILSPIKE_EXCELLENT" {
            weight = 0.0;
            description = "From address is listed in RWL - excellent reputation";
        }

        symbol "RBL_SEM" {
            weight = 1.0;
            description = "Address is listed in Spameatingmonkey RBL";
        }

        symbol "RBL_SEM_IPV6" {
            weight = 1.0;
            description = "Address is listed in Spameatingmonkey RBL (ipv6)";
        }
        }

        group "bayes" {

        symbol "BAYES_SPAM" {
            weight = 4.0;
            description = "Message probably spam, probability: ";
        }
        symbol "BAYES_HAM" {
            weight = -3.0;
            description = "Message probably ham, probability: ";
        }
    }

    group "fuzzy" {
        symbol "FUZZY_UNKNOWN" {
            weight = 5.0;
            description = "Generic fuzzy hash match";
        }
        symbol "FUZZY_DENIED" {
            weight = 12.0;
            description = "Denied fuzzy hash";
        }
        symbol "FUZZY_PROB" {
            weight = 5.0;
            description = "Probable fuzzy hash";
        }
        symbol "FUZZY_WHITE" {
            weight = -2.1;
            description = "Whitelisted fuzzy hash";
        }
    }

    group "spf" {
        symbol "R_SPF_FAIL" {
            weight = 1.0;
            description = "SPF verification failed";
        }
        symbol "R_SPF_SOFTFAIL" {
            weight = 0.0;
            description = "SPF verification soft-failed";
        }
        symbol "R_SPF_NEUTRAL" {
            weight = 0.0;
            description = "SPF policy is neutral";
        }
        symbol "R_SPF_ALLOW" {
            weight = -0.2;
            description = "SPF verification allows sending";
        }
        symbol "R_SPF_DNSFAIL" {
            weight = 0.0;
            description = "SPF DNS failure";
        }
    }

    group "dkim" {
        symbol "R_DKIM_REJECT" {
            weight = 1.0;
            description = "DKIM verification failed";
            one_shot = true;
        }
        symbol "R_DKIM_TEMPFAIL" {
            weight = 0.0;
            description = "DKIM verification soft-failed";
        }
        symbol "R_DKIM_ALLOW" {
            weight = -0.2;
            description = "DKIM verification succeed";
            one_shot = true;
        }
    }

    group "surbl" {
        max_score = 12.5;

        symbol "SURBL_BLOCKED" {
            weight = 0.0;
            description = "SURBL: blocked by policy/overusage";
        }
        symbol "PH_SURBL_MULTI" {
            weight = 5.5;
            description = "SURBL: Phishing sites";
        }
        symbol "MW_SURBL_MULTI" {
            weight = 5.5;
            description = "SURBL: Malware sites";
        }
        symbol "ABUSE_SURBL" {
            weight = 5.5;
            description = "SURBL: ABUSE";
        }
        symbol "CRACKED_SURBL" {
            weight = 4.0;
            description = "SURBL: cracked site";
        }
        symbol "RAMBLER_URIBL" {
            weight = 4.5;
            description = "rambler.ru uribl";
        }

        symbol "SEM_URIBL_UNKNOWN" {
            weight = 0.0;
            description = "Spameatingmonkey uribl: unknown result";
        }
        symbol "SEM_URIBL" {
            weight = 3.5;
            description = "Spameatingmonkey uribl";
        }

        symbol "SEM_URIBL_FRESH15_UNKNOWN" {
            weight = 0.0;
            description = "Spameatingmonkey Fresh15 uribl: unknown result";
        }
        symbol "SEM_URIBL_FRESH15" {
            weight = 3.0;
            description = "Spameatingmonkey uribl. Domains registered in the last 15 days (.AERO,.BIZ,.COM,.INFO,.NAME,.NET,.PRO,.SK,.TEL,.US)";
        }

        symbol "DBL" {
            weight = 0.0;
            description = "DBL unknown result";
        }
        symbol "DBL_SPAM" {
            weight = 6.5;
            description = "DBL uribl spam";
        }
        symbol "DBL_PHISH" {
            weight = 6.5;
            description = "DBL uribl phishing";
        }
        symbol "DBL_MALWARE" {
            weight = 6.5;
            description = "DBL uribl malware";
        }
        symbol "DBL_BOTNET" {
            weight = 5.5;
            description = "DBL uribl botnet C&C domain";
        }
        symbol "DBL_ABUSE" {
            weight = 6.5;
            description = "DBL uribl abused legit spam";
        }
        symbol "DBL_ABUSE_REDIR" {
            weight = 1.5;
            description = "DBL uribl abused spammed redirector domain";
        }
        symbol "DBL_ABUSE_PHISH" {
            weight = 7.5;
            description = "DBL uribl abused legit phish";
        }
        symbol "DBL_ABUSE_MALWARE" {
            weight = 7.5;
            description = "DBL uribl abused legit malware";
        }
        symbol "DBL_ABUSE_BOTNET" {
            weight = 5.5;
            description = "DBL uribl abused legit botnet C&C";
        }
        symbol "DBL_PROHIBIT" {
            weight = 0.00000;
            description = "DBL uribl IP queries prohibited!";
        }
        symbol "URIBL_MULTI" {
            weight = 0.0;
            description = "uribl.com: unrecognised result";
        }
        symbol "URIBL_BLOCKED" {
            weight = 0.0;
            description = "uribl.com: query refused";
        }
        symbol "URIBL_BLACK" {
            weight = 7.5;
            description = "uribl.com black url";
        }
        symbol "URIBL_RED" {
            weight = 3.5;
            description = "uribl.com red url";
        }
        symbol "URIBL_GREY" {
            weight = 1.5;
            description = "uribl.com grey url";
            one_shot = true;
        }
        symbol "RAMBLER_EMAILBL" {
            weight = 9.5;
            description = "rambler.ru emailbl";
            one_shot = true;
        }

        symbol "SBL_URIBL" {
            weight = 0.0;
            description = "SBL URIBL: Filtered result";
        }
        symbol "URIBL_SBL" {
            weight = 6.5;
            description = "Spamhaus SBL URIBL";
        }
        symbol "URIBL_SBL_CSS" {
            weight = 6.5;
            description = "Spamhaus SBL CSS URIBL";
        }
        symbol "RBL_SARBL_BAD" {
            weight = 2.5;
            description = "A domain listed in the mail is blacklisted in SARBL";
       }
    }

    group "phishing" {
        symbol "PHISHING" {
            weight = 4.0;
            description = "Phished URL";
            one_shot = true;
        }
        symbol "PHISHED_OPENPHISH" {
            weight = 7.0;
            description = "Phished URL found in openphish.com";
        }
        symbol "PHISHED_PHISHTANK" {
            weight = 7.0;
            description = "Phished URL found in phishtank.com";
        }
    }

    group "hfilter" {
        symbol "HFILTER_HELO_BAREIP" {
            weight = 3.00;
            description = "Helo host is bare ip";
        }
        symbol "HFILTER_HELO_BADIP" {
            weight = 4.50;
            description = "Helo host is very bad ip";
        }
        symbol "HFILTER_HELO_1" {
            weight = 0.5;
            description = "Helo host checks (very low)";
        }
        symbol "HFILTER_HELO_2" {
            weight = 1.00;
            description = "Helo host checks (low)";
        }
        symbol "HFILTER_HELO_3" {
            weight = 2.00;
            description = "Helo host checks (medium)";
        }
        symbol "HFILTER_HELO_4" {
            weight = 2.50;
            description = "Helo host checks (hard)";
        }
        symbol "HFILTER_HELO_5" {
            weight = 3.00;
            description = "Helo host checks (very hard)";
        }
        symbol "HFILTER_HOSTNAME_1" {
            weight = 0.5;
            description = "Hostname checks (very low)";
        }
        symbol "HFILTER_HOSTNAME_2" {
            weight = 1.00;
            description = "Hostname checks (low)";
        }
        symbol "HFILTER_HOSTNAME_3" {
            weight = 2.00;
            description = "Hostname checks (medium)";
        }
        symbol "HFILTER_HOSTNAME_4" {
            weight = 2.50;
            description = "Hostname checks (hard)";
        }
        symbol "HFILTER_HOSTNAME_5" {
            weight = 3.00;
            description = "Hostname checks (very hard)";
        }
        symbol "HFILTER_HELO_NORESOLVE_MX" {
            weight = 0.20;
            description = "MX found in Helo and no resolve";
        }
        symbol "HFILTER_HELO_NORES_A_OR_MX" {
            weight = 0.3;
            description = "Helo no resolve to A or MX";
        }
        symbol "HFILTER_HELO_IP_A" {
            weight = 1.00;
            description = "Helo A IP != hostname IP";
        }
        symbol "HFILTER_HELO_NOT_FQDN" {
            weight = 2.00;
            description = "Helo not FQDN";
        }
        symbol "HFILTER_FROMHOST_NORESOLVE_MX" {
            weight = 0.5;
            description = "MX found in FROM host and no resolve";
        }
        symbol "HFILTER_FROMHOST_NORES_A_OR_MX" {
            weight = 1.50;
            description = "FROM host no resolve to A or MX";
        }
        symbol "HFILTER_FROMHOST_NOT_FQDN" {
            weight = 3.00;
            description = "FROM host not FQDN";
        }
        symbol "HFILTER_FROM_BOUNCE" {
            weight = 0.00;
            description = "Bounce message";
        }
    /*
        symbol {
            weight = 0.50;
            name = "HFILTER_MID_NORESOLVE_MX";
            description = "MX found in Message-id host and no resolve";
        }
        symbol {
            weight = 0.50;
            name = "HFILTER_MID_NORES_A_OR_MX";
            description = "Message-id host no resolve to A or MX";
        }
        symbol {
            weight = 0.50;
            name = "HFILTER_MID_NOT_FQDN";
            description = "Message-id host not FQDN";
        }
    */
        symbol "HFILTER_HOSTNAME_UNKNOWN" {
            weight = 2.50;
            description = "Unknown hostname (no PTR or no resolve PTR to hostname)";
        }
        symbol "HFILTER_RCPT_BOUNCEMOREONE" {
            weight = 1.50;
            description = "Message from bounce and over 1 recepient";
        }
        symbol "HFILTER_URL_ONLY" {
            weight = 2.20;
            description = "URL only in body";
        }
        symbol "HFILTER_URL_ONELINE" {
            weight = 2.50;
            description = "One line URL and text in body";
        }
    }

    group "dmarc" {

        symbol "DMARC_POLICY_ALLOW" {
            weight = -0.5;
            description = "DMARC permit policy";
        }
        symbol "DMARC_POLICY_ALLOW_WITH_FAILURES" {
            weight = -0.5;
            description = "DMARC permit policy with DKIM/SPF failure";
        }
        symbol "DMARC_POLICY_REJECT" {
            weight = 2.0;
            description = "DMARC reject policy";
        }
        symbol "DMARC_POLICY_QUARANTINE" {
            weight = 1.5;
            description = "DMARC quarantine policy";
        }
        symbol "DMARC_POLICY_SOFTFAIL" {
            weight = 0.1;
            description = "DMARC failed";
        }
    }
    group "mime_types" {
        symbol "MIME_GOOD" {
            weight = -0.1;
            description = "Known content-type";
            one_shot = true;
        }
        symbol "MIME_BAD" {
            weight = 1.0;
            description = "Known bad content-type";
            one_shot = true;
        }
        symbol "MIME_UNKNOWN" {
            weight = 0.1;
            description = "Missing or unknown content-type";
            one_shot = true;
        }
        symbol "MIME_BAD_ATTACHMENT" {
            weight = 4.0;
            description = "Invalid attachement mime type";
            one_shot = true;
        }
        symbol "MIME_ENCRYPTED_ARCHIVE" {
            weight = 2.0;
            description = "Encrypted archive in a message";
            one_shot = true;
        }
        symbol "MIME_ARCHIVE_IN_ARCHIVE" {
            weight = 5.0;
            description = "Archive within another archive";
            one_shot = true;
        }
        symbol "MIME_DOUBLE_BAD_EXTENSION" {
            weight = 3.0; # This rule has dynamic weight up to 4.0
            description = "Bad extension cloaking";
            one_shot = true;
        }
        symbol "MIME_BAD_EXTENSION" {
            weight = 2.0; # This rule has dynamic weight up to 4.0
            description = "Bad extension";
            one_shot = true;
        }
    }

    .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/metrics.conf"
    .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/metrics.conf"
}