-
Notifications
You must be signed in to change notification settings - Fork 78
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
doc(sigma): documented the use of _ws_
string by creating more tests
#1458
base: main
Are you sure you want to change the base?
Conversation
gradle build -x test -x check
BUILD SUCCESSFUL in 6s
11 actionable tasks: 7 executed, 4 up-to-date |
The test was breaking before my change. So, don't blame my change please. gradle test
> Task :test
Tests with failures:
- org.opensearch.securityanalytics.rules.backend.QueryBackendTests.testConvertNotComplicatedExpression
412 tests completed, 1 failed
> Task :test FAILED
FAILURE: Build failed with an exception.
BUILD FAILED in 18s
7 actionable tasks: 1 executed, 6 up-to-date |
THANK YOU ! |
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.
thanks for working on this bug
plz add unit tests verifying the queries for the failing scenarios are now working and integ test that does the following : ingest that query, run a detector and generate finding(rule match)
c26cd80
to
f13bc8e
Compare
Done!
|
|
hi @rios0rios0 , can you please add just a new test with the Sigma Rule here? https://github.com/opensearch-project/security-analytics/blob/main/src/test/java/org/opensearch/securityanalytics/rules/backend/QueryBackendTests.java |
1 - "Also, please revert all the changes in the files except SigmaString.java." 2 - "can you please add just a new test with the Sigma Rule here?" |
hi @rios0rios0 , could you please copy the sigma rule from here #1024 (comment) & create a test out of it? |
Of course. Just give me some minutes, on it. |
Done! Working 100% |
Hi, @sbcd90. |
@sbcd90 without compromising the release of this PR, I'd like to point out something: I have made all the changes requested by you. However, I don't agree with them, because instead of making the codebase easier to understand and modularized, we are just keeping huge and complicated files to understand and maintain. That's why I created this other PR, if you can look at the description, you will understand the rational and literary reason I followed. Could you explain yours? |
…rch-project#1458 Signed-off-by: Felipe Rios <felipe.rios.silva@outlook.com>
hi @rios0rios0 , can you please rebase your changes with the |
…rch-project#1458 Signed-off-by: Felipe Rios <felipe.rios.silva@outlook.com>
Done! |
@rios0rios0 , thanks a lot. i triggered the builds. |
hi @rios0rios0 , could you check why tests are failing? they are passing in our |
Ok, on it. |
…rch-project#1458 Signed-off-by: Felipe Rios <felipe.rios.silva@outlook.com>
@rios0rios0 , re-running the tests. |
Wait a second please, I just fixed the unit test ones. The other integration tests, they are breaking since the logic is not right anymore. I have to change your pre-packaged rules as well, to match with empty space. |
Thanks @rios0rios0 . |
…rch-project#1458 Signed-off-by: Felipe Rios <felipe.rios.silva@outlook.com>
c852957
to
ebc82b9
Compare
@tallyoh @givilleneuve @sbcd90 @eirsep After further review, I have decided to pivot this PR from a fix change to a documentation update. The initial removal of the |
_ws_
string by creating more tests
Could you please advise on the best place to document this issue? It appears that users might be experiencing this problem because they are using an older version of Security Analytics that lacks the updated index template. As a result, the index template is no longer being created or overridden (because an old version is already in place), causing user queries to include |
Signed-off-by: Felipe Rios <felipe.rios.silva@outlook.com>
Description
I initially removed the
_ws_
replacement as I believed it was unnecessary. However, after further investigation, I realized the importance of this replacement in maintaining the functionality of various features. I have now added more detailed documentation to explain the use of_ws_
and its significance.The updated JavaDoc provides a comprehensive explanation of why the
_ws_
replacement is necessary and how it ensures the correct interpretation of whitespaces within Lucene queries. This documentation should help future developers understand the rationale behind this implementation.For a conversion test demonstrating this feature, refer to
QueryBackendTests#testConvertWhiteSpaceWithWsReplacement()
. For an integration test, refer toDetectorRestApiIT#testCreateADetectorWithSigmaRulesUsingWhiteSpaces()
. To ensure this feature operates correctly, configure OpenSearch with the settings insrc/main/resources/mappings/detector-settings.json
.Related Issues
Resolves #1024
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.