]> git.ipfire.org Git - thirdparty/suricata.git/commit
krb: trigger raw stream reassembly
authorShivani Bhardwaj <shivani@oisf.net>
Thu, 8 May 2025 07:06:45 +0000 (12:36 +0530)
committerShivani Bhardwaj <shivanib134@gmail.com>
Thu, 15 May 2025 07:12:36 +0000 (12:42 +0530)
commitfd683ed151ee0bca2c7c142c687672735ae1a820
tree9be153d773f654d278abd60d1a6bbe1fbfabda33
parentd0655ed30ee37b66e70c0a5e799d16387bdf74f3
krb: trigger raw stream reassembly

Internals
---------
Suricata's stream engine returns data for inspection to the detection
engine from the stream when the chunk size is reached.

Bug
---
Inspection triggered only in the specified chunk sizes may be too late
when it comes to inspection of smaller protocol specific data which
could result in delayed inspection, incorrect data logged with a transaction
and logs misindicating the pkt that triggered an alert.

Fix
---
Fix this by making an explicit call from all respective applayer parsers to
trigger raw stream reassembly which shall make the data available for inspection
in the following call of the stream engine. This needs to happen per direction
on the completion of an entity like a request or a response.

Important notes
---------------
1. The above mentioned behavior with and without this patch is
affected internally by the following conditions.
- inspection depth
- stream depth
In these special cases, the inspection window will be affected and
Suricata may not consider all the data that could be expected to be
inspected.
2. This only applies to applayer protocols running over TCP.
3. The inspection window is only considered up to the ACK'd data.
4. This entire issue is about IDS mode only.

KRB5 creates a transaction based on how each input is parsed. It could
be parsed as a request or response but that is the concern of the
parser. The call to trigger raw stream reassembly has been added after
successful parsing of the respective request/response.

Optimization 7026
Bug 7004
rust/src/krb/krb5.rs