Alban Staehli
Regular Pleskian
TITLE:
Mod_Security (with Comodo ruleset) IP persistent storage not being cleaned/rotated
PRODUCT, VERSION, OPERATING SYSTEM, ARCHITECTURE:Plesk Onyx, 17.0.17 Update #28 & 17.5.3 Update #22, Centos 6.9 / Centos 7.4, x64
PROBLEM DESCRIPTION:When using modsec & the comodo ruleset, /var/cache/modsecurity/ip.pag is not being cleaned/rotated. Therefore, after a couple of weeks, it easily reaches multiple GO in size and slow down apache.
More details here:
Issue - Mod_Security IP persistent storage massive
Thanks to @websavers for reporting it.
STEPS TO REPRODUCE:More details here:
Issue - Mod_Security IP persistent storage massive
Thanks to @websavers for reporting it.
1) Enable modsec via Plesk
2) Setup modsec to use the Comodo ruleset
3) Heavily use your web server over a couple of days / weeks
4) Check the size of file /var/cache/modsecurity/ip.pag => it's always growing and is never being rotated/cleaned
ACTUAL RESULT:2) Setup modsec to use the Comodo ruleset
3) Heavily use your web server over a couple of days / weeks
4) Check the size of file /var/cache/modsecurity/ip.pag => it's always growing and is never being rotated/cleaned
/var/cache/modsecurity/ip.pag is always growing and is never being rotated/cleaned - therefore it slows down apache when reaching a concerning size
EXPECTED RESULT:/var/cache/modsecurity/ip.pag should be regularly cleaned/rotated, even with Comodo ruleset.
Workaround:
cron job run daily like this: cat /dev/null > /var/cache/modsecurity/ip.dir && cat /dev/null > /var/cache/modsecurity/ip.pag
ANY ADDITIONAL INFORMATION:Workaround:
cron job run daily like this: cat /dev/null > /var/cache/modsecurity/ip.dir && cat /dev/null > /var/cache/modsecurity/ip.pag
Seems to be a known modsec bug:
IP persistence storage seems to not clean up · Issue #574 · SpiderLabs/ModSecurity · GitHub
YOUR EXPECTATIONS FROM PLESK SERVICE TEAM:IP persistence storage seems to not clean up · Issue #574 · SpiderLabs/ModSecurity · GitHub
Confirm bug