Crowdsec Nginx Bouncer

Crowdsec Nginx Bouncer

We have seen previously how to install Crowdsec on a Raspberry PI. Now we are going to see how to install the bouncer for Nginx. For this installation we use a container Debian 10 with Nginx 1.14.2.
We are beginning by Crowdsec installation.

Crowdsec installation

apt-get install bash gettext whiptail curl wget
curl -s https://api.github.com/repos/crowdsecurity/crowdsec/releases/latest | grep browser_download_url| cut -d '"' -f 4  | wget -i -
tar xvzf crowdsec-release.tgz
cd crowdsec-v*
sudo ./wizard.sh -i

Bouncer Nginx Installation

wget https://github.com/crowdsecurity/cs-nginx-bouncer/releases/download/v0.0.4/cs-nginx-bouncer.tgz
tar xvzf cs-nginx-bouncer.tgz
cd cs-nginx-bouncer-*
sudo ./install.sh

The script install missing dependencies :

lua not found, do you want to install it (Y/n)?
Y
lua5.3 successfully installed
lua-sec not found, do you want to install it (Y/n)?
....

We can test by add your public IP to the ban list (decisions).

cscli decisions add --ip VotreIpPublique

You must get the message :

Don’t forget to unban your IP 😉

cscli decisions delete --ip VotreIpPublique

Leave a Reply

Your email address will not be published. Required fields are marked *