]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: rename stream_log variables
authorPhilippe Antoine <pantoine@oisf.net>
Mon, 2 Dec 2024 10:00:31 +0000 (11:00 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 10 Dec 2024 13:50:38 +0000 (14:50 +0100)
to better reflect their true meaning

doc/userguide/configuration/suricata-yaml.rst
rust/src/applayer.rs
src/detect-engine.c
src/detect.c
src/detect.h
suricata.yaml.in

index b6488b09f197b02d1e7b70d26315d7ccafb1fe6b..c68d14f401a61e9fff0974b0552a04246ad883b5 100644 (file)
@@ -695,7 +695,7 @@ meaning it will repeat its actions over and over again. With the
 option inspection-recursion-limit you can limit this action.
 
 The stream-tx-log-limit defines the maximum number of times a
-transaction will get logged for a stream-only rule match.
+transaction will get logged for rules without app-layer keywords.
 This is meant to avoid logging the same data an arbitrary number
 of times.
 
index 4535e563aaaf88b68333d46ab897f0555eceea6a..4b786953262454bcac2de8b3a374d7b8a88c7768 100644 (file)
@@ -120,8 +120,9 @@ pub struct AppLayerTxData {
     /// STREAM_TOCLIENT: file tx , files only in toclient dir
     /// STREAM_TOSERVER|STREAM_TOCLIENT: files possible in both dirs
     pub file_tx: u8,
-    /// Number of times this tx data has already been logged for one stream match
-    pub stream_logged: u8,
+    /// Number of times this tx data has already been logged for signatures
+    /// not using application layer keywords
+    pub guessed_applayer_logged: u8,
 
     /// detection engine flags for use by detection engine
     detect_flags_ts: u64,
@@ -160,7 +161,7 @@ impl AppLayerTxData {
             files_stored: 0,
             file_flags: 0,
             file_tx: 0,
-            stream_logged: 0,
+            guessed_applayer_logged: 0,
             updated_tc: true,
             updated_ts: true,
             detect_flags_ts: 0,
@@ -185,7 +186,7 @@ impl AppLayerTxData {
             files_stored: 0,
             file_flags: 0,
             file_tx: 0,
-            stream_logged: 0,
+            guessed_applayer_logged: 0,
             updated_tc,
             updated_ts,
             detect_flags_ts,
index f923ab81f6b0a168266ec54095b3ce6873d70b8b..8c440dff6155a25903a31cf83df053e6688b12e3 100644 (file)
@@ -2931,10 +2931,10 @@ static int DetectEngineCtxLoadConf(DetectEngineCtx *de_ctx)
                de_ctx->inspection_recursion_limit);
 
     // default value is 4
-    de_ctx->stream_tx_log_limit = 4;
+    de_ctx->guess_applayer_log_limit = 4;
     if (ConfGetInt("detect.stream-tx-log-limit", &value) == 1) {
         if (value >= 0 && value <= UINT8_MAX) {
-            de_ctx->stream_tx_log_limit = (uint8_t)value;
+            de_ctx->guess_applayer_log_limit = (uint8_t)value;
         } else {
             SCLogWarning("Invalid value for detect-engine.stream-tx-log-limit: must be between 0 "
                          "and 255, will default to 4");
index 66770500e233d0e689bad1186ac962ffb5fadd35..f00d02af48e0458588baea8836ba011f907506ac 100644 (file)
@@ -827,12 +827,12 @@ static inline void DetectRulePacketRules(
                 AppLayerTxData *txd =
                         tx_ptr ? AppLayerParserGetTxData(pflow->proto, pflow->alproto, tx_ptr)
                                : NULL;
-                if (txd && txd->stream_logged < de_ctx->stream_tx_log_limit) {
+                if (txd && txd->guessed_applayer_logged < de_ctx->guess_applayer_log_limit) {
                     alert_flags |= PACKET_ALERT_FLAG_TX;
                     if (pflow->proto != IPPROTO_UDP) {
                         alert_flags |= PACKET_ALERT_FLAG_TX_GUESSED;
                     }
-                    txd->stream_logged++;
+                    txd->guessed_applayer_logged++;
                 }
             }
         }
index c8bdafdcaa8a1f70610a89019e8c9f04d1a5375c..4e31c5fe02841e1a057fc6e6e072ae4e5615ca84 100644 (file)
@@ -886,8 +886,8 @@ typedef struct DetectEngineCtx_ {
     /* maximum recursion depth for content inspection */
     int inspection_recursion_limit;
 
-    /* maximum number of times a tx will get logged for a stream-only rule match */
-    uint8_t stream_tx_log_limit;
+    /* maximum number of times a tx will get logged for rules not using app-layer keywords */
+    uint8_t guess_applayer_log_limit;
 
     /* force app-layer tx finding for alerts with signatures not having app-layer keywords */
     bool guess_applayer;
index 0a1ae54cc4b9abec5332f2b94b7bc79400967e86..672429e403b847438b07198186e57657784b9ab1 100644 (file)
@@ -1700,7 +1700,7 @@ detect:
     toserver-groups: 25
   sgh-mpm-context: auto
   inspection-recursion-limit: 3000
-  # maximum number of times a tx will get logged for a stream-only rule match
+  # maximum number of times a tx will get logged for rules without app-layer keywords
   # stream-tx-log-limit: 4
   # try to tie an app-layer transaction for rules without app-layer keywords
   # if there is only one live transaction for the flow