The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    765
    Likes Received:
    20
    Trophy Points:
    18
    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:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    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.
     
  3. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    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
     
    danrussell likes this.
  5. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    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:
    942
    Likes Received:
    57
    Trophy Points:
    28
    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:
    765
    Likes Received:
    20
    Trophy Points:
    18
    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:
    942
    Likes Received:
    57
    Trophy Points:
    28
    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. cPTerrance

    cPTerrance *nix Technical Analyst II / Migrations Specialist
    Staff Member

    Joined:
    Jul 9, 2015
    Messages:
    72
    Likes Received:
    8
    Trophy Points:
    8
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Twitter:
    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