How do you deal with malicious requests to your servers?
I put up a vps with nginx and the logs show dodgy requests within minutes, how do you guys deal with these?
Edit: Thanks for the tips everyone!
You are viewing a single comment
I put up a vps with nginx and the logs show dodgy requests within minutes, how do you guys deal with these?
Edit: Thanks for the tips everyone!
I would suggest crowdsec and not fail2ban
Seconded, not only is CrowdSec a hell of a lot more resource efficient (Go vs Python IIRC), having it download a list of known bad actors for you in advance really slows down what it needs to process in the first place. I’ve had servers DDoSed just by fail2ban trying to process the requests.
Hi,
Reading the thread I decided to give it a go, I went ahead and configured crowdsec. I have a few questions, if I may, here's the setup:
If I understand correctly, any attack detected will result in the ip being banned via iptables rule (for a configured duration, by default 4 hours).
Well I was expecting some form of notification for replies, but still, seen it now.
My understanding of this is limited having mostly gotten as far as you have and been satisfied.
For other bouncers, there’s actually a few decisions you can apply. By default the only decision is
BAN
which as the name suggests just outright blocks the IP at whatever level your bouncer runs at (L4 for firewall and L7 for nginx). The nginx bouncer can do more thought withCAPTCHA
orCHALLENGE
decisions to allow false alerts to still access your site. I tried writing something similar for traefik but haven’t deployed anything yet to comment further.Wih updates, I don’t have them on automated, but I do occasionally go in and run a manual update when I remember (usually when I upgrade my OPNSense firewall that’s runs it). I don’t think it’s a bad idea at all to automate them, however the attack vectors don’t change that often. One thing to note, newer scenarios only run on the latest agent, something I discovered recently when trying to upgrade. I believe it will refuse to update them if it would cause them to break in this way, but test it yourself before enabling corn