Commit 0c44f3f
committed
stream/tcp: account for midstream sessions
Commit 497394e removed inspection of app-proto txs for packets
without an established TCP connection. But this meant that the
first packet seen in a session pick mid-stream could go without
inspection (previous bug 5510 seemed to point towards this behavior,
too).
If a flow has more packets, the stream will be inspected as part of
the upcoming packets and this would go unnoticed. In a single-packet
flow, however, the inspection for the packed would be skipped. Although
this might not affect alerts -- as they could be processed as part of
the flow timeout logic, the actual traffic could be evaded in IPS, in
case of a drop rule.
From the above, the most visible scenario is when there is only one packet on the flow,
as then the engine doesn't have "more time" to pick-up real-packets to
inspect for that given flow. But certain tests show that this can also
happen for more than one packet scenarios: there will be one less drop
event, or traffic from a packet that should have been already dropped
will be logged.
This led to the possibility of a real packet not being blocked, in IPS,
or matched against rules, as the corresponding portion of the stream
was only inspected later, as part of the stream/flow-timeout logic.
To ensure that we correctly flag the first packet seen for a given mid-stream
session, we must check for the session state *after* we have dealt with
TCP flags and state.
Related to
Bug #5510
As part of
Bug #51801 parent 063e700 commit 0c44f3f
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
5731 | 5731 | | |
5732 | 5732 | | |
5733 | 5733 | | |
| 5734 | + | |
5734 | 5735 | | |
5735 | 5736 | | |
5736 | 5737 | | |
| |||
5804 | 5805 | | |
5805 | 5806 | | |
5806 | 5807 | | |
5807 | | - | |
5808 | | - | |
5809 | | - | |
5810 | | - | |
5811 | 5808 | | |
5812 | 5809 | | |
5813 | 5810 | | |
5814 | 5811 | | |
5815 | 5812 | | |
5816 | 5813 | | |
5817 | 5814 | | |
| 5815 | + | |
| 5816 | + | |
| 5817 | + | |
| 5818 | + | |
| 5819 | + | |
| 5820 | + | |
5818 | 5821 | | |
5819 | 5822 | | |
5820 | 5823 | | |
| |||
0 commit comments