-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Detect cleanups/v3 #9949
Closed
Closed
Detect cleanups/v3 #9949
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since the asn1 keyword is processing payload data, move the handling of the keyword into the PMATCH with content inspection. Use u32 as buffer length in the Rust FFI
Hitting the recursion limit should be rare.
Integrate with rest of content inspect code.
Use stack local var instead of DetectEngineThreadCtx member. Make sure the limit is a const so we can avoid rereading it.
Flatten else branches after terminating ifs.
Since recursive content matching goes through the buffer from left to right, it is possible to bail early when isdataat is part of the recursive checking. If `isdataat:50,relative` fails for offset 10, it will surely also fail for offset 20. So break inspection in such cases. The exception is for dynamic isdataat, where the value is determined by a prior byte_extract that may be updated during the recursion.
DetectEngineThreadCtx::replist is managed elsewhere.
Adjust includes to enable this.
Move reference count to top of DetectEngineThreadCtx, to move it to the same cache line as the other members that are checked first in Detect().
Move members used by DetectEngineContentInspection() to the same cache line.
Core logic of the tests moved to content inspection code in separate commit.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #9949 +/- ##
========================================
Coverage 82.39% 82.40%
========================================
Files 970 970
Lines 271359 271244 -115
========================================
- Hits 223586 223518 -68
+ Misses 47773 47726 -47
Flags with carried forward coverage won't be shown. Click here to find out more. |
Closed
WARNING:
Pipeline 16839 |
Closed
replaced by #9974 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Replaces #9948
Includes #9932
Lots of cleanups done as part of bigger work.
Most interesting commits: