[#922] Add whitelist check for the default-server as well and fix badbehavior whitelist check

This commit is contained in:
Théophile Diot 2024-02-13 14:34:50 +01:00
parent 2e7ddb69f9
commit 2d2526bc5c
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
3 changed files with 13 additions and 2 deletions

View file

@ -21,7 +21,7 @@ end
function badbehavior:log()
-- Check if we are whitelisted
if is_whitelisted(self.ctx) == "yes" then
if is_whitelisted(self.ctx) then
return self:ret(true, "client is whitelisted")
end
-- Check if bad behavior is activated

View file

@ -42,6 +42,13 @@
"reversescan"
],
"log_stream": ["badbehavior", "bunkernet"],
"log_default": ["badbehavior", "bunkernet", "errors", "misc", "metrics"],
"log_default": [
"whitelist",
"badbehavior",
"bunkernet",
"errors",
"misc",
"metrics"
],
"timer": ["metrics"]
}

View file

@ -170,6 +170,10 @@ function whitelist:preread()
return self:access()
end
function whitelist:log_default()
return self:access()
end
function whitelist:kind_to_ele(kind)
if kind == "IP" then
return "ip" .. self.ctx.bw.remote_addr