fail2ban/fail2ban ? reverse-engineered prompt

Reverse engineered prompt

I need a server security tool that stops bots from trying to guess passwords on my server. It should run as a background service and constantly watch system log files, like for SSH and Apache.

When it detects an IP address that's failing to log in too many times in a row, I want it to automatically ban that IP address for a little while. It should do this by updating the system's firewall to temporarily reject any new connections from that IP. The ban duration should be configurable.

It should work out of the box for common services but also be easy for me to add custom rules for other applications or log file formats. It needs to handle both IPv4 and IPv6 addresses. This should be built in Python, and you can model it after the popular Fail2Ban utility.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab