OP防火墙-0.2.3

This commit is contained in:
midoks
2022-10-24 23:12:45 +08:00
parent d5f3b0d442
commit 4e05f29fcd
5 changed files with 85 additions and 2 deletions
+11
View File
@@ -33,6 +33,7 @@ local user_agent_rules = require "rule_user_agent"
local post_rules = require "rule_post"
local cookie_rules = require "rule_cookie"
local url_rules = require "rule_url"
local url_white_rules = require "rule_url_white"
local server_name = string.gsub(C:get_sn(config_domains),'_','.')
@@ -181,6 +182,13 @@ local function waf_ip_white()
return false
end
local function waf_url_white()
if C:ngx_match_list(url_white_rules, params['uri']) then
return true
end
return false
end
local function waf_ip_black()
-- ipv4 ip black
for _,rule in ipairs(ip_black_rules)
@@ -517,6 +525,9 @@ function waf()
-- white ip
if waf_ip_white() then return true end
-- url white
if waf_url_white() then return true end
-- black ip
if waf_ip_black() then return true end