Crowdsec for wordpress

Prerequisites

Getting started

CrowdSec v1

curl -s https://packagecloud.io/install/repositories/crowdsec/crowdsec/script.deb.sh | sudo bash
apt install crowdsec

Remediation Component

apt install crowdsec-firewall-bouncer-iptables

Wordpress extension

Wordpress Bouncer

Crowdsec extension

Download it here or from WP admin panel.

Extension parameters

Generate API Key

cscli bouncers add wordpress-bouncer

WP BO -> Crowdsec > Crowdsec

Local API URL = http://localhost:8080
Authentication type = Bouncer API Key
Bouncing level = Normal Bouncing
Public website only = unchecked

WP BO -> Crowdsec > Advanced

Recheck clean IPs each = 1
Recheck bad IPs each = 1

Litespeed scenarios

sudo cscli collections install crowdsecurity/litespeed

And configure the file /etc/crowdsec/acquis.yml :

filenames:
  - /usr/local/lsws/vhosts/<YOURVHOST>/logs/*.log
  - /usr/local/lsws/admin/logs/*.log
  - /usr/local/lsws/logs/*.log
labels:
  type: litespeed