-
Notifications
You must be signed in to change notification settings - Fork 1.7k
RFC: config: aggregate mpm/spm options under the detect node v1 #14902
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1810,15 +1810,43 @@ detect: | |||||
| custom-values: | ||||||
| toclient-groups: 3 | ||||||
| toserver-groups: 25 | ||||||
| sgh-mpm-context: auto | ||||||
| # Cache MPM contexts to the disk to avoid rule compilation at the startup. | ||||||
| # Cache files are created in the standard library directory. | ||||||
| sgh-mpm-caching: yes | ||||||
| sgh-mpm-caching-path: @e_sghcachedir@ | ||||||
| # Maximum age for cached MPM databases before they are pruned. | ||||||
| # Accepts a combination of time units (s,m,h,d,w,y). | ||||||
| # Omit to use the default, 0 to disable. | ||||||
| # sgh-mpm-caching-max-age: 7d | ||||||
| mpm: | ||||||
| # Select the multi pattern algorithm you want to run for scan/search | ||||||
|
||||||
| # Select the multi pattern algorithm you want to run for scan/search | |
| # Select the multi pattern algorithm you want to use for pattern matching |
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.
Not really specific to this PR, but is the cache enabled by default even if this is commented out?
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.
yes, starting in Suricata 8, if the caching folder is available/writeable.
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.
We can comment it out then. This helps us make sure defaults are actually defaults, and not just a default because they are set that way in the configuration file.
Copilot
AI
Feb 25, 2026
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 configuration paths have been changed in the YAML file (e.g., mpm-algo moved to detect.mpm.algo), but the C code still reads from the old configuration paths. The code in src/detect-engine-mpm.c line 917 uses SCConfGet("mpm-algo", ...), which will not find the value at the new location detect.mpm.algo. Similar issues exist for:
spm-algo(used insrc/util-spm.cline 72)detect.sgh-mpm-context(used insrc/detect-engine.cline 2793)detect.sgh-mpm-caching(used insrc/detect-engine.cline 2458)detect.sgh-mpm-caching-path(used insrc/detect-engine.cline 2470)detect.sgh-mpm-caching-max-age(used insrc/detect-engine.cline 2555)
This PR needs corresponding C code changes to read from the new configuration paths, or it needs backward compatibility support to handle both old and new paths during a transition period.
Copilot
AI
Feb 25, 2026
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.
Documentation in multiple files (doc/userguide/configuration/suricata-yaml.rst, doc/userguide/performance/hyperscan.rst, doc/userguide/performance/tuning-considerations.rst, etc.) still references the old configuration paths like mpm-algo, spm-algo, detect.sgh-mpm-context, sgh-mpm-caching, etc. These documentation files need to be updated to reflect the new nested structure under detect.mpm and detect.spm.
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.
Why place this in
mpmindetectwhen mpm is not only about detect (see ftp parsing for example)