-
Notifications
You must be signed in to change notification settings - Fork 32
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
YAML Configuration: Test Fails When Whitelisted Requests Trigger WAF Rule ID Alerts #429
Comments
I don't understand your question. Could you maybe try to explain specifically, which actions you want to perform and which information you need? What do you mean by "collect certain whitelisted requests"? How would you want to collect those? Where would they be "whitelisted"? |
We will organize historical false positive alerts into whitelisted requests (legitimate requests) based on our normal business traffic, sampling records, and other methods. We will have a large set of whitelist sample data, such as .http format files or Burp logs, etc. We can batch convert these into the FTW test file format, but FTW doesn't seem to support writing a rule file for false positive testing (i.e., recording a false positive whenever any rule triggers an alert). |
I see, interesting. If I'm not mistaken, you could work around that using
The test will then fail when a request triggers any rule. |
I didn't think of directly using id: "\d+" to match any rule alert, I'll give it a try, thanks! |
There is still one issue: it is possible to test whether there was a false positive, but in practice, it is not possible to know which rule caused the false positive (in this scenario, the ID written in the test case is actually the unique ID of the test case, and it is not possible to predict in advance the rule ID to be tested. We may collect generic false positive test cases). |
True. Well, it looks like you might need a dedicated mode for getting what you want. It shouldn't be hard to do. Would this cover your needs?
|
Adds list of triggered rules by stage to the JSON output. Fixes coreruleset#429
@xu-xiang I've created a PR with what I think should solve your problem (#432). The PR adds reporting of triggered rules by test (and test stage) to the JSON output ( |
Adds list of triggered rules by stage to the JSON output. Fixes coreruleset#429
You're very welcome! I will test to see if it meets the false positive test scenario and will provide you with the results. |
I conducted some tests and found that it can satisfy the scenario of managing false positive test sets. For example, I maintain a false positive test case "1000000-1" and, when executing the test, I use the --output json parameter (without needing to use --report-triggered-rules). By constructing the following test case:
This can yield valuable test results.
|
Awesome, thank you. We'll soon merge the PR and release a new version. |
During the testing process, we encountered another issue. For example, the following rule
generates alert logs (we are currently analyzing blocked scenarios), which affects the determination of success or failure. However, the current regular expression cannot be used, such as
Apart from disabling this rule, is there a way to exclude certain rule IDs without affecting the result determination? |
id error in json output:
|
We don't support look-around expressions. But if you're expecting certain IDs you can just use For the bad ID I'll have to create a fix. Thanks. |
I've opened #436 to address the ID detection. |
Adds list of triggered rules by stage to the JSON output. Fixes coreruleset#429
Could you please explain how to configure YAML so that if none of the alert rules are satisfied, we can collect certain whitelisted requests. These whitelisted requests should not match any alerts. After configuring the YAML test file, if any WAF rule ID alerts are triggered, it should be considered a test failure, indicating that the rules need to be optimized.
no rule_id expect_ids,just test case id
The text was updated successfully, but these errors were encountered: