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

Fix midstream exception policy bug 5825 - v3 #8952

Closed
wants to merge 12 commits into from

Conversation

jufajardini
Copy link
Contributor

Link to redmine ticket:
https://redmine.openinfosecfoundation.org/issues/5825

Previous (draf) PR: #8948

Describe changes:

  • incorporate feedback from previous PR (including fix scan-build bug)
  • explain new, less forgiving, midstream policy behavior in commit message
  • rework commit history
  • change 'SCLogConfig' for 'SCLogWarning' to avoid output about what policy has been set to go silent.

SV_BRANCH=pr/1226

OISF/suricata-verify#1226

7a044a9 removed the lines that incremented these defrag
counters, but kept the entities themselves. This commit removes counters
that we judge too complex to maintain, given the current state of the
code, and re-adds incrementing max_hit (memcap related).

Related to
Task OISF#5816
Updated FlowGetNew documentation, where it said NULL was only returned
in case of error.
The different interactions between midstream pick-up sessions and the
exception policy can be quite difficult to visualize. Add a section for
that in the userguide.

Related to
Bug OISF#5825
Some exception policies can only be applied to the triggering packet or
only make sense considering the whole flow. Highlight such cases in the
table showing each exception policy.

Related to
Bug OISF#5825
Split up ExceptionPolicyParse to try to improve readability.

Related to
Bug OISF#5825
As the midstream exception policy has its own specific scenarios, have a
dedicated function to parse and process its config values, and check for
midstream enabled when needed.

Related to
Bug OISF#5825
Get the enum values from the config file. Update the new extracted
functions. Post-process the config values based on runmode and policy.
Also handle 'auto' enum value in these.

Related to
Bug OISF#5825
As the SCLogConfig output isn't showing, ensure that we use a log level
more likely to be seen by users, if need be.

Related to
Bug OISF#5825
We were always setting it to ignore, due to bug 5825.

The engine will now issue an initialization error if an invalid value
is passed in the configuration file for midstream exception policy.

'pass-packet' or 'drop-packet' are never valid, as the midstream policy
concerns the whole flow, not making sense for just a packet.

If midstream is enabled, only two actual config values are allowed:
'ignore' and 'pass-flow', both in IDS and in IPS mode. In default mode
('auto' or if no policy is defined), midstream-policy is set to
'ignore'. All other values will lead to initialization error.

In IDS mode, 'drop-flow' will also lead to initialization error.

Part of
Bug OISF#5825
This is no longer valid for midstream exception policies.

Part of
Bug OISF#5825
@suricata-qa
Copy link

Information:

field baseline test %
TREX_GENERIC_stats_chk
.capture.kernel_drops 0 9004 0.00

Pipeline 14207

@victorjulien
Copy link
Member

seems to fail due to https://redmine.openinfosecfoundation.org/issues/6109

@jufajardini
Copy link
Contributor Author

Replaced by: #8969 - which uses SV PR without 6109 test.

@jufajardini jufajardini closed this Jun 5, 2023
@jufajardini jufajardini deleted the 5825-midstream-bug/v3 branch June 16, 2023 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants