Skip to content

Commit

Permalink
stream/tcp: re-enable midstream-policy usage
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jufajardini authored and victorjulien committed Jun 13, 2023
1 parent e849afb commit 69d3750
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/stream-tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,7 @@ void StreamTcpInitConfig(bool quiet)
stream_config.ssn_memcap_policy = ExceptionPolicyParse("stream.memcap-policy", true);
stream_config.reassembly_memcap_policy =
ExceptionPolicyParse("stream.reassembly.memcap-policy", true);
stream_config.midstream_policy = ExceptionPolicyParse("stream.midstream-policy", true);
if (stream_config.midstream && stream_config.midstream_policy != EXCEPTION_POLICY_NOT_SET) {
SCLogWarning("stream.midstream_policy setting conflicting with stream.midstream enabled. "
"Ignoring stream.midstream_policy. Bug #5825.");
stream_config.midstream_policy = EXCEPTION_POLICY_NOT_SET;
}
stream_config.midstream_policy = ExceptionPolicyMidstreamParse(stream_config.midstream);

if (!quiet) {
SCLogConfig("stream.\"inline\": %s",
Expand Down

0 comments on commit 69d3750

Please sign in to comment.