Able to block spam bots and other unwanted traffic to a site

dogpaw

Member
Apr 26, 2012
9
0
51
cPanel Access Level
Root Administrator
Is there a good way to block access to a specific cPanel account from various countries, spam bots, or domains? These unwanted visits are using up a bulk of our allocated bandwidth.

Thanks
 

quizknows

Well-Known Member
Oct 20, 2009
1,008
87
78
cPanel Access Level
DataCenter Provider
As far as countries that is difficult, you could block IP ranges in the sites .htaccess but there are better approaches for stopping unwanted traffic that don't involve IP blocking.

You can block a lot of requests based on user agent or other attributes using mod_security. I would advise creating some custom rules to deny the user agents of the spam bots. Also if you use both CSF and Mod_Security, CSF can ban peoples IP's based on repeat triggers of modsec rules.
 

dogpaw

Member
Apr 26, 2012
9
0
51
cPanel Access Level
Root Administrator
As far as countries that is difficult, you could block IP ranges in the sites .htaccess but there are better approaches for stopping unwanted traffic that don't involve IP blocking.

You can block a lot of requests based on user agent or other attributes using mod_security. I would advise creating some custom rules to deny the user agents of the spam bots. Also if you use both CSF and Mod_Security, CSF can ban peoples IP's based on repeat triggers of modsec rules.
This sounds like a good way to go but not having any experience in using Mod_Security, it looks like I'll be googling that and researching.

I appreciate your help.
 

alphawolf50

Well-Known Member
Apr 28, 2011
186
2
68
cPanel Access Level
Root Administrator
Definitely use CSF. It has the ability to block entire countries (but only for the entire server, not by account), and as quizknows stated, it can automatically block people who repeatedly trigger ModSecurity rules, or try to brute force your logins, or... any of a number of things.

I'd recommend the Atomiccorp ModSecurity rules. They already have rules to block many of the worst bots (and vulnerability scanners), and I've had less false positives with these than the rules that were installed by default.
 

quizknows

Well-Known Member
Oct 20, 2009
1,008
87
78
cPanel Access Level
DataCenter Provider
I'd recommend the Atomiccorp ModSecurity rules. They already have rules to block many of the worst bots (and vulnerability scanners), and I've had less false positives with these than the rules that were installed by default.
Agreed, great rule set and very few false positives.
 

quizknows

Well-Known Member
Oct 20, 2009
1,008
87
78
cPanel Access Level
DataCenter Provider
CSF is a plugin that manages IP tables firewall rules (open and closed ports, etc) and also has a login failure daemon that blocks IPs for excessive failed logins. Make sure your server does not have another software firewall like APF before you install it. CSF is awesome, it even lets you block/unblock IPs from WHM.
 

dogpaw

Member
Apr 26, 2012
9
0
51
cPanel Access Level
Root Administrator
CSF is a plugin that manages IP tables firewall rules (open and closed ports, etc) and also has a login failure daemon that blocks IPs for excessive failed logins. Make sure your server does not have another software firewall like APF before you install it. CSF is awesome, it even lets you block/unblock IPs from WHM.
WHM by default allows me to block IPs after excessive failed logins and manually enter whitelist and blacklist IPs. I wonder what this plugin has to offer that's not already built into WHM by default. Sounds like I need to read more about this plugin....
 

sford999

Member
Apr 20, 2004
20
0
151
UK
cPanel Access Level
Root Administrator
WHM by default allows me to block IPs after excessive failed logins and manually enter whitelist and blacklist IPs. I wonder what this plugin has to offer that's not already built into WHM by default. Sounds like I need to read more about this plugin....
It offers so many more features than WHM does to protect your server. IMO its by far the best software firewall