Block whole countries in CSF

keat63

Well-Known Member
Nov 20, 2014
1,961
267
113
cPanel Access Level
Root Administrator
If I add country codes in CSF, does this also stop the particular country accessing a web site on port 80.
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
You should be asking this question over on the CSF forums. It's probably been answered already, so you might search those forums before posting. CSF is not supported by cPanel.

If you block a country, you block the country.

You should read the warnings in your firewall settings under the Country Code Lists and Settings section as well.
 

24x7ss

Well-Known Member
Sep 30, 2014
272
19
68
India
cPanel Access Level
Root Administrator
Twitter
check CC_DENY option in csf firewall configuration file to block that particular country. Restart the firewall once modification is done
 
  • Like
Reactions: danrussell

keat63

Well-Known Member
Nov 20, 2014
1,961
267
113
cPanel Access Level
Root Administrator
check CC_DENY option in csf firewall configuration file to block that particular country. Restart the firewall once modification is done
I've blocked about 6, although reading between the lines CSF suggests only a small list, so I'm not sure i dare increase it much more.
My main question really was to determine id it stopped access to the admin side, but still allowed access to the http side.
 

quizknows

Well-Known Member
Oct 20, 2009
1,008
87
78
cPanel Access Level
DataCenter Provider
It blocks any and all network traffic to your server from those IPs, and any traffic from your server toward those IPs.

If you have privileged services (like WHM on 2087) that only you need to access, it's much easier and more efficient to just whitelist your IP in csf.allow and remove port 2087 from the open TCP ports list.

Blocking countries to subvert abuse is only so effective. I tried the strategy for a long time when I was a forum admin seeing a ton of fake accounts. If I blocked RU, they'd sign up from CN. When I blocked CN, they signed up from proxies in the USA. The trick for me was just securing the signup form to resist bots a bit better. Any strategy to secure your data that doesn't involve blocking IP addresses is usually a better investment of your time.
 

keat63

Well-Known Member
Nov 20, 2014
1,961
267
113
cPanel Access Level
Root Administrator
I've closed ports 21, 22 and 2087 in CSF already.
I've also configured csf to be very aggressive where port scanning is concerned.
 

Virgilio18

Registered
Jul 22, 2015
4
0
1
usa
cPanel Access Level
Website Owner
hello do i need to allow all
Country Codes in
ALLOW in CSF Firewall
for my website be visible in all country because my web is not visible in spain ?

eukhost.com/forums/f15/country-codes-required-cc_deny-allow-csf-firewall-18835/
 
Last edited by a moderator:

quizknows

Well-Known Member
Oct 20, 2009
1,008
87
78
cPanel Access Level
DataCenter Provider
You should virtually never use the ALLOW for country codes, it opens up your firewall entirely too much. Unless you are specifically denying spain IPs your site should be visible to them unless your hosting provider has blocked something in error.
 

Virgilio18

Registered
Jul 22, 2015
4
0
1
usa
cPanel Access Level
Website Owner
AM IN THE US BUT SOME CLIENT HAVING PROBLEM HERE IN THE US TOO THEY CANT SEE MY WEB ONLY IF THE PUT THEY IP IN cphulk whitelistTHE HOW CONT I FIX THIS
 

TerranceR

Well-Known Member
Jul 9, 2015
73
9
83
Houston, TX
cPanel Access Level
Root Administrator
Hello,

You should also note that this will affect DNS so if you run a DNS server on your server you should probably note that they will get no DNS responses if they are in a blocked country showing inconsistencies across various DNS servers.