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

Threshold flow/v2 #10550

Closed
wants to merge 3 commits into from
Closed

Conversation

victorjulien
Copy link
Member

SV_BRANCH=OISF/suricata-verify#1679

https://redmine.openinfosecfoundation.org/issues/6822

replaces #10544:

  • improving commit msg
  • adding support for global thresholds

Add support for 'by_flow' track option. This allows using the various
threshold options in the context of a single flow.

Example:

    alert tcp ... stream-event:pkt_broken_ack; \
        threshold:type limit, track by_flow, count 1, seconds 3600;

The example would limit the number of alerts to once per hour for
packets triggering the 'pkt_broken_ack' stream event.

Implemented as a special "flowvar" holding the threshold entries. This
means no synchronization is required, making this a cheaper option
compared to the other trackers.

Ticket: OISF#6822.
Allow rate_filter and thresholds from the global config to specify
tracking "by_flow".
@victorjulien victorjulien mentioned this pull request Mar 2, 2024
Copy link

codecov bot commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 94.44444% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 82.67%. Comparing base (6d0e11e) to head (aa462a8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10550      +/-   ##
==========================================
+ Coverage   78.40%   82.67%   +4.27%     
==========================================
  Files         922      922              
  Lines      246779   247037     +258     
==========================================
+ Hits       193488   204250   +10762     
+ Misses      53291    42787   -10504     
Flag Coverage Δ
fuzzcorpus 64.02% <19.04%> (+0.11%) ⬆️
suricata-verify 61.76% <90.47%> (?)
unittests 62.19% <34.72%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 18926

Copy link
Member

@inashivb inashivb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. One question inline.

@@ -35,6 +35,7 @@ enum VarTypes {
VAR_TYPE_FLOW_BIT,
VAR_TYPE_FLOW_INT,
VAR_TYPE_FLOW_VAR,
VAR_TYPE_FLOW_THRESHOLD,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was expecting VarNameStore* ops corresponding to this but I see nothing. Could you please tell why was this type added?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question, I will look into it. It seems the current use of these types is a bit inconsistent.

@victorjulien victorjulien mentioned this pull request Mar 4, 2024
@victorjulien
Copy link
Member Author

replaced by #10568

@victorjulien victorjulien deleted the threshold-flow/v2 branch June 23, 2024 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants