|
| 1 | +.. Licensed to the Apache Software Foundation (ASF) under one |
| 2 | + or more contributor license agreements. See the NOTICE file |
| 3 | + distributed with this work for additional information |
| 4 | + regarding copyright ownership. The ASF licenses this file |
| 5 | + to you under the Apache License, Version 2.0 (the |
| 6 | + "License"); you may not use this file except in compliance |
| 7 | + with the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | + Unless required by applicable law or agreed to in writing, |
| 12 | + software distributed under the License is distributed on an |
| 13 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | + KIND, either express or implied. See the License for the |
| 15 | + specific language governing permissions and limitations |
| 16 | + under the License. |
| 17 | +
|
| 18 | +.. include:: ../../common.defs |
| 19 | + |
| 20 | +.. _admin-plugins-jax-fingerprint: |
| 21 | + |
| 22 | +JAx Fingerprint Plugin |
| 23 | +********************** |
| 24 | + |
| 25 | +Description |
| 26 | +=========== |
| 27 | + |
| 28 | +The JAx Fingerprint plugin generates client fingerprints based on the JA4+ or JA3 algorithms designed by John Althouse. |
| 29 | + |
| 30 | +Fingerprints can be used for: |
| 31 | + |
| 32 | +* Client identification and tracking |
| 33 | +* Bot detection and mitigation |
| 34 | +* Security analytics and threat intelligence |
| 35 | +* Understanding client implementation patterns |
| 36 | + |
| 37 | + |
| 38 | +Plugin Configuration |
| 39 | +==================== |
| 40 | + |
| 41 | +You can use the plugin as a global plugin, a remap plugin, or both. |
| 42 | + |
| 43 | +To use the plugin as a global plugin, add the following line to :file:`plugin.config`:: |
| 44 | + |
| 45 | + jax_fingerprint.so --standalone |
| 46 | + |
| 47 | +To use the plugin as a remap plugin, append the following line to a remap rule on :file:`remap.config`:: |
| 48 | + |
| 49 | + @plugin=jax_fingerprint.so @pparam=--standalone |
| 50 | + |
| 51 | +To use the plugin in a hybrid setup (both global and remap plugin), configure it in both :file:`plugin.config` and |
| 52 | +:file:`remap.config` without ``--standalone`` option. |
| 53 | + |
| 54 | + |
| 55 | +.. option:: --standalone |
| 56 | + |
| 57 | +This option enables you to use the plugin as either a global plugin, or a remap plugin. In other |
| 58 | +words, the option needs to be specified if you do not use the hybrid setup. |
| 59 | + |
| 60 | +.. option:: --method <JA4|JA4H|JA3> |
| 61 | + |
| 62 | +Fingerprinting method (e.g. JA4, JA3, etc.) to use. This option must be specified. |
| 63 | + |
| 64 | +.. option:: --mode <overwrite|keep|append> |
| 65 | + |
| 66 | +This option specifies what to do if requests from clients have the header names that are specified |
| 67 | +by `--header` and/or `--via-header`. Available setting values are "overwrite", "keep" and "append". |
| 68 | +The default mode is "overwrite". |
| 69 | + |
| 70 | +.. option:: --servernames <servername1,servername2,...> |
| 71 | + |
| 72 | +This option specifies server name(s) for which the plugin generates fingerprints. |
| 73 | +The value must be provided as a single comma separated value (no space) of server names. |
| 74 | +If the option is not specified, the plugin generates fingerprints for any server names. |
| 75 | + |
| 76 | +.. option:: --header <header_name> |
| 77 | + |
| 78 | +This option specifies the name of the header field where the plugin stores the generated fingerprint value. If not specified, header generation will be suppressed. |
| 79 | + |
| 80 | +.. option:: --via-header <via_header_name> |
| 81 | + |
| 82 | +This option specifies the name of the header field where the plugin stores the generated fingerprint-via value. If not specified, header generation will be suppressed. |
| 83 | + |
| 84 | +.. option:: --log-filename <filename> |
| 85 | + |
| 86 | +This option specifies the filename for the plugin log file. If not specified, log output will be suppressed. |
| 87 | + |
| 88 | + |
| 89 | +Plugin Behavior |
| 90 | +=============== |
| 91 | + |
| 92 | +Global plugin setup |
| 93 | +------------------- |
| 94 | + |
| 95 | +Global plugin setup is the best if you: |
| 96 | + * Need a fingerprint on every request |
| 97 | + |
| 98 | +Remap plugin setup |
| 99 | +------------------ |
| 100 | + |
| 101 | +Remap plugin setup is the best if you: |
| 102 | + * Need a fingerprint only on specific paths, or |
| 103 | + * Cannot use Global plugin setup |
| 104 | + |
| 105 | +.. note:: For JA3 and JA4, fingerprints are always generated at the beginning of connections. Using remap plugin setup only reduces the overhead of adding HTTP headers and logging. |
| 106 | + |
| 107 | +Hybrid setup |
| 108 | +------------ |
| 109 | + |
| 110 | +Hybrid setup is the best if you: |
| 111 | + * Need a fingerprint only for specific server names (in TLS SNI extension), and |
| 112 | + * Need a fingerprint only on specific paths |
| 113 | + |
| 114 | + |
| 115 | +Log Output |
| 116 | +========== |
| 117 | + |
| 118 | +The plugin outputs a log file in the Traffic Server log directory (typically ``/var/log/trafficserver/``) if a log filename is |
| 119 | +specified by ``--log-filename`` option. |
| 120 | + |
| 121 | +**Log Format**:: |
| 122 | + |
| 123 | + [timestamp] Client: <address> <method_name>: <fingerprint> |
| 124 | + |
| 125 | +**Example**:: |
| 126 | + |
| 127 | + [Jan 29 10:15:23.456] Client: 192.168.1.100 JA4: t13d1516h2_8daaf6152771_b186095e22b6 |
| 128 | + [Jan 29 10:15:24.123] Client: 10.0.0.50 JA4: t13d1715h2_8daaf6152771_02713d6af862 |
| 129 | + |
| 130 | + |
| 131 | +Using HTTP Headers in Origin Requests |
| 132 | +===================================== |
| 133 | + |
| 134 | +Origin servers can access the generated fingerprint through the injected HTTP header. |
| 135 | +This allows the origin to: |
| 136 | + |
| 137 | +* Make access control decisions based on client fingerprints |
| 138 | +* Log fingerprints for security analysis |
| 139 | +* Track client populations and TLS implementation patterns |
| 140 | + |
| 141 | +The fingerprint-via header allows origin servers to track which Traffic Server proxy handled the request when multiple proxies are deployed. |
| 142 | + |
| 143 | + |
| 144 | +Debugging |
| 145 | +========= |
| 146 | + |
| 147 | +To enable debug logging for the plugin, set the following in :file:`records.yaml`:: |
| 148 | + |
| 149 | + records: |
| 150 | + diags: |
| 151 | + debug: |
| 152 | + enabled: 1 |
| 153 | + tags: jax_fingerprint |
| 154 | + |
| 155 | + |
| 156 | +Requirements |
| 157 | +============ |
| 158 | + |
| 159 | +* Traffic Server must be built with TLS support (OpenSSL or BoringSSL) if you use JA3 or JA4 |
| 160 | + |
| 161 | + |
| 162 | +See Also |
| 163 | +======== |
| 164 | +* JA3 Technical Specification: https://github.com/FoxIO-LLC/ja3 |
| 165 | +* JA4+ Technical Specification: https://github.com/FoxIO-LLC/ja4 |
| 166 | + |
| 167 | + |
| 168 | +Example Configuration |
| 169 | +===================== |
| 170 | + |
| 171 | +Enable JA4 fingerprinting by hybrid (global + remap) setup |
| 172 | +---------------------------------------------------------- |
| 173 | + |
| 174 | +This configuration adds x-my-ja4 header if a connection is established for either abc.example or xyz.example. |
| 175 | + |
| 176 | +**plugin.config**:: |
| 177 | + |
| 178 | + jax_fingerprint.so --method JA4 --servernames abc.example,xyz.example |
| 179 | + |
| 180 | +**remap.config**:: |
| 181 | + |
| 182 | + map / http://origin.example/ @plugin=jax_fingerprint.so @pparam=--method=JA4 @pparam=--header=x-my-ja4 |
0 commit comments