From f234ad19c0d52c9df4f52f8598f5a987a4a4af28 Mon Sep 17 00:00:00 2001 From: fengweihao Date: Fri, 14 May 2021 14:36:33 +0800 Subject: [PATCH] =?UTF-8?q?TSG-6314=20=E5=A4=9A=E5=91=BD=E4=B8=AD=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=E8=BF=94=E5=9B=9E=E5=91=BD=E4=B8=AD=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E4=B8=AD=E5=AF=B9=E8=B1=A1id=E9=87=8D=E5=A4=8D=20TSG-?= =?UTF-8?q?6341=20=E6=9C=8D=E5=8A=A1=E5=88=86=E7=B1=BB=E5=88=92=E5=88=86?= =?UTF-8?q?=E5=86=85=E7=BD=AE=E5=92=8C=E7=94=A8=E6=88=B7=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E8=A1=A8=E5=90=8D=E5=86=99=E5=8F=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scan/src/policy_scan.cpp | 44 ++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/scan/src/policy_scan.cpp b/scan/src/policy_scan.cpp index 1eae824..2193389 100644 --- a/scan/src/policy_scan.cpp +++ b/scan/src/policy_scan.cpp @@ -335,8 +335,8 @@ const char *table_name_map[] = {"TSG_IP_ASN_USER_DEFINED", "TSG_IP_ASN_BUILT_IN", "TSG_IP_LOCATION_USER_DEFINED", "TSG_IP_LOCATION_BUILT_IN", - "TSG_FQDN_CATEGORY_BUILT_IN", - "TSG_FQDN_CATEGORY_USER_DEFINED"}; + "TSG_FQDN_CATEGORY_USER_DEFINED", + "TSG_FQDN_CATEGORY_BUILT_IN"}; int maat_fqdn_cat_table_init(int profile_idx, Maat_plugin_EX_new_func_t* new_func, @@ -659,9 +659,26 @@ void http_get_location_status(cJSON *attributes, cJSON *attributeObj, struct ip_ return; } + +/*In the case of multiple hits, the hit path is append behavior to obtain the last hit path force***/ +int http_hit_policy_match(int result_config[], int cnt, int config) +{ + int i = 0; + + for(i=0; inth_scan[j] == ctx->hit_path[i].Nth_scan) { + if(http_hit_policy_match(result_hit_nth, k, ctx->hit_path[i].compile_id)) + { + continue; + } + histObj=cJSON_CreateObject(); cJSON_AddItemToArray(hitPaths, histObj); cJSON_AddNumberToObject(histObj, "itemId", ctx->hit_path[i].region_id); @@ -690,6 +712,8 @@ void http_get_scan_status(struct verify_policy_query_obj *query_obj, int type, c cJSON_AddNumberToObject(histObj, "topObjectId", ctx->hit_path[i].top_group_id); if(ctx->hit_path[i].compile_id > 0) { + result_hit_nth[k] = ctx->hit_path[i].compile_id; + k++; cJSON_AddNumberToObject(histObj, "policyId", ctx->hit_path[i].compile_id); } } @@ -700,20 +724,6 @@ void http_get_scan_status(struct verify_policy_query_obj *query_obj, int type, c http_get_fqdn_cat_id(query_obj, type, attributeObj); } -int http_hit_policy_match(int result_config[], int cnt, int config) -{ - int i = 0; - - for(i=0; i