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!

modsec to iptables

Discussion in 'Security' started by sehh, Sep 9, 2008.

  1. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Europe
    I've enabled Mod Security and its functioning properly so far.

    Is it possible to pass the IP address of the attacker to iptables (or some shell script which calls iptables) in order to ban the IP from the firewall?

    For example, it would be nice if we could ban IP's from attacks with severity of 4 or higher.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,579
    Likes Received:
    439
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sehh

    sehh Well-Known Member

    Joined:
    Feb 11, 2006
    Messages:
    579
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Europe
    I found a solution. I created a rule in modsec which uses the "exec" command to execute a small command, which in turn runs iptables and blocks the IP address right away. The whole thing works perfectly!

    CSF/BFD and the rest of them are too passive in case of a DoS attack, while this solution blocks them immediately.
     
    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