-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Smb hashmap/v10 #12087
Smb hashmap/v10 #12087
Conversation
Don't tag the session as gap'd when the GAP is in a precise location: 1. in "skip" data, where the GAP just fits the skip data 2. in file data, where we pass the GAP on to the file This reduces load of GAP post-processing that is unnecessary in these case.
Ticket: OISF#5672.
Use `lru` crate. Rename to reflect this. Add `app-layer.protocols.smb.max-guid-cache-size` to control the max size of the LRU cache. Ticket: OISF#5672.
Rename to read_offset_cache. Add `app-layer.protocols.smb.max-read-offset-cache-size` option to control the limit. Ticket: OISF#5672.
Turn the map mapping the smb session key to smb tree into a lru cache, limited to 1024 by default. Add `app-layer.protocols.smb.max-tree-cache-size` option to control the limit. Ticket: OISF#5672.
Reimplement the ssnguid2vec_map HashMap as a LruCache. Since this is a DCERPC record cache, name it as such. Default size is 128. Can be controlled by `app-layer.protocols.smb.max-dcerpc-frag-cache-size`. Ticket: OISF#5672.
Generic ssn2vec_map was a HashMap used for mapping session key to different types of vector data: - GUID - filename - share name Turn this into a bounded LruCache. Rename to ssn2vec_cache. Size of the cache is 512 by default, and can be configured using: `app-layer.protocols.smb.max-session-cache-size` Ticket: OISF#5672.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12087 +/- ##
==========================================
- Coverage 83.37% 83.24% -0.14%
==========================================
Files 910 910
Lines 257556 257585 +29
==========================================
- Hits 214748 214417 -331
- Misses 42808 43168 +360
Flags with carried forward coverage won't be shown. Click here to find out more. |
Information: QA ran without warnings. Pipeline 23251 |
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.
The code is looking pretty good. My main concerns are the unknowns... We've gone from unbounded to perhaps some tight bounds. For what scenarios could this cause issues? How to know what might need to be increased if there are issues? How to even know if there are issues?
In some follow up I would like to add events and counters. Events aren't hard, I think. Though they would be along the lines of the most current addition evicted the oldest entry in the hash. Counters would give some insight into how common this is. |
Merged in #12094, thanks! |
|
LruCache use for all hashmaps in smb state. This will bound each of them.
https://redmine.openinfosecfoundation.org/issues/5672
Replaces #12036, update docs.