Hi,
I’ve been messing around with bypassing TLS encrypted traffic with app-layer.protocols.tls.encryption-handling
set to bypass
and stream.bypass
set to yes
.
Some other threads on the topic:
Bypassing encrypted traffic does not seem to work - Help - Suricata
Stream bypass documentation note - Developers - Suricata
and my own: Bypass-mark/bypass-mask not working in NFQ mode - Help - Suricata
This works as documented, but I now have the unwanted side-effect where my other non-TLS streams are bypassed once I’ve reached the reassembly depth.
I looked at the code, and from what I could tell, there’s no real reason for this dependency, it’s a simple if
: suricata/stream-tcp.c at master · OISF/suricata (github.com)
STREAMTCP_FLAG_BYPASS
is only set by StreamTcpSetSessionBypassFlag
which is only called once in the entire codebase in the app-layer parser and only when APP_LAYER_PARSER_BYPASS_READY
is set, which is only turned on when ssl_config.encrypt_mode
is set to SSL_CNF_ENC_HANDLE_BYPASS
, here and here.
In other words, there are no other flows that set STREAMTCP_FLAG_BYPASS
as far as I can tell.
So my question is - why is this dependency here? Why not call PacketBypassCallback
without asking if (StreamTcpBypassEnabled())
?
Thanks.