|
13 | 13 | IPErrorRequestDetector, |
14 | 14 | IPRPSDetector, |
15 | 15 | ) |
16 | | -from detectors.ja5t import ( |
17 | | - Ja5tAccumulativeTimeDetector, |
18 | | - Ja5tErrorRequestDetector, |
19 | | - Ja5tRPSDetector, |
| 16 | +from detectors.tft import ( |
| 17 | + TFtAccumulativeTimeDetector, |
| 18 | + TFtErrorRequestDetector, |
| 19 | + TFtRPSDetector, |
20 | 20 | ) |
21 | | -from detectors.ja5h import ( |
22 | | - Ja5hAccumulativeTimeDetector, |
23 | | - Ja5hErrorRequestDetector, |
24 | | - Ja5hRPSDetector, |
| 21 | +from detectors.tfh import ( |
| 22 | + TFhAccumulativeTimeDetector, |
| 23 | + TFhErrorRequestDetector, |
| 24 | + TFhRPSDetector, |
25 | 25 | ) |
26 | 26 | from utils.access_log import ClickhouseAccessLog |
27 | | -from utils.ja5_config import Ja5Config |
| 27 | +from utils.tf_config import TFConfig |
28 | 28 | from utils.logger import logger |
29 | 29 | from utils.user_agents import UserAgentsManager |
30 | 30 |
|
|
50 | 50 | ) |
51 | 51 | context = AppContext( |
52 | 52 | blockers={ |
53 | | - blockers.Ja5tBlocker.name(): blockers.Ja5tBlocker( |
54 | | - config=Ja5Config(file_path=app_config.path_to_ja5t_config), |
| 53 | + blockers.TFtBlocker.name(): blockers.TFtBlocker( |
| 54 | + config=TFConfig(file_path=app_config.path_to_tft_config), |
55 | 55 | tempesta_executable_path=app_config.tempesta_executable_path, |
56 | 56 | tempesta_config_path=app_config.tempesta_config_path, |
57 | 57 | ), |
58 | | - blockers.Ja5hBlocker.name(): blockers.Ja5hBlocker( |
59 | | - config=Ja5Config(file_path=app_config.path_to_ja5h_config), |
| 58 | + blockers.TFhBlocker.name(): blockers.TFhBlocker( |
| 59 | + config=TFConfig(file_path=app_config.path_to_tfh_config), |
60 | 60 | tempesta_executable_path=app_config.tempesta_executable_path, |
61 | 61 | tempesta_config_path=app_config.tempesta_config_path, |
62 | 62 | ), |
|
87 | 87 | block_users_per_iteration=app_config.detector_ip_errors_block_users_per_iteration, |
88 | 88 | allowed_statues=app_config.detector_ip_errors_allowed_statuses, |
89 | 89 | ), |
90 | | - Ja5tRPSDetector.name(): Ja5tRPSDetector( |
| 90 | + TFtRPSDetector.name(): TFtRPSDetector( |
91 | 91 | access_log=clickhouse_client, |
92 | | - default_threshold=app_config.detector_ja5t_rps_default_threshold, |
93 | | - intersection_percent=app_config.detector_ja5t_rps_intersection_percent, |
94 | | - block_users_per_iteration=app_config.detector_ja5t_rps_block_users_per_iteration, |
| 92 | + default_threshold=app_config.detector_tft_rps_default_threshold, |
| 93 | + intersection_percent=app_config.detector_tft_rps_intersection_percent, |
| 94 | + block_users_per_iteration=app_config.detector_tft_rps_block_users_per_iteration, |
95 | 95 | ), |
96 | | - Ja5tAccumulativeTimeDetector.name(): Ja5tAccumulativeTimeDetector( |
| 96 | + TFtAccumulativeTimeDetector.name(): TFtAccumulativeTimeDetector( |
97 | 97 | access_log=clickhouse_client, |
98 | | - default_threshold=app_config.detector_ja5t_time_default_threshold, |
99 | | - intersection_percent=app_config.detector_ja5t_time_intersection_percent, |
100 | | - block_users_per_iteration=app_config.detector_ja5t_time_block_users_per_iteration, |
| 98 | + default_threshold=app_config.detector_tft_time_default_threshold, |
| 99 | + intersection_percent=app_config.detector_tft_time_intersection_percent, |
| 100 | + block_users_per_iteration=app_config.detector_tft_time_block_users_per_iteration, |
101 | 101 | ), |
102 | | - Ja5tErrorRequestDetector.name(): Ja5tErrorRequestDetector( |
| 102 | + TFtErrorRequestDetector.name(): TFtErrorRequestDetector( |
103 | 103 | access_log=clickhouse_client, |
104 | | - default_threshold=app_config.detector_ja5t_errors_default_threshold, |
105 | | - intersection_percent=app_config.detector_ja5t_errors_intersection_percent, |
106 | | - block_users_per_iteration=app_config.detector_ja5t_errors_block_users_per_iteration, |
107 | | - allowed_statues=app_config.detector_ja5t_errors_allowed_statuses, |
| 104 | + default_threshold=app_config.detector_tft_errors_default_threshold, |
| 105 | + intersection_percent=app_config.detector_tft_errors_intersection_percent, |
| 106 | + block_users_per_iteration=app_config.detector_tft_errors_block_users_per_iteration, |
| 107 | + allowed_statues=app_config.detector_tft_errors_allowed_statuses, |
108 | 108 | ), |
109 | | - Ja5hRPSDetector.name(): Ja5hRPSDetector( |
| 109 | + TFhRPSDetector.name(): TFhRPSDetector( |
110 | 110 | access_log=clickhouse_client, |
111 | | - default_threshold=app_config.detector_ja5h_rps_default_threshold, |
112 | | - intersection_percent=app_config.detector_ja5h_rps_intersection_percent, |
113 | | - block_users_per_iteration=app_config.detector_ja5h_rps_block_users_per_iteration, |
| 111 | + default_threshold=app_config.detector_tfh_rps_default_threshold, |
| 112 | + intersection_percent=app_config.detector_tfh_rps_intersection_percent, |
| 113 | + block_users_per_iteration=app_config.detector_tfh_rps_block_users_per_iteration, |
114 | 114 | ), |
115 | | - Ja5hAccumulativeTimeDetector.name(): Ja5hAccumulativeTimeDetector( |
| 115 | + TFhAccumulativeTimeDetector.name(): TFhAccumulativeTimeDetector( |
116 | 116 | access_log=clickhouse_client, |
117 | | - default_threshold=app_config.detector_ja5h_time_default_threshold, |
118 | | - intersection_percent=app_config.detector_ja5h_time_intersection_percent, |
119 | | - block_users_per_iteration=app_config.detector_ja5h_time_block_users_per_iteration, |
| 117 | + default_threshold=app_config.detector_tfh_time_default_threshold, |
| 118 | + intersection_percent=app_config.detector_tfh_time_intersection_percent, |
| 119 | + block_users_per_iteration=app_config.detector_tfh_time_block_users_per_iteration, |
120 | 120 | ), |
121 | | - Ja5hErrorRequestDetector.name(): Ja5tErrorRequestDetector( |
| 121 | + TFhErrorRequestDetector.name(): TFtErrorRequestDetector( |
122 | 122 | access_log=clickhouse_client, |
123 | | - default_threshold=app_config.detector_ja5h_errors_default_threshold, |
124 | | - intersection_percent=app_config.detector_ja5h_errors_intersection_percent, |
125 | | - block_users_per_iteration=app_config.detector_ja5h_errors_block_users_per_iteration, |
126 | | - allowed_statues=app_config.detector_ja5h_errors_allowed_statuses, |
| 123 | + default_threshold=app_config.detector_tfh_errors_default_threshold, |
| 124 | + intersection_percent=app_config.detector_tfh_errors_intersection_percent, |
| 125 | + block_users_per_iteration=app_config.detector_tfh_errors_block_users_per_iteration, |
| 126 | + allowed_statues=app_config.detector_tfh_errors_allowed_statuses, |
127 | 127 | ), |
128 | 128 | GeoIPDetector.name(): GeoIPDetector( |
129 | 129 | access_log=clickhouse_client, |
|
0 commit comments