I have been working with cPanel support for days on some mod security Mysql authentication errors and traced it back to Easy Apache not creating some files. Now that we have that solved, before installing CWAF mod_security only logged to MySQL, and not an ip.pag file which can get big, and cause major CPU overhead.
My question is, since cPanel’s mod security is logging to MySQL, is it safe to comment out SecDataDir /tmp and SecTmpDir /tmp from the modec2.conf files?
When I do it, every thing seems to operate fine, CSF still picks up rule triggers and blocks according to the settings… Seems like this might be duplicate logging in a cPanel system?
Got it. You guys pretty much stick to standard mod_security setups and whatever cPanel does is outside of the scope (i.e. using MySQL instead if ip.pag file).
We got all this sorted out… cPanel/WHM uses MySQL to store the modsecurity logs in and using the ip.pag file for logging is redundant. This may need to be a future tweak for Comodo WAF unless they are using ip.pag for something? (comodo, care to chime in?).
We commented out two lines which stops logging to the ip.* files that can become huge when your server is under attack. Reading and writing to gigabit size will have resources hovering around 80% CPU utilization until you delete these files. Below is the commented lines we used which keeps CPU loads normal while also working with WHM’s new ModSecurity consoles.
vi /usr/local/apache/conf/modsec2.conf
LoadFile /opt/xml2/lib/libxml2.so
After the back and forth on this, there still is no clear answer as to if your plugin uses that file, because the WHM mod security uses MySQL to log to?? Could you clarify the need for an ip.pag file in a cPanel/WHM environment?
When the ip.pag file gets to be 1gb in size, it causes a large strain on the server.
I have a default installation of WAF (Bruteforce Off) but am still getting DBM errors. Are there other rules that use DBM storage and where would I find them?
Yes, here is a couple of such rules.
DBM storage directory is defined by SecDataDir directive.
According to manual “SecDataDir must be provided before initcol, setsid, and setuid can be used.”
Quick search through rules reveals following IDs:
210080 - initcol
210090 - initcol
219900-219903 - setsid setuid - none