Skip to content

Commit

Permalink
Merge pull request #37 from crowdsecurity/detect_unix_socket
Browse files Browse the repository at this point in the history
Add unix socket detection
  • Loading branch information
LaurenceJJones authored Nov 3, 2023
2 parents 502d65f + 15df7b1 commit 8b6db45
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions openresty/crowdsec_openresty.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,16 @@ init_by_lua_block {
end
}

map $server_addr $unix {
default 0;
"~unix:" 1;
}

access_by_lua_block {
local cs = require "crowdsec"
cs.Allow(ngx.var.remote_addr)
}
if ngx.var.unix == "1" then
ngx.log(ngx.DEBUG, "[Crowdsec] Unix socket request ignoring...")
else
cs.Allow(ngx.var.remote_addr)
end
}

0 comments on commit 8b6db45

Please sign in to comment.