feat(ci): add lint and integration/regression test #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR it's a draft for a lint/regression test template for CRS plugins.
It should be a simple version of what we already have on coreruleset.
Feature list
and on Nginx + ModSecurity v3bothApacheand Nginxtests/integration/
contains a docker-compose file that brings up all the required containers for the test. It also contains the
modsec-setup.conf
file that includes all plugin files in the right order.tests/logs/
contains just two directories for Apache and Nginx to bind on containers in order to make go-ftw works
tests/regression/tests/
contains all the regression tests for go-ftw
Regression tests
my idea is to test, for each rule, the matching and the exclusion of the same payload. For example, for testing the exclusion of
ARGS:pwd
from all rules, we can test first a matching payload likenot-pwd=<payload>
and then the exclusion withpwd=<payload>
. What do you think about it?I think we can identify a PL1 rule and then write a test like:
for other exclusion rules that doesn't remove by
OWASP_CRS
tag, we can do the same test referring to the specific excluded rule ids. For example, testing the following exclusion rule:we can write a test like:
Any review is very welcome,
thanks!