Coreruleset: Have Travis launch a webserver and load CRS

Created on 13 May 2020  路  8Comments  路  Source: coreruleset/coreruleset

_Issue originally created by user dune73 on date 2017-11-27 13:31:47.
Link to original issue: https://github.com/SpiderLabs/owasp-modsecurity-crs/issues/971._

I merged #964 after overestimating a review when it was in fact breaking the rule set. This is my fault, but Travis could have warned me.

Feature Request

All 8 comments

_User fgsch commented on date 2017-11-27 18:44:12:_

To expand on this, the ruleset was not broken syntax-wise; rule 910110 requires a file that is not normally available in the filesystem.

One could argue that we're not checking this rule since it's disabled by default.

_User dune73 commented on date 2017-11-27 18:53:17:_

I do not think it's a problem with this rule whatsoever. It's the fact that you can not load the ruleset anymore. Even if it's syntactically correct. And we'll encounter more failures like this in the future, I am sure.

Also, it's not your fault. If it's anybody's fault, it's mine.

_User csanders-git commented on date 2017-11-30 03:33:24:_

I should probably be able to throw together a quick test tot see if the status of apache doesn't become green on boot for ol' travis!

_User fzipi commented on date 2017-11-30 17:10:01:_

csanders-git I can help you with that.

_User fzipi commented on date 2017-11-30 17:48:55:_

For me, the straigthforward way of doing this is modifying travis to use the rules on the repository.

So changing the line:

docker run -ti -e PARANOIA=5 -d --rm -p 80:80 -v /var/log/httpd:/var/log/httpd/ owasp/modsecurity-crs

For:

docker run -ti -e PARANOIA=5 -d --rm -p 80:80 -v $(pwd)/rules:/etc/httpd/modsecurity.d/owasp-crs/rules/ -v /var/log/httpd:/var/log/httpd/ owasp/modsecurity-crs

This will try to run httpd using the rules in this directory, and will fail bad when apache fails to start.

You can test it on your devices to see it works (I did it already). I am going to test this on my fork, and report back if it works "correctly".

_User fzipi commented on date 2017-11-30 21:01:26:_

Nice. it works as expected.

So, after merging PR #977, when there is a problem with any rules file, Apache will not run on the container and build will fail.

_User fzipi commented on date 2018-03-11 14:37:17:_

Closing, this was merged.

_User csanders-git commented on date 2018-03-11 17:54:04:_

fzipi I'll be emailing you a copy of my blog to review soon

Was this page helpful?
0 / 5 - 0 ratings