Skip to content

tmiland/csf-custom-regex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csf custom regex

enable CSF Firewall custom regex support

Work in progress

See the script in action:

Inspiration from: enable CSF Firewall native fail2ban like support

Installation

wget https://github.com/tmiland/csf-custom-regex/raw/master/csf_custom_regex.sh && \
chmod +x csf_custom_regex.sh && \
./csf_custom_regex.sh --install
  • Install option will download regex.custom.pm
  • Status option will run tail -f /var/log/lfd.log | grep 'LF_CUSTOMTRIGGER'

You will see lines like: Mar 15 00:05:46 vps lfd[688]: (nginx_444) Nginx 444 [IP Adress] (CA/Canada/-): 5 in the last 3600 secs - *Blocked in csf* for 86400 secs [LF_CUSTOMTRIGGER]

Logpaths are currently hardcoded to match Debian 10 with Virtualmin.

Tested on:

  • Debian 10-13

Compatibility and Requirements

  • Debian 9 and later
    • Might add Compatibility on request
  • Virtualmin is required
    • Might change in the future

Credits

Donations

Buy Me A Coffee

  • PayPal me
  • [BTC] : 33mjmoPxqfXnWNsvy8gvMZrrcG3gEa3YDM

Disclaimer

*** Use at own risk ***

License

MIT License Image

MIT License