]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
eve/drop: don't log drops unless packet is dropped
authorVictor Julien <vjulien@oisf.net>
Tue, 21 Mar 2023 19:20:48 +0000 (20:20 +0100)
committerVictor Julien <vjulien@oisf.net>
Fri, 24 Mar 2023 05:28:54 +0000 (06:28 +0100)
In pass/drop combinations where the pass rule took precendence over
the drop, a "drop" false positive could still be logged due to the
storing of the drop record in the packet drop alert store.

Bug: #5867.

src/output-json-drop.c

index 39d283d3aadd8ef9fa5382350d8a75fb402f9f66..962358ab6186589d963af346f1150cb7a95e961d 100644 (file)
@@ -349,6 +349,10 @@ static int JsonDropLogCondition(ThreadVars *tv, void *data, const Packet *p)
         return FALSE;
     }
 
+    if (!(PacketCheckAction(p, ACTION_DROP))) {
+        return FALSE;
+    }
+
     if (g_droplog_flows_start && p->flow != NULL) {
         int ret = FALSE;
 
@@ -365,11 +369,9 @@ static int JsonDropLogCondition(ThreadVars *tv, void *data, const Packet *p)
             ret = TRUE;
 
         return ret;
-    } else if (PacketCheckAction(p, ACTION_DROP)) {
-        return TRUE;
     }
 
-    return FALSE;
+    return TRUE;
 }
 
 void JsonDropLogRegister (void)