add whit host support
parent
c0b121a64c
commit
172b56505c
|
@ -6,9 +6,11 @@ Redirect="on"
|
||||||
CookieMatch="on"
|
CookieMatch="on"
|
||||||
postMatch="on"
|
postMatch="on"
|
||||||
whiteModule="on"
|
whiteModule="on"
|
||||||
|
whiteHostModule="on"
|
||||||
black_fileExt={"php","jsp"}
|
black_fileExt={"php","jsp"}
|
||||||
ipWhitelist={"127.0.0.1"}
|
ipWhitelist={"127.0.0.1"}
|
||||||
ipBlocklist={"1.0.0.1"}
|
ipBlocklist={"1.0.0.1"}
|
||||||
|
hostWhiteList = {"www.xxx.com"}
|
||||||
CCDeny="off"
|
CCDeny="off"
|
||||||
CCrate="100/60"
|
CCrate="100/60"
|
||||||
html=[[
|
html=[[
|
||||||
|
|
15
init.lua
15
init.lua
|
@ -10,6 +10,7 @@ UrlDeny = optionIsOn(UrlDeny)
|
||||||
PostCheck = optionIsOn(postMatch)
|
PostCheck = optionIsOn(postMatch)
|
||||||
CookieCheck = optionIsOn(cookieMatch)
|
CookieCheck = optionIsOn(cookieMatch)
|
||||||
WhiteCheck = optionIsOn(whiteModule)
|
WhiteCheck = optionIsOn(whiteModule)
|
||||||
|
WhiteHostCheck = optionIsOn(whiteHostModule)
|
||||||
PathInfoFix = optionIsOn(PathInfoFix)
|
PathInfoFix = optionIsOn(PathInfoFix)
|
||||||
attacklog = optionIsOn(attacklog)
|
attacklog = optionIsOn(attacklog)
|
||||||
CCDeny = optionIsOn(CCDeny)
|
CCDeny = optionIsOn(CCDeny)
|
||||||
|
@ -89,6 +90,20 @@ function whiteurl()
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function whitehost()
|
||||||
|
if WhiteHostCheck then
|
||||||
|
local items = Set(hostWhiteList)
|
||||||
|
for host in pairs(items) do
|
||||||
|
if ngxmatch(ngx.var.host, host, "isjo") then
|
||||||
|
log('POST',ngx.var.request_uri,"-","white host".. host)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
function fileExtCheck(ext)
|
function fileExtCheck(ext)
|
||||||
local items = Set(black_fileExt)
|
local items = Set(black_fileExt)
|
||||||
ext=string.lower(ext)
|
ext=string.lower(ext)
|
||||||
|
|
1
waf.lua
1
waf.lua
|
@ -2,6 +2,7 @@ local content_length=tonumber(ngx.req.get_headers()['content-length'])
|
||||||
local method=ngx.req.get_method()
|
local method=ngx.req.get_method()
|
||||||
local ngxmatch=ngx.re.match
|
local ngxmatch=ngx.re.match
|
||||||
if whiteip() then
|
if whiteip() then
|
||||||
|
elseif whitehost() then
|
||||||
elseif blockip() then
|
elseif blockip() then
|
||||||
elseif denycc() then
|
elseif denycc() then
|
||||||
elseif ngx.var.http_Acunetix_Aspect then
|
elseif ngx.var.http_Acunetix_Aspect then
|
||||||
|
|
Loading…
Reference in New Issue