ModSecurity @pmFromFile to block bad bots

Nibin

New Member
#1
Hello,

I have added the following rule into the configuration to block a list of bad bots.

module mod_security {
modsecurity on
modsecurity_rules_file /usr/local/lsws/conf/httpd-modsecurity.conf
modsecurity_rules_file /usr/local/directadmin/data/admin/modsecurity_rules
modsecurity_rules `
SecRule REQUEST_HEADERS:User-Agent "@pmFromFile /etc/custom/badbots.txt" "id:7713458,rev:1,severity:2,log,noauditlog,msg:' Bad Bot detected and blocked.'"
`
}

The file /etc/custom/badbots.txt looks like the following.

AhrefsBot
Anonymizer
Attributor
Baidu
Bandit
BatchFTP
Bigfoot
Black.Hole
Bork-edition
DataCha0s
Deepnet Explorer
desktopsmiley
DigExt
feedfinder
gamingharbor
heritrix
ia_archiver
Indy Library
Jakarta
juicyaccess
larbin
linkdex


However, I have noticed that this rule is not working in OLS but the same rule works perfectly fine in Litespeed Enterprise. Please someone help to understand what I am missing here? I have other rules working fine...so ModSec is enabled and working fine.

Thanks in advance.
 
Top