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!

CSF Firewall Deny IPs

Discussion in 'Security' started by prodjex, Mar 26, 2018.

Tags:
  1. prodjex

    prodjex Registered

    Joined:
    Mar 23, 2018
    Messages:
    3
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Kansas City
    cPanel Access Level:
    Root Administrator
    Is there a way to add IP's to the Deny IPs list programmatically?

    I have a list of IP addresses that I block from the server that is dynamically generated daily. It doesn't change often, normally about once a week. The list generates automatically then I receive an email if any IP's have changed.

    At that point I manually add them through the WHM interface to the Deny IPs list. Is there a command I can run via SSH or anything to add them so I can automate my process?

    Thanks!
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,323
    Likes Received:
    1,851
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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
    Having never done this, I'm not overly qualified to comment.
    However if your'e not aware, CSF has a 'LFD Blocklist' feature where it can connect and download pre-determined blocklists.
    Could you not create a custom blocklist and point this to your own file ?

    Code:
    Each block list must be listed on per line: as NAME|INTERVAL|MAX|URL
    #   NAME    : List name with all uppercase alphabetic characters with no
    #             spaces and a maximum of 9 characters - this will be used as the
    #             iptables chain name
    #   INTERVAL: Refresh interval to download the list, must be a minimum of 3600
    #             seconds (an hour), but 86400 (a day) should be more than enough
    #   MAX     : This is the maximum number of IP addresses to use from the list,
    #             a value of 0 means all IPs
    #   URL     : The URL to download the list from
    
    #MYLIST
    #Details: http://mysite.com
    MYLIST|86400|0|http://www.mydomain.com/block.txt
    
    
     
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