Commit f43e931d by Joneq

增加慢速统计302跳转代码

parent 443b0840
Showing with 19 additions and 1 deletions
......@@ -97,13 +97,19 @@ end
-- 黑名单存在直接302
-- 黑名单存在直接403
if wafcheck.BlackIp(user_ip,red) == 'exist' or wafcheck.BlackUrl(temp_uri,red) == 'exist' or wafcheck.BlackHeader(u_agent,red) == 'exist' then
ngx.exit(ngx.HTTP_FORBIDDEN)
return
end
-- 在302直接跳转google验证
if wafcheck.Threetwoone(user_ip,red) == 'exist' then
redirect.checkgoogle(red)
end
-------20210316对nginx的参数xss进行处理
if "GET" == ngx.var.request_method then
......
......@@ -66,4 +66,15 @@ function _Wafcheck.BlackHeader(header,redis)
return "continue"
end
-------慢速统计出来的302ip
function _Wafcheck.Threetwoone(user_ip,redis)
local is_exist ,err = redis:sismember('ichunt_waf_three_zero_two_list', user_ip)
if is_exist == 1 then
return "exist"
end
return "continue"
end
return _Wafcheck
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment