Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Block whole countries in CSF

Discussion in 'Security' started by keat63, Dec 9, 2014.

  1. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    995
    Likes Received:
    41
    Trophy Points:
    28
    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.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,309
    Likes Received:
    393
    Trophy Points:
    583
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    995
    Likes Received:
    41
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    Wasn't aware of that.

    Thanks
     
  4. 24x7ss

    24x7ss Well-Known Member

    Joined:
    Sep 30, 2014
    Messages:
    271
    Likes Received:
    16
    Trophy Points:
    18
    Location:
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    danrussell likes this.
  5. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    995
    Likes Received:
    41
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    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.
     
  6. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    1,010
    Likes Received:
    87
    Trophy Points:
    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.
     
  7. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    995
    Likes Received:
    41
    Trophy Points:
    28
    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.
     
  8. Virgilio18

    Virgilio18 Registered

    Joined:
    Jul 22, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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/
     
    #8 Virgilio18, Jul 22, 2015
    Last edited by a moderator: Jul 22, 2015
  9. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    1,010
    Likes Received:
    87
    Trophy Points:
    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.
     
  10. Virgilio18

    Virgilio18 Registered

    Joined:
    Jul 22, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  11. TerranceR

    TerranceR Well-Known Member

    Joined:
    Jul 9, 2015
    Messages:
    74
    Likes Received:
    10
    Trophy Points:
    83
    Location:
    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.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice