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.

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:
    6
    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:
    18
    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
     
    #2 ModServ, Oct 11, 2011
    Last edited: Oct 11, 2011
Loading...

Share This Page