https://github.com/tmiland/csf-custom-regex
enable CSF Firewall native fail2ban like support
https://github.com/tmiland/csf-custom-regex
abuse abuse-detection bind9 blocking buster csf csf-firewall debian fail2ban lfd nginx perl postfix regex smtp virtualmin
Last synced: 11 months ago
JSON representation
enable CSF Firewall native fail2ban like support
- Host: GitHub
- URL: https://github.com/tmiland/csf-custom-regex
- Owner: tmiland
- License: mit
- Created: 2021-03-14T00:46:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-05-08T09:49:49.000Z (almost 4 years ago)
- Last Synced: 2025-03-22T02:04:10.991Z (11 months ago)
- Topics: abuse, abuse-detection, bind9, blocking, buster, csf, csf-firewall, debian, fail2ban, lfd, nginx, perl, postfix, regex, smtp, virtualmin
- Language: Perl
- Homepage:
- Size: 108 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csf custom regex
enable CSF Firewall custom regex support
### ***Work in progress***
Inspiration from: [enable CSF Firewall native fail2ban like support](https://community.centminmod.com/posts/62343/)
## Installation
```bash
$ 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](https://github.com/tmiland/csf-custom-regex/raw/master/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.**
* If Virtualmin or CSF is not installed, you will get the question to install.
This will source the [Virtualmin install script](https://github.com/virtualmin/virtualmin-install) and [CSF installer script](https://github.com/tmiland/csf)
## Tested on:
* Debian 10
## Compatibility and Requirements
* Debian 9 and later
- Might add Compatibility on request
* Virtualmin is required
* Might change in the future
## Credits
- Code is customized from these sources:
* [enable CSF Firewall native fail2ban like support](https://community.centminmod.com/posts/62343/)
* [Custom REGEX rules for CSF](https://forum.configserver.com/viewtopic.php?t=7517)
* [sillsdev/ops-ansible-common-roles](https://github.com/sillsdev/ops-ansible-common-roles/blob/master/csf_config/files/regex.custom.pm)
* [configserver](http://www.configserver.com)
## Donations
- [PayPal me](https://paypal.me/milanddata)
- [BTC] : 33mjmoPxqfXnWNsvy8gvMZrrcG3gEa3YDM
## Web Hosting
Sign up for web hosting using this link, and receive $100 in credit over 60 days.
[DigitalOcean](https://m.do.co/c/f1f2b475fca0)
#### Disclaimer
*** ***Use at own risk*** ***
### License
[](https://github.com/tmiland/csf-custom-regex/blob/master/LICENSE)
[MIT License](https://github.com/tmiland/csf-custom-regex/blob/master/LICENSE)