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
prefilter engines v99g #2310
Merged
Merged
prefilter engines v99g #2310
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
Add SigMatchGetLastSM which simply returns the very last SM added to the signature. Minor cleanups.
It's unused by all of the implementations.
In preparation of the introduction of more general purpose prefilter engines, rename PatternMatcherQueue to PrefilterRuleStore. The new engines will fill this structure a similar way to the current mpm prefilters.
Rename to non_pf: non prefilter.
New name is SignatureNonPrefilterStore to reflect that it's not just about MPM anymore.
Introduce abstraction layer for prefilter engines.
Inspect partial request line as well.
Move engine and registration into the keyword file. Register as 'ALPROTO_UNKNOWN' instead of per alproto. The registration will only apply it to those rules that have events set.
The order of keyword registration currently affects inspect engine registration order and ultimately the order of inspect engines per rule. Which in turn affects state keeping. This patch makes sure the ordering is the same as with older releases.
Instead of the linked list of engines setup an array with the engines. This should provide better locality. Also shrink the engine structure so that we can fit 2 on a cacheline. Remove the FreeFunc from the runtime engines. Engines now have a 'gid' (global id) that can be used to look up the registered Free function.
Currently the regular 'Header' inspection code will run each time after the HTTP progress moved beyond 'headers'. This will include the trailers if there are any. Leave the code in place as this model will change in the not too distant future.
This one replaced #2289 |
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.
Large overhaul of internals of the detection engine. Cleans up registration and calling of prefilter engines (e.g. MPM) and 'inspect engines' (per rule). New keywords need to touch much fewer files.
Introduces more generic prefilter engines than MPM. Prefiltering can support rules looking ttl, icode, seq, window and many more. This should make non-pattern based rules much more attractive. By default this prefiltering is not yet enabled. Use 'prefilter' in rules (like fast_pattern after the keyword that it should apply to) or enable globally: "detect.prefilter.default=auto".
Adds 2 new keywords: http_request_line and http_response_line. Both are 'stickybuffers' like file_data. Both are MPM enabled.
Known issue:
Prscript: