Repository navigation
2.3.1: CrowdSec on the same machine
From the write-up in #32: CrowdSec installed on the haproxy-manager server itself, rather than on a machine of its own. That already worked in 2.3.0, but the interface and the guide both spoke as if it did not.
Nothing changes for an installation that does not use CrowdSec.
What changed
- The AppSec URL hint no longer says "not 127.0.0.1". With CrowdSec on the same machine,
http://127.0.0.1:7422/is the right address, and the hint now says so. A listener on another machine still has to be on an address the node can reach. - The LAPI test says when it is talking to haproxy-manager. CrowdSec's LAPI wants port 8080, which the haproxy-manager interface already has. A LAPI URL left on that port used to get the LAPI answered 404. It now says that the address is haproxy-manager's own interface, and how to move the LAPI to another port. The LAPI URL hint mentions it too.
- HAProxy no longer logs two
SPOE:lines for every request. While CrowdSec was on, HAProxy wrote two extra lines per request to its log, beside the request's own line. Only a bouncer that fails is logged now. The change takes effect at the next Apply.
In the guide
The CrowdSec page has two new sections:
- CrowdSec on the same machine: installing the engine, moving its LAPI off port 8080, and AppSec on
127.0.0.1. - Bans from HAProxy's logs: the
crowdsecurity/haproxycollection and the journal acquisition, so that CrowdSec bans addresses that probe or crawl, on top of what AppSec refuses.
If you used a workaround for AppSec on 2.2
A systemd drop-in that makes the bouncer read a copy of its configuration is left alone by the update, and keeps working. To move to the built-in setting:
- Fill in AppSec URL under Access › CrowdSec, test, save and Apply. Request bodies are inspected from then on.
- Remove the drop-in, run
sudo systemctl daemon-reload, and restartcrowdsec-spoa-bouncer.
Until the drop-in is removed, later changes made in haproxy-manager (API key, captcha, contact URL) do not reach the bouncer.
Tested
On Debian 13 under systemd (HAProxy 3.0), with CrowdSec 1.8.2 and haproxy-manager on one machine: LAPI on port 8081, AppSec on 127.0.0.1:7422, a ban from HAProxy's log through to the 403 page. An update from 2.2.0 with the workaround above in place, then the move to the built-in setting. The log change also on the container image (HAProxy 3.4). Not tried: RPM systems.