]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output/ftp: Log mode for passive connections
authorJeff Lucovsky <jlucovsky@oisf.net>
Sat, 26 Apr 2025 13:21:51 +0000 (09:21 -0400)
committerVictor Julien <victor@inliniac.net>
Wed, 14 May 2025 05:35:28 +0000 (07:35 +0200)
This commit will now output the FTP mode -- active or passive -- when
the command is
- (previous): PORT, EPRT
- (new): PASV, EPSV

Issue: 7505

src/output-json-ftp.c

index 0f2f23575afa35b6ad79032f828ae8bb590a459b..e41d506f8e4f5c4ff5bf49d95f1ceca1c93ac2e9 100644 (file)
@@ -128,13 +128,18 @@ bool EveFTPLogCommand(void *vtx, SCJsonBuilder *jb)
         SCJbSetUint(jb, "dynamic_port", tx->dyn_port);
     }
 
-    if (tx->command_descriptor.command_code == FTP_COMMAND_PORT ||
-            tx->command_descriptor.command_code == FTP_COMMAND_EPRT) {
-        if (tx->active) {
-            JB_SET_STRING(jb, "mode", "active");
-        } else {
-            JB_SET_STRING(jb, "mode", "passive");
-        }
+    switch (tx->command_descriptor.command_code) {
+        case FTP_COMMAND_PORT:
+        case FTP_COMMAND_EPRT:
+        case FTP_COMMAND_PASV:
+        case FTP_COMMAND_EPSV:
+            if (tx->active) {
+                JB_SET_STRING(jb, "mode", "active");
+            } else {
+                JB_SET_STRING(jb, "mode", "passive");
+            }
+        default:
+            break;
     }
 
     if (tx->done) {