coreruleset / modsecurity-crs-docker

Official ModSecurity Docker + Core Rule Set (CRS) images
https://coreruleset.org
Apache License 2.0
269 stars 69 forks source link

Added includes needed for plugins #66

Closed theseion closed 2 years ago

fzipi commented 2 years ago

@theseion Does this work locally?

theseion commented 2 years ago

Not yet. Just discovered that I need to create that directory first.

theseion commented 2 years ago

At least for the tests: yes. That's what https://github.com/coreruleset/coreruleset/pull/2448 is for.

theseion commented 2 years ago

I had the same idea but it doesn't work (at least not by itself). As soon as you mount a plugins directory you have the same issue. Hence, we'd have to add dummy files to the CRS repo and I didn't want to do that. That would only make sense, IMO, if we supplied a prepared configuration file with the Include ... lines in it. But since we don't, I'm not sure we should.

theseion commented 2 years ago

I need this for https://github.com/coreruleset/coreruleset/issues/2394. So it would be good if we could come to a conclusion.

theseion commented 2 years ago

Well spotted! I fixed the find operation to look a the full path. I also saw that there was an issue with the second sed command (requires -E).

The code otherwise accounts for the possibility of the plugins directory being absent (the inlcudes are commented by default and find will not fail).

theseion commented 2 years ago

I don't have write access to the repo, so you'll have to merge.