Skip to content
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

NSM: Improve the method of updating thread count in suricata.yaml #1230

Closed
TOoSmOotH opened this Issue Mar 29, 2018 · 4 comments

Comments

3 participants
@TOoSmOotH
Copy link
Collaborator

TOoSmOotH commented Mar 29, 2018

The current way SO updates the threads value in the suricata.yaml overwrites 2 stats field that should be yes or no.

Line 192:

 191             totals: yes       # stats for all threads merged together
 192             threads: 3
 193             deltas: no        # include delta values

Should be:

191             totals: yes       # stats for all threads merged together
192             threads: no
193             deltas: no        # include delta values

Line 351:

 346   - stats:
 347       enabled: yes
 348       filename: stats.log
 349       append: yes       # append to file (yes) or overwrite it (no)
 350       totals: yes       # stats for all threads merged together
 351       threads: 3

Should be:

 346   - stats:
 347       enabled: yes
 348       filename: stats.log
 349       append: yes       # append to file (yes) or overwrite it (no)
 350       totals: yes       # stats for all threads merged together
 351       threads: no

@TOoSmOotH TOoSmOotH added this to To do in Post GA MR 1 Mar 29, 2018

@TOoSmOotH TOoSmOotH changed the title Suricata - Ability to set detect-thread-ratio and fix threads issue Suricata - Fix config threads issue Mar 30, 2018

@mattmeer

This comment has been minimized.

Copy link

mattmeer commented Sep 12, 2018

Hey Mike,

So i looked up the script that rewrites the threads value.
https://github.com/Security-Onion-Solutions/securityonion-nsmnow-admin-scripts/blob/fad1894f5a81ef6582608cc48a6464226e0c2235/usr/sbin/nsm_sensor_ps-restart#L530
https://github.com/Security-Onion-Solutions/securityonion-nsmnow-admin-scripts/blob/257c43bd152549364335760fb41d2a51edc78480/usr/sbin/nsm_sensor_ps-start#L538
Isn't the solution to this simply adding [0-9] to the end of the regex? Like this:
s| threads: .*[0-9]|
From what i have tested this should limit the regex to overwriting only "threads:" values that have a digit, since the .* is greedy it should grab as many characters as possible before stopping and thus also include thread counts >9.

Kind Regards,
Matthias Meersseman

@dougburks dougburks added this to To do in 16.04.6.1 via automation Jan 28, 2019

@dougburks dougburks changed the title Suricata - Fix config threads issue NSM: Improve the method of updating thread count in suricata.yaml Jan 28, 2019

@dougburks

This comment has been minimized.

Copy link
Contributor

dougburks commented Jan 28, 2019

Thanks for the suggestion @mattmeer !

dougburks added a commit to Security-Onion-Solutions/securityonion-nsmnow-admin-scripts that referenced this issue Jan 28, 2019

@dougburks dougburks moved this from To do to In progress in 16.04.6.1 Jan 28, 2019

@dougburks dougburks moved this from In progress to In Testing in 16.04.6.1 Jan 31, 2019

@dougburks

This comment has been minimized.

Copy link
Contributor

dougburks commented Jan 31, 2019

@dougburks

This comment has been minimized.

@dougburks dougburks closed this Feb 11, 2019

16.04.6.1 automation moved this from In Testing to Done Feb 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.