Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add regression rules for test #3291

Merged

Conversation

hnakamur
Copy link
Contributor

@hnakamur hnakamur commented Nov 1, 2024

what

Add a regression rule for test copied from:
- modsecurity-regression-rules.txt
- modsecurity-regression-ip-list.txt

why

Because these two files are needed for regeression tests to pass before merging Fix modsecurity-regression-test-secremoterules.txt URL in example by hnakamur · Pull Request #3287 · owasp-modsecurity/ModSecurity.

references

#3287 (comment)

@airween
Copy link
Member

airween commented Nov 2, 2024

Hi @hnakamur,

I'm afraid you put this file to a wrong place. It's under to root directory, not under the test as you referred in the test file.

Probably it would be better under test/test-cases/data. Or may be you can use any existing one, eg this (if it fits with your expectation).

Copied from:
- https://gist.githubusercontent.com/martinhsv/20705a36b7cfa8ff6d0dee0d4efce7e7/raw/faa96c7838b1fe972c1f0881efacbb440f9a4a5e/modsecurity-regression-rules.txt
- https://gist.githubusercontent.com/martinhsv/20705a36b7cfa8ff6d0dee0d4efce7e7/raw/b9321f190eb0e81b98cb65a56db3d7e0a4f59314/modsecurity-regression-ip-list.txt

diff --git a/test/test-cases/regression/operator-ipMatchFromFile.json b/test/test-cases/regression/operator-ipMatchFromFile.json
index 4a225954..1eb4d44a 100644
--- a/test/test-cases/regression/operator-ipMatchFromFile.json
+++ b/test/test-cases/regression/operator-ipMatchFromFile.json
@@ -129,7 +129,7 @@
     },
     "rules":[
       "SecRuleEngine On",
-      "SecRule REMOTE_ADDR \"@ipMatchFromFile https://gist.githubusercontent.com/martinhsv/20705a36b7cfa8ff6d0dee0d4efce7e7/raw/b9321f190eb0e81b98cb65a56db3d7e0a4f59314/modsecurity-regression-ip-list.txt\" \"id:1
@hnakamur hnakamur force-pushed the add_test_regression_rules branch from 4b75aba to 742f97c Compare November 2, 2024 11:18
@hnakamur
Copy link
Contributor Author

hnakamur commented Nov 2, 2024

@airween Oh sorry. I fixed it at 742f97c

Copy link

sonarcloud bot commented Nov 2, 2024

@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Nov 4, 2024
@airween airween merged commit 5bec188 into owasp-modsecurity:v3/master Nov 5, 2024
49 checks passed
@hnakamur hnakamur deleted the add_test_regression_rules branch November 6, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants