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
prefilter engines v99g #2310
Commits on Sep 29, 2016
-
detect-parse: add new func to get last sigmatch
Add SigMatchGetLastSM which simply returns the very last SM added to the signature. Minor cleanups.
Configuration menu - View commit details
-
Copy full SHA for c4dcb20 - Browse repository at this point
Copy the full SHA c4dcb20View commit details -
Configuration menu - View commit details
-
Copy full SHA for d461c78 - Browse repository at this point
Copy the full SHA d461c78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3d5807b - Browse repository at this point
Copy the full SHA 3d5807bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b40ecb7 - Browse repository at this point
Copy the full SHA b40ecb7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1380853 - Browse repository at this point
Copy the full SHA 1380853View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4229e60 - Browse repository at this point
Copy the full SHA 4229e60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 704afeb - Browse repository at this point
Copy the full SHA 704afebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d54b70 - Browse repository at this point
Copy the full SHA 6d54b70View commit details -
Configuration menu - View commit details
-
Copy full SHA for bd03307 - Browse repository at this point
Copy the full SHA bd03307View commit details -
Configuration menu - View commit details
-
Copy full SHA for d647db1 - Browse repository at this point
Copy the full SHA d647db1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad3a55d - Browse repository at this point
Copy the full SHA ad3a55dView commit details -
Configuration menu - View commit details
-
Copy full SHA for ff70e0c - Browse repository at this point
Copy the full SHA ff70e0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a41695f - Browse repository at this point
Copy the full SHA a41695fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c47016 - Browse repository at this point
Copy the full SHA 7c47016View commit details -
It's unused by all of the implementations.
Configuration menu - View commit details
-
Copy full SHA for 4c0ab68 - Browse repository at this point
Copy the full SHA 4c0ab68View commit details -
prefilter: rename PatternMatcherQueue datatype
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.
Configuration menu - View commit details
-
Copy full SHA for bb0cd0e - Browse repository at this point
Copy the full SHA bb0cd0eView commit details -
detect: rename non_mpm lists/vars to non_pf
Rename to non_pf: non prefilter.
Configuration menu - View commit details
-
Copy full SHA for 17bc029 - Browse repository at this point
Copy the full SHA 17bc029View commit details -
detect: rename SignatureNonMpmStore
New name is SignatureNonPrefilterStore to reflect that it's not just about MPM anymore.
Configuration menu - View commit details
-
Copy full SHA for 3dad824 - Browse repository at this point
Copy the full SHA 3dad824View commit details -
prefilter: introduce prefilter engines
Introduce abstraction layer for prefilter engines.
Configuration menu - View commit details
-
Copy full SHA for 5bcdbe3 - Browse repository at this point
Copy the full SHA 5bcdbe3View commit details -
http_uri: mpm prefilter engine
Inspect partial request line as well.
Configuration menu - View commit details
-
Copy full SHA for b62c4cc - Browse repository at this point
Copy the full SHA b62c4ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 72f2a78 - Browse repository at this point
Copy the full SHA 72f2a78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ff5703 - Browse repository at this point
Copy the full SHA 9ff5703View commit details -
Configuration menu - View commit details
-
Copy full SHA for 746a169 - Browse repository at this point
Copy the full SHA 746a169View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a46364 - Browse repository at this point
Copy the full SHA 7a46364View commit details -
Configuration menu - View commit details
-
Copy full SHA for a43a693 - Browse repository at this point
Copy the full SHA a43a693View commit details -
Configuration menu - View commit details
-
Copy full SHA for 61c3748 - Browse repository at this point
Copy the full SHA 61c3748View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5218849 - Browse repository at this point
Copy the full SHA 5218849View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86d303e - Browse repository at this point
Copy the full SHA 86d303eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d57b2f - Browse repository at this point
Copy the full SHA 4d57b2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9cab3ea - Browse repository at this point
Copy the full SHA 9cab3eaView commit details -
http_headers: mpm prefilter engines
Register for both regular headers and trailers.
Configuration menu - View commit details
-
Copy full SHA for 9b6fd6b - Browse repository at this point
Copy the full SHA 9b6fd6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5646dd9 - Browse repository at this point
Copy the full SHA 5646dd9View commit details -
Configuration menu - View commit details
-
Copy full SHA for cef12ed - Browse repository at this point
Copy the full SHA cef12edView commit details -
http_raw_header: mpm prefilter engine
Register for both regular headers and trailer.
Configuration menu - View commit details
-
Copy full SHA for 0019a7b - Browse repository at this point
Copy the full SHA 0019a7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7acdc66 - Browse repository at this point
Copy the full SHA 7acdc66View commit details -
Configuration menu - View commit details
-
Copy full SHA for 08407b6 - Browse repository at this point
Copy the full SHA 08407b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 82d3c0b - Browse repository at this point
Copy the full SHA 82d3c0bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 85cb749 - Browse repository at this point
Copy the full SHA 85cb749View commit details -
prefilter: implement prefilter keyword
Introduce prefilter keyword to force a keyword to be used as prefilter. e.g. alert tcp any any -> any any (content:"A"; flags:R; prefilter; sid:1;) alert tcp any any -> any any (content:"A"; flags:R; sid:2;) alert tcp any any -> any any (content:"A"; dsize:1; prefilter; sid:3;) alert tcp any any -> any any (content:"A"; dsize:1; sid:4;) In sid 2 and 4 the content keyword is used in the MPM engine. In sid 1 and 3 the flags and dsize keywords will be used.
Configuration menu - View commit details
-
Copy full SHA for 5623969 - Browse repository at this point
Copy the full SHA 5623969View commit details -
Configuration menu - View commit details
-
Copy full SHA for f80623f - Browse repository at this point
Copy the full SHA f80623fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 99b9896 - Browse repository at this point
Copy the full SHA 99b9896View commit details -
Configuration menu - View commit details
-
Copy full SHA for ea26ee9 - Browse repository at this point
Copy the full SHA ea26ee9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8798bf4 - Browse repository at this point
Copy the full SHA 8798bf4View commit details -
prefilter: engine for tcp flags keyword
If there are many rules for TCP flags these rules would be inspected against each TCP packet. Even though the flags check is not expensive, the combined cost of inspecting multiple rules against each and every packet is high. This patch implements a prefilter engine for flags. If a rule group has rules looking for specific flags and engine for that flag or flags combination is set up. This way those rules are only inspected if the flag is actually present in the packet.
Configuration menu - View commit details
-
Copy full SHA for 31ad0a1 - Browse repository at this point
Copy the full SHA 31ad0a1View commit details -
prefilter: engine for ack rules
Rules for the 'ack' keyword are uncommon, but if used inspected against almost every packet.
Configuration menu - View commit details
-
Copy full SHA for 3b4aa06 - Browse repository at this point
Copy the full SHA 3b4aa06View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ccd0c0 - Browse repository at this point
Copy the full SHA 9ccd0c0View commit details -
detect-dsize: enable prefilter support
Enable prefilter support for the dsize keyword.
Configuration menu - View commit details
-
Copy full SHA for 065d9bc - Browse repository at this point
Copy the full SHA 065d9bcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9195708 - Browse repository at this point
Copy the full SHA 9195708View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4104f8c - Browse repository at this point
Copy the full SHA 4104f8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 14b0537 - Browse repository at this point
Copy the full SHA 14b0537View commit details -
Configuration menu - View commit details
-
Copy full SHA for 822e034 - Browse repository at this point
Copy the full SHA 822e034View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ce3006 - Browse repository at this point
Copy the full SHA 9ce3006View commit details -
Configuration menu - View commit details
-
Copy full SHA for b88c0a5 - Browse repository at this point
Copy the full SHA b88c0a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10f8e63 - Browse repository at this point
Copy the full SHA 10f8e63View commit details -
Configuration menu - View commit details
-
Copy full SHA for d5e5c11 - Browse repository at this point
Copy the full SHA d5e5c11View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5d2166 - Browse repository at this point
Copy the full SHA f5d2166View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a3917b - Browse repository at this point
Copy the full SHA 6a3917bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a86aea - Browse repository at this point
Copy the full SHA 3a86aeaView commit details -
Configuration menu - View commit details
-
Copy full SHA for fbe7e0a - Browse repository at this point
Copy the full SHA fbe7e0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5537e25 - Browse repository at this point
Copy the full SHA 5537e25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9187c20 - Browse repository at this point
Copy the full SHA 9187c20View commit details -
prefilter: add 'extra match' logic to packet engines
Many of the packet engines are very generic. Rules are generally more limited. A rule like 'alert tcp any any -> any 888 (flags:S; sid:1;)' would still be inspected against every SYN packet in most cases (it depends a bit on rule grouping though). This extra match logic adds an additional check to these packet engines. It can add a check based on alproto, source port and dest port. It uses only one of these 3. Priority order is src port > alproto > dst port. For the ports only 'single' ports are used at this time.
Configuration menu - View commit details
-
Copy full SHA for e2eb9f8 - Browse repository at this point
Copy the full SHA e2eb9f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ace8f9f - Browse repository at this point
Copy the full SHA ace8f9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 34e3484 - Browse repository at this point
Copy the full SHA 34e3484View commit details -
Configuration menu - View commit details
-
Copy full SHA for fbb0490 - Browse repository at this point
Copy the full SHA fbb0490View commit details -
Configuration menu - View commit details
-
Copy full SHA for a270dfa - Browse repository at this point
Copy the full SHA a270dfaView commit details -
Configuration menu - View commit details
-
Copy full SHA for a1accbb - Browse repository at this point
Copy the full SHA a1accbbView commit details -
Configuration menu - View commit details
-
Copy full SHA for a41bf2a - Browse repository at this point
Copy the full SHA a41bf2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e3b98d5 - Browse repository at this point
Copy the full SHA e3b98d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9bb12cc - Browse repository at this point
Copy the full SHA 9bb12ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7329219 - Browse repository at this point
Copy the full SHA 7329219View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2e878c2 - Browse repository at this point
Copy the full SHA 2e878c2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36f713c - Browse repository at this point
Copy the full SHA 36f713cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1256038 - Browse repository at this point
Copy the full SHA 1256038View commit details -
Configuration menu - View commit details
-
Copy full SHA for dba14b6 - Browse repository at this point
Copy the full SHA dba14b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1eb481 - Browse repository at this point
Copy the full SHA e1eb481View commit details -
detect: simplify content inspection types
Instead of a type per buffer type, pass just 3 possible types: packet, stream, state. The individual types weren't used. State is just there to be not packet and not stream.
Configuration menu - View commit details
-
Copy full SHA for ae5846b - Browse repository at this point
Copy the full SHA ae5846bView commit details -
mpm: add App Layer MPM registery
Register keywords globally at start up. Create a map of the registery per detection engine. This we need because the sgh_mpm_context value is set per detect engine. Remove APP_MPMS_MAX.
Configuration menu - View commit details
-
Copy full SHA for 5b2e36a - Browse repository at this point
Copy the full SHA 5b2e36aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7289d12 - Browse repository at this point
Copy the full SHA 7289d12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38e018e - Browse repository at this point
Copy the full SHA 38e018eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b98c00 - Browse repository at this point
Copy the full SHA 7b98c00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7813a83 - Browse repository at this point
Copy the full SHA 7813a83View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4ea38a - Browse repository at this point
Copy the full SHA e4ea38aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d0632a - Browse repository at this point
Copy the full SHA 6d0632aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 43b281a - Browse repository at this point
Copy the full SHA 43b281aView commit details -
Configuration menu - View commit details
-
Copy full SHA for cf96db0 - Browse repository at this point
Copy the full SHA cf96db0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 644d4dc - Browse repository at this point
Copy the full SHA 644d4dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 91695c8 - Browse repository at this point
Copy the full SHA 91695c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5cd488 - Browse repository at this point
Copy the full SHA b5cd488View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7466144 - Browse repository at this point
Copy the full SHA 7466144View commit details -
Configuration menu - View commit details
-
Copy full SHA for a1a2187 - Browse repository at this point
Copy the full SHA a1a2187View commit details -
Configuration menu - View commit details
-
Copy full SHA for 57ae3c4 - Browse repository at this point
Copy the full SHA 57ae3c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for e68b221 - Browse repository at this point
Copy the full SHA e68b221View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6dd4dff - Browse repository at this point
Copy the full SHA 6dd4dffView commit details -
fast_pattern: register app layer mpms automatically
Allow for duplicate registrations for the same list. After the first registration new calls will be ignored.
Configuration menu - View commit details
-
Copy full SHA for 960461f - Browse repository at this point
Copy the full SHA 960461fView commit details -
http_request_line: implement keyword and mpm
Implemented as 'stickybuffer'. Move all logic into the keyword file and remove bad tests that tested URI instead of request line.
Configuration menu - View commit details
-
Copy full SHA for 4c98b6c - Browse repository at this point
Copy the full SHA 4c98b6cView commit details -
http_response_body: implement keyword with mpm
Implemented as 'stickybuffer'.
Configuration menu - View commit details
-
Copy full SHA for f1e3840 - Browse repository at this point
Copy the full SHA f1e3840View commit details -
detect state: reorganize flags
List the common non-buffer specific flags on top.
Configuration menu - View commit details
-
Copy full SHA for bac37fc - Browse repository at this point
Copy the full SHA bac37fcView commit details -
detect-engine: improved inspect engines
Inspect engines are called per signature per sigmatch list. Most wrap around DetectEngineContentInspection, but it's more generic. Until now, the inspect engines were setup in a large per ipproto, per alproto, per direction table. For stateful inspection each engine needed a global flag. This approach had a number of issues: 1. inefficient: each inspection round walked the table and then checked if the inspect engine was even needed for the current rule. 2. clumsy registration with global flag registration. 3. global flag space was approaching the need for 64 bits 4. duplicate registration for alprotos supporting both TCP and TCP (DNS). This patch introduces a new approach. First, it does away with the per ipproto engines. This wasn't used. Second, it adds a per signature list of inspect engine containing only those engines that actually apply to the rule. Third, it gets rid of the global flags and replaces it with flags assigned per rule per engine.
Configuration menu - View commit details
-
Copy full SHA for 5f99475 - Browse repository at this point
Copy the full SHA 5f99475View commit details -
Configuration menu - View commit details
-
Copy full SHA for ad3c97f - Browse repository at this point
Copy the full SHA ad3c97fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a0bbd6 - Browse repository at this point
Copy the full SHA 9a0bbd6View commit details -
detect-engine: new registration call
Make it more in line with MPM registration.
Configuration menu - View commit details
-
Copy full SHA for 5bde86b - Browse repository at this point
Copy the full SHA 5bde86bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0feeb8d - Browse repository at this point
Copy the full SHA 0feeb8dView commit details -
Configuration menu - View commit details
-
Copy full SHA for cc96fed - Browse repository at this point
Copy the full SHA cc96fedView commit details -
Configuration menu - View commit details
-
Copy full SHA for b96c2c5 - Browse repository at this point
Copy the full SHA b96c2c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4096f76 - Browse repository at this point
Copy the full SHA 4096f76View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb19eb3 - Browse repository at this point
Copy the full SHA eb19eb3View commit details -
Configuration menu - View commit details
-
Copy full SHA for b314829 - Browse repository at this point
Copy the full SHA b314829View commit details -
Configuration menu - View commit details
-
Copy full SHA for cd8b1b0 - Browse repository at this point
Copy the full SHA cd8b1b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for b1adea6 - Browse repository at this point
Copy the full SHA b1adea6View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc857c5 - Browse repository at this point
Copy the full SHA fc857c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for edb2936 - Browse repository at this point
Copy the full SHA edb2936View commit details -
Configuration menu - View commit details
-
Copy full SHA for a00629a - Browse repository at this point
Copy the full SHA a00629aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0496b3f - Browse repository at this point
Copy the full SHA 0496b3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 20e93ba - Browse repository at this point
Copy the full SHA 20e93baView commit details -
Configuration menu - View commit details
-
Copy full SHA for cd70575 - Browse repository at this point
Copy the full SHA cd70575View commit details -
Configuration menu - View commit details
-
Copy full SHA for 200a4c1 - Browse repository at this point
Copy the full SHA 200a4c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for a87c196 - Browse repository at this point
Copy the full SHA a87c196View commit details -
Configuration menu - View commit details
-
Copy full SHA for e28e98b - Browse repository at this point
Copy the full SHA e28e98bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c9bb762 - Browse repository at this point
Copy the full SHA c9bb762View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2db094a - Browse repository at this point
Copy the full SHA 2db094aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 08d0fe0 - Browse repository at this point
Copy the full SHA 08d0fe0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f253e1 - Browse repository at this point
Copy the full SHA 6f253e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a0bea8 - Browse repository at this point
Copy the full SHA 8a0bea8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e35fa7 - Browse repository at this point
Copy the full SHA 9e35fa7View commit details -
detect app-layer-event: clean up registration
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.
Configuration menu - View commit details
-
Copy full SHA for a24870f - Browse repository at this point
Copy the full SHA a24870fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 58ac402 - Browse repository at this point
Copy the full SHA 58ac402View commit details -
detect: reshuffle keyword registration order
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.
Configuration menu - View commit details
-
Copy full SHA for d36c0c1 - Browse repository at this point
Copy the full SHA d36c0c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8321f04 - Browse repository at this point
Copy the full SHA 8321f04View commit details -
prefilter: use array of engines per sgh
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.
Configuration menu - View commit details
-
Copy full SHA for 798ba01 - Browse repository at this point
Copy the full SHA 798ba01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4402274 - Browse repository at this point
Copy the full SHA 4402274View commit details -
Configuration menu - View commit details
-
Copy full SHA for 358eacf - Browse repository at this point
Copy the full SHA 358eacfView commit details -
http_header: don't separately inspect trailer yet
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.
Configuration menu - View commit details
-
Copy full SHA for d9811e5 - Browse repository at this point
Copy the full SHA d9811e5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bd906a - Browse repository at this point
Copy the full SHA 5bd906aView commit details