Hello CrowdSec Community,
I’m a complete newcomer to CrowdSec, having used it for only 2-3 days. I’m trying to understand a specific behavior and would appreciate your expertise.
My Setup: I’m running CrowdSec on my Nginx Proxy Manager (NPM) instance. This NPM acts as a reverse proxy for several internal services running on different servers in my network. One of these backend services is protected with HTTP Basic Auth (.htaccess). This means the authentication is handled by the backend server itself, not by NPM.
The Problem & My Observation: My primary goal is to protect this service from brute-force attacks. Here is what I’ve observed:
-
When a normal user accesses the service via a browser, a
GETrequest is made. If the password is wrong, the backend server correctly sends a401 Unauthorizedstatus, which I can clearly see in the NPMaccess.log. However, CrowdSec takes no action on this. This is a major security issue for me, as an attacker could try hundreds of thousands of passwords unnoticed. -
To investigate this, I dug deeper. I can see that the standard scenario
crowdsecurity/http-generic-bfis installed. (http-generic-bf Scenario) -
Surprisingly, when I ran a test simulating an attack using the
POSTmethod, the IP was immediately and correctly blocked.
I’m now facing a situation where the standard attack vector via a browser (GET) is completely unprotected, while the less common POST attack vector is secured. As a newcomer, it’s not clear to me why the POST attack is caught—it could be the parser flagging it as an auth_fail for the http-generic-bf scenario, or another, more specific POST-only scenario is catching it. Either way, the result is that GET requests are not being handled.
My Questions for You:
-
Why is there a difference between
GETandPOST? Is there a specific reason why a401error on aGETrequest is not considered a real authentication failure by the default parser/scenario setup? Or, as a newcomer, is it possible I have a fundamental misunderstanding of how this is supposed to work? -
What is the best practice for this situation? How do others secure their services that use Basic Auth on a backend server? The key constraint here is that my CrowdSec instance can only read the NPM
access.log. I do not have access to theerror.logof the backend service on the other server, where more explicit failure messages might be logged. Any decision to ban an IP must be made solely based on the proxy’s access log data (i.e., seeing repeated401statuses onGETrequests).
I would be grateful for any advice on how to properly and securely handle what I imagine is a very common use case.
Thank you!