mirror of
https://github.com/openappsec/attachment.git
synced 2025-12-31 13:49:09 +03:00
add new flag for bypass inspections
This commit is contained in:
@@ -32,8 +32,7 @@ function NanoHandler.access(conf)
|
|||||||
user_agent:match("Go%-http%-client") or -- Common health checker
|
user_agent:match("Go%-http%-client") or -- Common health checker
|
||||||
(method == "GET" and path == "/") then -- Root path health checks
|
(method == "GET" and path == "/") then -- Root path health checks
|
||||||
kong.log.debug("Bypassing inspection for internal request: ", method, " ", path, " (UA: ", user_agent, ")")
|
kong.log.debug("Bypassing inspection for internal request: ", method, " ", path, " (UA: ", user_agent, ")")
|
||||||
kong.ctx.plugin.session_data = nil
|
kong.ctx.plugin.bypass_inspection = true
|
||||||
kong.ctx.plugin.session_id = nil
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -212,7 +211,7 @@ end
|
|||||||
|
|
||||||
function NanoHandler.header_filter(conf)
|
function NanoHandler.header_filter(conf)
|
||||||
local ctx = kong.ctx.plugin
|
local ctx = kong.ctx.plugin
|
||||||
if ctx.blocked then
|
if ctx.blocked or ctx.bypass_inspection then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -251,7 +250,7 @@ end
|
|||||||
|
|
||||||
function NanoHandler.body_filter(conf)
|
function NanoHandler.body_filter(conf)
|
||||||
local ctx = kong.ctx.plugin
|
local ctx = kong.ctx.plugin
|
||||||
if ctx.blocked then
|
if ctx.blocked or ctx.bypass_inspection then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user