-
Notifications
You must be signed in to change notification settings - Fork 1.7k
V3/collection re fix #2297
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
V3/collection re fix #2297
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
[ | ||
airween marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"enabled":1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a pull request that was well described in a issue i miss the github_issue tag. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for info. The last commit contains both 'url' and 'github_issue' keys, in both test cases. Note: it would be good to make some wiki page about your expectations for contributors. I'm sure these keywords are part of the regression test structure, but after 17 commits I've met with them first. |
||
"version_min":300000, | ||
"title":"OWASP CRS id:920450", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to have a title with a more meaningful message. If the test "OWASP CRS id:920450" fails, what does it means to the user? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed in ceb0e3 |
||
"client":{ | ||
"ip":"200.249.12.31", | ||
"port":123 | ||
}, | ||
"server":{ | ||
"ip":"200.249.12.31", | ||
"port":80 | ||
}, | ||
"request":{ | ||
"headers":{ | ||
"TRANSLATE": "test" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to use real request headers, to mimic a real world example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed. |
||
}, | ||
"uri":"/", | ||
"method":"GET" | ||
}, | ||
"response":{ | ||
"headers":{ | ||
"Date":"Mon, 13 Jul 2015 20:02:41 GMT", | ||
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", | ||
"Content-Type":"text/html" | ||
}, | ||
"body":[ | ||
"no need." | ||
] | ||
}, | ||
"expected":{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Specially because the rules are complex, this test case could fail silent... as a combination of two (or more) failures. Better to also considers the debug and error log (when possible). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the test cases: both of them block the request, and gives the error_log, which used in "expected" block. |
||
"http_code":403 | ||
}, | ||
"rules":[ | ||
"SecRuleEngine On", | ||
"SecRule &TX:restricted_headers \"@eq 0\" \"id:901165,phase:1,pass,nolog,setvar:'tx.restricted_headers=/proxy/ /lock-token/ /content-range/ /translate/ /if/'\"", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same rule complexity issue explained below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
"SecRule REQUEST_HEADERS_NAMES \"@rx ^.*$\" \"id:920450,phase:2,capture,block,deny,t:lowercase,setvar:'tx.header_name_%{tx.0}=/%{tx.0}/',chain", | ||
"SecRule TX:/^HEADER_NAME_/ \"@within %{tx.restricted_headers}\" \"\"" | ||
] | ||
}, | ||
{ | ||
"enabled":1, | ||
"version_min":300000, | ||
"title":"OWASP CRS id:920450", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fixed too. |
||
"client":{ | ||
"ip":"200.249.12.31", | ||
"port":123 | ||
}, | ||
"server":{ | ||
"ip":"200.249.12.31", | ||
"port":80 | ||
}, | ||
"request":{ | ||
"headers":{ | ||
"Accept": "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5", | ||
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", | ||
"Accept-Encoding": "gzip,deflate", | ||
"Accept-Language": "en-us,en;q=0.5", | ||
"Host": "localhost", | ||
"Keep-Alive": "300", | ||
"Proxy-Connection": "keep-alive", | ||
"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv" | ||
}, | ||
"uri":"/", | ||
"method":"GET" | ||
}, | ||
"response":{ | ||
"headers":{ | ||
"Date":"Mon, 13 Jul 2015 20:02:41 GMT", | ||
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT", | ||
"Content-Type":"text/html" | ||
}, | ||
"body":[ | ||
"no need." | ||
] | ||
}, | ||
"expected":{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment above. Use error and debug logs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed too. |
||
"http_code":200 | ||
}, | ||
"rules":[ | ||
"SecRuleEngine On", | ||
"SecRule &TX:restricted_headers \"@eq 0\" \"id:901165,phase:1,pass,nolog,setvar:'tx.restricted_headers=/proxy/ /lock-token/ /content-range/ /translate/ /if/'\"", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a value of having complex rules on the regression tests as it increases surface area for testing features. However, I am afraid that together with the complex example, we need to have a very simple use case scenario. If/When this test fails, it was a consequence of a problem on the selection of variables using regular expression or elsewhere (e.g. setvar)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the rules in the new regression test file. I based @michaelgranzow-avi test cases, but there are only two cases, with same context: only the TX variable name format differ. |
||
"SecRule REQUEST_HEADERS_NAMES \"@rx ^.*$\" \"id:920450,phase:2,capture,block,deny,t:lowercase,setvar:'tx.header_name_%{tx.0}=/%{tx.0}/',chain", | ||
"SecRule TX:/^HEADER_NAME_/ \"@within %{tx.restricted_headers}\" \"\"" | ||
] | ||
} | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect a different name for that file. Explained below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.