Skip to content

Commit

Permalink
eve/drop: don't log drops unless packet is dropped
Browse files Browse the repository at this point in the history
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.
(cherry picked from commit 0934856)
  • Loading branch information
victorjulien committed Mar 28, 2023
1 parent 7838fc8 commit 517132b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/output-json-drop.c
Expand Up @@ -357,6 +357,10 @@ static int JsonDropLogCondition(ThreadVars *tv, const Packet *p)
return FALSE;
}

if (!PACKET_TEST_ACTION(p, ACTION_DROP)) {
return FALSE;
}

if (g_droplog_flows_start && p->flow != NULL) {
int ret = FALSE;

Expand All @@ -373,11 +377,9 @@ static int JsonDropLogCondition(ThreadVars *tv, const Packet *p)
ret = TRUE;

return ret;
} else if (PACKET_TEST_ACTION(p, ACTION_DROP)) {
return TRUE;
}

return FALSE;
return TRUE;
}

void JsonDropLogRegister (void)
Expand Down

0 comments on commit 517132b

Please sign in to comment.