crowdsecurity / cs-nginx-bouncer

CrowdSec bouncer for Nginx
MIT License
50 stars 9 forks source link

Add `resolver` to crowdsec_nginx.conf #61

Closed Fijxu closed 2 months ago

Fijxu commented 2 months ago

When the bouncer tries to validate the captcha with the captcha service selected by the user it fails with [lua] crowdsec.lua:689: Allow(): Error while validating captcha: no resolver defined to resolve "example.com" in the error logs of NGINX/Openresty without sending the request to the captcha service making the captcha useless because the form can be filled with anything and It will pass.

The https://docs.crowdsec.net/u/bouncers/nginx/#nginx-configuration pages shows resolver 8.8.8.8 ipv6=off; and when I added that to the configuration, the bouncer was able to verify key with the captcha backend selected.

Feel free to change the resolver used.

blotus commented 2 months ago

Hello,

We did not add the resolver directive in the default configuration because it can break some nginx configuration:

Because of this, and because you need to modify the configuration to enable captcha support anyway, it's better to leave it to the user to set it up if required.