]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output-json-tls: log 'from_proto' field
authorMats Klepsland <mats.klepsland@gmail.com>
Tue, 31 Jan 2017 14:02:21 +0000 (15:02 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 8 May 2017 08:43:36 +0000 (10:43 +0200)
Log the original application level protocol when protocol have been
changed because of STARTTLS, HTTP CONNECT or similar.

src/output-json-tls.c

index 5184373d65598824b61d55c8fc9a55ae4b399457..3bdd481621de3ba05c1ed5804fd505d8d81247b8 100644 (file)
@@ -383,6 +383,13 @@ static int JsonTlsLogger(ThreadVars *tv, void *thread_data, const Packet *p,
         JsonTlsLogJSONBasic(tjs, ssl_state);
     }
 
+    /* print original application level protocol when it have been changed
+       because of STARTTLS, HTTP CONNECT, or similar. */
+    if (f->alproto_orig != ALPROTO_UNKNOWN) {
+        json_object_set_new(tjs, "from_proto",
+                json_string(AppLayerGetProtoName(f->alproto_orig)));
+    }
+
     json_object_set_new(js, "tls", tjs);
 
     OutputJSONBuffer(js, tls_ctx->file_ctx, &aft->buffer);