Comment on Using Fail2ban to protect exposed services

melroy@kbin.melroy.org ⁨16⁩ ⁨hours⁩ ago

Yes, I run many services and website on the public web at home. Harden your server first. Like disabling root ssh login.

Also enable auto updates on your server.
Use your router/server to block many some counties. You could also use block lists, there any many bad ip lists out there.

Configure rate limits in Nginx.

You also mentioned fail2ban. You can define many rules and actions. Like blocking ips that might go over your previously defined rate limits. Or 4xx action for ips that request a lot of non existing pages (404 errors) .

Also captcha won't cut it anymore today. Try https://github.com/TecharoHQ/anubis

Of course expose only what you want to expose, so only open ports in your firewall you really want to open. Ideally put everything behind a reverse proxy like Nginx.

Let's start with all of the things mentioned above. Ping me later if want to know more or have questions.

source
Sort:hotnewtop