mykeenu 2 weeks ago
parent
commit
5475c44ce2
No account linked to committer's email address
1 changed files with 11 additions and 2 deletions
  1. 11
    2
      lualib/lua_scanners/pyzor.lua

+ 11
- 2
lualib/lua_scanners/pyzor.lua View File

message = '${SCANNER}: Pyzor bulk message found: "${VIRUS}"', message = '${SCANNER}: Pyzor bulk message found: "${VIRUS}"',
default_score = 1.5, default_score = 1.5,
action = false, action = false,
min_threshold = 0, -- zero score if whitelist+report count smaller than this
halfscore_threshold = 0, -- half score if whitelist+report count smaller than this
} }


pyzor_conf = lua_util.override_defaults(pyzor_conf, opts) pyzor_conf = lua_util.override_defaults(pyzor_conf, opts)
rule.default_score: 1 rule.default_score: 1
Weight: 0 Weight: 0
]] ]]
local weight = tonumber(string.format("%.2f",
rule.default_score * (reported - whitelisted) / (reported + whitelisted)))
local weight = 0
local total = reported + whitelisted
if total > rule.min_threshold and total > 0 then
weight = tonumber(string.format("%.2f",
rule.default_score * (reported - whitelisted) / total))
if total < rule.halfscore_threshold then
weight = tonumber(string.format("%.2f", weight / 2))
end
end
local info = string.format("count=%d wl=%d", reported, whitelisted) local info = string.format("count=%d wl=%d", reported, whitelisted)
local threat_string = string.format("bl_%d_wl_%d", local threat_string = string.format("bl_%d_wl_%d",
reported, whitelisted) reported, whitelisted)

Loading…
Cancel
Save