Using BFM with CSF (all together)
I installed CSF to work with BFM using the link above (automated method) :
-
https://help.poralix.com/articles/how-to-block-ips-with-csf-directadmin-bfm
Everything seem's to work well (after 2 days).
Analyzing the log file '/var/log/exim/rejectlog', I found we have too many authentication required from the same IPs
2019-09-21 15:05:21 H=([193.32.160.145]) [193.32.160.135] F=<
[email protected]> rejected RCPT <
[email protected]>:
2019-09-21 15:05:21 H=([193.32.160.145]) [193.32.160.135] F=<
[email protected]> rejected RCPT <
[email protected]>:
2019-09-21 15:05:21 H=([193.32.160.145]) [193.32.160.135] F=<
[email protected]> rejected RCPT <
[email protected]>:
2019-09-21 15:05:21 H=([193.32.160.145]) [193.32.160.135] F=<
[email protected]> rejected RCPT <
[email protected]>:
So I customized the line above (in '/etc/csf/csf.conf')
- CUSTOM1_LOG = "/var/log/exim/rejectlog"
And added the lines above (in '/etc/csf/regex.custom.pm')
if (($globlogs{CUSTOM1_LOG}{$lgfile}) and ($line =~ /^(.+) H=\(\S+\) \[(\S+)\] F=\<\S+\> rejected RCPT \<\S+\>: authentication required/)) {
return ("RCPT not allowed from ",$2,"RCPT","5",,"3600");
}
I've restarted csf using 'csf -r' and lfd using 'lfd -r'
But even if BFM works, CSF custom scans seem's to be ignored.
I (successfully) tested the regex using the link above :
-
https://www.regextester.com/
After reading all this thread, I understood that only bfm is active. The scans provided by csf alone are not.
How is it possible to keep bfm active AND add some custom ones ?
Many thank's for any help,
Jérémy