Skip to content

Commit 8b6db45

Browse files
Merge pull request #37 from crowdsecurity/detect_unix_socket
Add unix socket detection
2 parents 502d65f + 15df7b1 commit 8b6db45

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

openresty/crowdsec_openresty.conf

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ init_by_lua_block {
1616
end
1717
}
1818

19+
map $server_addr $unix {
20+
default 0;
21+
"~unix:" 1;
22+
}
23+
1924
access_by_lua_block {
2025
local cs = require "crowdsec"
21-
cs.Allow(ngx.var.remote_addr)
22-
}
26+
if ngx.var.unix == "1" then
27+
ngx.log(ngx.DEBUG, "[Crowdsec] Unix socket request ignoring...")
28+
else
29+
cs.Allow(ngx.var.remote_addr)
30+
end
31+
}

0 commit comments

Comments
 (0)