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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Share cPHulk Country Blacklist with Apache?

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

  1. dstana

    dstana Active Member

    Joined:
    Jul 6, 2016
    Messages:
    27
    Likes Received:
    4
    Trophy Points:
    3
    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:
    56
    Likes Received:
    4
    Trophy Points:
    58
    use the csf firewall as you be able to block countries and much easier.
     
  3. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    967
    Likes Received:
    67
    Trophy Points:
    103
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
  4. dstana

    dstana Active Member

    Joined:
    Jul 6, 2016
    Messages:
    27
    Likes Received:
    4
    Trophy Points:
    3
    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 Active Member

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

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    967
    Likes Received:
    67
    Trophy Points:
    103
    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.
     
Loading...

Share This Page