maskit commented on code in PR #13586:
URL: https://github.com/apache/trafficserver/pull/13586#discussion_r3866094970


##########
plugins/experimental/jax_fingerprint/ja4/fingerprint.h:
##########
@@ -0,0 +1,36 @@
+/** @file
+
+  JA4 TLS ClientHello fingerprint calculation.
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+  agreements. See the NOTICE file distributed with this work for additional 
information regarding
+  copyright ownership. Licensed under the Apache License, Version 2.0 (the 
"License"); you may not
+  use this file except in compliance with the License. You may obtain a copy 
of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software 
distributed under the License
+  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+  or implied. See the License for the specific language governing permissions 
and limitations under
+  the License.
+ */
+
+#pragma once
+
+#include <string>
+
+#include "ts/ts.h"
+
+namespace ja4
+{
+
+/** Compute a JA4 fingerprint from an ATS ClientHello.
+ *
+ * @param[in] client_hello The ClientHello to fingerprint.
+ * @return The JA4 fingerprint.
+ */
+std::string fingerprint(TSClientHello client_hello);

Review Comment:
   I'm fine with the changes for jax_fingerprint plugin. However, I'm not sure 
if we want to have the inter-plugin code dependency.
   
   Do you want to keep abuse_shield self-sufficient? If it's not a hard 
requirement, I think we can add `--export <UserArgName>` param to 
jax_fingerprint so that other plugins can access fingerprints with 
`TSUserArgIndexNameLookup` and `TSUserArgGet`. This approach would work for 
user scripts (Cripts, header_rewrite, Lua) as well.
   
   If users want to have both plugins for different purposes, fingerprints 
would be generated twice for a connection.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to