OWASP ModSecurity Core Rule Set V3.0 breaks after every update

Operating System & Version
CloudLinux 7.7
cPanel & WHM Version
v84.0.21

artidens

Registered
Apr 21, 2017
2
0
1
Finland
cPanel Access Level
Root Administrator
When I run "/usr/local/cpanel/scripts/modsec_vendor update OWASP3" I get the following errors:

Code:
The system failed to update the vendor from the URL http://httpupdate.cpanel.net/modsecurity-rules/meta_OWASP3.yaml
warn [modsec_vendor] The system failed to update the vendor from the URL http://httpupdate.cpanel.net/modsecurity-rules/meta_OWASP3.yaml
Also, Apache fails to restart because of missing OWASP3 rules:

Code:
Syntax error on line 259 of /etc/apache2/conf/httpd.conf: Syntax error on line 32 of /etc/apache2/conf.d/modsec2.conf:
Syntax error on line 29 of /etc/apache2/conf.d/modsec/modsec2.cpanel.conf:
Could not open configuration file /etc/apache2/conf.d/modsec_vendor_configs/OWASP3/rules/REQUEST-901-INITIALIZATION.conf: No such file or directory
The folder /etc/apache2/conf.d/modsec_vendor_configs/OWASP3/rules becomes empty. To fix this, I must go to WHM -> Security Center -> ModSecurity Vendors and click "Install" on the OWASP3 as it has become uninstalled. This happens basically every night after the WHM update so I have to manually fix it to get Apache running again. Any help?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,261
313
Houston
Can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!
 

dialhost

Member
PartnerNOC
Jun 17, 2005
5
0
151
Hello,

Did you have any solution for this problem?
I had this problem today in the automatic update and apache failed.

When checking the update files I noticed several files with the extension conf.BAD
Even if you download this .zip file at this moment you will see these files.
Is this correct?

If there is any solution, please let me know, as I am looking into it to resolve this issue.

Thanks.
 

ivan levente

Member
Apr 4, 2015
13
1
53
Romania
cPanel Access Level
Root Administrator
Same exact issue here happened while running my weekly update this Monday.
Site went down at the moment I hit the Provision button for modsec2-rules-owasp-crs. Apache failed to restart due to the same issue mentioned by OP above.
Fixed it by clicking on install OWASP3 rules on Modsecurity Vendors page. Though I'm not sure if under these circumstances my existing OWASP rules would be updated at all?
Also the update window's last words were:
Code:
[2021-04-05 04:18:28 +0300] info [xml-api]
  Verifying  : 1:ea-modsec2-rules-owasp-crs-3.3.0-4.el6.cloudlinux.x86_64   1/1
[2021-04-05 04:18:28 +0300] info [xml-api] Failed:
[2021-04-05 04:18:28 +0300] info [xml-api]   ea-modsec2-rules-owasp-crs.x86_64 1:3.3.0-4.el6.cloudlinux                   
[2021-04-05 04:18:28 +0300] info [xml-api] There were non-fatal errors in the transaction
[2021-04-05 04:18:28 +0300] info [xml-api] Finished Transaction
[2021-04-05 04:18:28 +0300] info [xml-api] Leaving Shell
Running WHM 94.0.4 on Cloudlinux 6.10.
 

ivan levente

Member
Apr 4, 2015
13
1
53
Romania
cPanel Access Level
Root Administrator
@cPRex, I have indeed opened a support ticket and the advice they gave me was to use yum install ea-modsec2-rules-owasp-crs instead of provisioning through EasyApache.
Needless to say, that advice was useless because provisioning through EasyApache runs the same yum command internally, which of course failed again.

For the record, and to help those with the same issue, I have finally solved this with the help of this article:

By first disabling modsec within /etc/apache2/conf.d/modsec2.conf I have then been able to install the new RPM via yum, restarted Apache and now everything works perfectly.