From e47217fe60cebaed42ad723d31f52eed2c7ec343 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Tue, 29 Mar 2022 15:19:07 +0800 Subject: [PATCH] =?UTF-8?q?TSG-10101:=20=E5=A2=9E=E5=8A=A0tamper=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=85=B3=EF=BC=8C=E9=BB=98=E8=AE=A4=E5=85=B3?= =?UTF-8?q?=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_action.cpp | 6 ++++++ src/tsg_entry.cpp | 2 ++ src/tsg_entry.h | 1 + 3 files changed, 9 insertions(+) diff --git a/src/tsg_action.cpp b/src/tsg_action.cpp index c300851..276e25e 100644 --- a/src/tsg_action.cpp +++ b/src/tsg_action.cpp @@ -576,6 +576,12 @@ static unsigned char do_action_drop(const struct streaminfo *a_stream, Maat_rule static unsigned char do_action_tamper(const struct streaminfo *a_stream, Maat_rule_t *p_result, struct compile_user_region *user_region, tsg_protocol_t protocol, const void *user_data) { + if(g_tsg_para.feature_tamper==0) + { + do_action_drop(a_stream, p_result, user_region, protocol, user_data); + return STATE_DROPME|STATE_DROPPKT; + } + if(user_region==NULL) { return do_action_drop(a_stream, p_result, user_region, protocol, user_data); diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index d580059..0b33f3e 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -2172,6 +2172,8 @@ extern "C" int TSG_MASTER_INIT() MESA_load_profile_short_def(tsg_conffile, "SYSTEM", "TIMEOUT", (short *)&g_tsg_para.timeout, 300); MESA_load_profile_int_def(tsg_conffile, "SYSTEM", "SCAN_TIME_INTERVAL", &g_tsg_para.scan_time_interval, 120); MESA_load_profile_int_def(tsg_conffile, "SYSTEM", "IENTIFY_APP_MAX_PKT_NUM", &g_tsg_para.identify_app_max_pkt_num, 20); + + MESA_load_profile_int_def(tsg_conffile, "SYSTEM", "FEATURE_TAMPER", &g_tsg_para.feature_tamper, 0); ret=MESA_load_profile_int_def(tsg_conffile, "SYSTEM", "DEVICE_SEQ_IN_DATA_CENTER", &g_tsg_para.device_seq_in_dc, 0); if(ret<0) diff --git a/src/tsg_entry.h b/src/tsg_entry.h index 710a567..739ba0e 100644 --- a/src/tsg_entry.h +++ b/src/tsg_entry.h @@ -282,6 +282,7 @@ typedef struct tsg_para int datacenter_id; int hash_timeout; int hash_slot_size; + int feature_tamper; enum DEPLOY_MODE deploy_mode; int scan_time_interval; int identify_app_max_pkt_num;