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!

Make Mod_sec logs available to users

Discussion in 'Security' started by Jay M, Oct 10, 2011.

  1. Jay M

    Jay M Active Member
    PartnerNOC

    Joined:
    Oct 10, 2011
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    56
    cPanel Access Level:
    Root Administrator
    Hey guys,

    I'm looking to implement a setup where users can view mod_security logs relating to their account (i.e. fetch logs which only relate to their user), so they can troubleshoot why certain actions are being stopped by mod_sec.

    Does anybody know if there's any cPanel plugins which already support this, or other such script?

    Cheers
     
  2. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    168
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    You may use this command as well:

    PHP:
    mysql -D modsec -'SELECT * FROM modsec WHERE host = "www.DOMAIN.com";'
    You could also output it into a file inside the user named for example "demotest" with a small and simple bash script just like this:

    PHP:
    #!/bin/bash
    username=demotest
    mysql 
    -D modsec -'SELECT * FROM modsec WHERE host LIKE "%DOMAIN.com";' > /home/$username/www/modsec.log
    chown $username
    :$username /home/$username/www/modsec.log
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 ModServ, Oct 11, 2011
    Last edited: Oct 11, 2011
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