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!

Share cPHulk Country Blacklist with Apache?

Discussion in 'Security' started by dstana, May 9, 2018.

  1. dstana

    dstana Well-Known Member

    Joined:
    Jul 6, 2016
    Messages:
    59
    Likes Received:
    8
    Trophy Points:
    8
    Location:
    Phoenix, AZ
    cPanel Access Level:
    Root Administrator
    I really like the new cphulk features to block countries. Is it possible to share cphulk's rules with apache or firewalld?
     
  2. web-project

    web-project Well-Known Member

    Joined:
    Nov 23, 2007
    Messages:
    62
    Likes Received:
    5
    Trophy Points:
    58
    use the csf firewall as you be able to block countries and much easier.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,524
    Likes Received:
    251
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. dstana

    dstana Well-Known Member

    Joined:
    Jul 6, 2016
    Messages:
    59
    Likes Received:
    8
    Trophy Points:
    8
    Location:
    Phoenix, AZ
    cPanel Access Level:
    Root Administrator
    Where can I get access to cphulkd's rules so I can set them up as rules in the firewall? Something like:

    Code:
    whmapi1 get_countries_with_known_ip_ranges
    How about something like this that will return the IP ranges and I can query over time to adjust?
     
    #4 dstana, May 11, 2018
    Last edited: May 11, 2018
  5. dstana

    dstana Well-Known Member

    Joined:
    Jul 6, 2016
    Messages:
    59
    Likes Received:
    8
    Trophy Points:
    8
    Location:
    Phoenix, AZ
    cPanel Access Level:
    Root Administrator
  6. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,524
    Likes Received:
    251
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hello,


    It does not appear that there's a way to obtain this through the API. The list of cPHulk related API functions are as follows:

    WHM API 1 Sections - cPHulk - Developer Documentation - cPanel Documentation

    You should know the country codes that are blocked but if you're unaware which you've blocked you can obtain this information by running the following:

    Code:
    # grep country_blacklist /var/cpanel/hulkd/conf
    country_blacklist=AF
    All country code blocking does is obtain the IP addresses associated with a country (the output of
    whmapi1 get_countries_with_known_ip_ranges) and create rules to block those ranges.
     
    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