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!

Blacklisting Countries

Discussion in 'Security' started by FlyBit, Dec 12, 2017.

  1. FlyBit

    FlyBit Registered

    Joined:
    Dec 12, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    ZA
    cPanel Access Level:
    Root Administrator
    With recent increase of brute force attacks on our server, is there a easier way to block countries to gain access to the server?

    I have obtained IP ranges from the following website:
    CIPB - Create Country ACL

    However it takes forever to load a country in the blacklist section.

    Any way to speed up the process by listing the countries and blacklist access to them?
     
  2. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    995
    Likes Received:
    41
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    CSF firewall which is free, and will allow you to block countries by thier country code.
    adding a country code takes less than 30 seconds.
    although you need to be aware that the list of IP's against country code is not 100% accurate.

    In all honesty, if you don't have CSF firewall installed, then you really should consider it.
     
  3. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,834
    Likes Received:
    85
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Exactly how many countries you are planning to block? The more the countries you add, more the fireawall takes time to load. Just make sure that you do not overload it..

    If attack is more concern, you can get a hardware firewall solution from your datacenter on your server, which is more preferred than software firewall..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. linux4me2

    linux4me2 Well-Known Member

    Joined:
    Aug 21, 2015
    Messages:
    200
    Likes Received:
    46
    Trophy Points:
    28
    Location:
    USA
    cPanel Access Level:
    Root Administrator
    It's not as complete as the CSF approach, but if you are on a VPS (in which case CSF country blocks aren't recommended) or worried about the load on CSF blocking countries would cause, you can instead add a custom rule to ModSecurity and use the GeoIP country database to block/allow access to your sites for specific countries.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,856
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The previous posts should help point you in the right direction. Let us know if you have additional questions.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. FlyBit

    FlyBit Registered

    Joined:
    Dec 12, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    ZA
    cPanel Access Level:
    Root Administrator
    Well, the server can handle the load, currently Brute force protection blocks about 200 - 300 hits per day. Blocking all countries but ours (clients are locally based, and server only used for backup and email).

    So adding one country at a time is about 500 - 7000 IP Blocks. So looking for a alternative that is much easier to manage and yet effective against attacks.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,367
    Likes Received:
    1,856
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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