diff --git a/platform/src/verify_matcher.cpp b/platform/src/verify_matcher.cpp index a17783e..12669ac 100644 --- a/platform/src/verify_matcher.cpp +++ b/platform/src/verify_matcher.cpp @@ -296,7 +296,7 @@ void attribute_dict_free(struct attribute_dict_ctx *dict_ctx); const char *get_conjunction_table_name(enum policy_rule_type rule_type) { const char *conjunction_table_name_map[] = {"SECURITY_RULE_CONJUNCTION", "PXY_CTRL_RULE_CONJUNCTION", "TRAFFIC_SHAPING_RULE_CONJUNCTION", - "SERVICE_CHAINING_RULE_CONJUNCTION", "PXY_INTERCEPT_RULE_CONJUNCTION","STATISTICS_COMPILE_CONJUNCTION", + "SERVICE_CHAINING_RULE_CONJUNCTION", "PXY_INTERCEPT_RULE_CONJUNCTION","STATISTICS_RULE_CONJUNCTION", "MONITOR_RULE_CONJUNCTION", "DOS_PROTECTION_RULE_CONJUNCTION", "TUNNEL_RULE_CONJUNCTION"}; size_t table_name_map_len = sizeof(conjunction_table_name_map)/sizeof(conjunction_table_name_map[0]); @@ -311,7 +311,7 @@ const char *get_conjunction_table_name(enum policy_rule_type rule_type) const char *get_plugin_table_name(enum policy_rule_type rule_type) { const char *plugin_table_name_map[] = {"SECURITY_RULE_PLUGIN", "PXY_CTRL_RULE_PLUGIN", "TRAFFIC_SHAPING_RULE_PLUGIN", - "SERVICE_CHAINING_RULE_PLUGIN", "PXY_INTERCEPT_RULE_PLUGIN", "STATISTICS_COMPILE_PLUGIN", + "SERVICE_CHAINING_RULE_PLUGIN", "PXY_INTERCEPT_RULE_PLUGIN", "STATISTICS_RULE_PLUGIN", "MONITOR_RULE_PLUGIN", "DOS_PROTECTION_RULE_PLUGIN", "TUNNEL_RULE_PLUGIN"}; size_t table_name_map_len = sizeof(plugin_table_name_map)/sizeof(plugin_table_name_map[0]); @@ -1160,7 +1160,7 @@ int hit_rule_match_is_duplicate(struct maat_hit_path *src, struct maat_hit_path { for(int i = 0; i < result_cnt; i++) { - if(src[i].top_object_uuid == dest.top_object_uuid) + if(uuid_compare(src[i].top_object_uuid, dest.top_object_uuid) == 0) { return 1; } @@ -1262,11 +1262,11 @@ void http_get_scan_status(struct request_object_list *request_object, int compil break; } - if(ctx->hit_path[i].item_uuid < 0) + if( ctx->hit_path[i].negate_option == 1) { continue; } - + histObj=cJSON_CreateObject(); cJSON_AddItemToArray(hitPaths, histObj); cJSON_AddUuidToObject(histObj, "item_uuid", ctx->hit_path[i].item_uuid); @@ -2490,10 +2490,10 @@ int tsg_policy_type_str2idx(const char *action_str) { const char * policy_name[__SCAN_POLICY_MAX]; policy_name[TSG_TABLE_SECURITY] = "security"; - policy_name[PXY_TABLE_MANIPULATION] = "pxy_manipulation"; + policy_name[PXY_TABLE_MANIPULATION] = "proxy_manipulation"; policy_name[TSG_TRAFFIC_SHAPING] = "traffic_shaping"; policy_name[TSG_SERVICE_CHAINGNG] = "service_chaining"; - policy_name[PXY_TABLE_INTERCEPT] = "pxy_intercept"; + policy_name[PXY_TABLE_INTERCEPT] = "proxy_intercept"; policy_name[TSG_STATISTICS] = "statistics"; policy_name[TSG_MONITOR] = "monitor"; policy_name[DOS_PROTECTION] = "dos_protection"; @@ -3048,7 +3048,7 @@ int maat_complie_plugin_table_init(int vsys_id) { int ret=0; const char *plugin_table_name_map[] = {"SECURITY_RULE_PLUGIN", "PXY_CTRL_RULE_PLUGIN", "TRAFFIC_SHAPING_RULE_PLUGIN", - "SERVICE_CHAINING_RULE_PLUGIN", "PXY_INTERCEPT_RULE_PLUGIN", "STATISTICS_COMPILE_PLUGIN", + "SERVICE_CHAINING_RULE_PLUGIN", "PXY_INTERCEPT_RULE_PLUGIN", "STATISTICS_RULE_PLUGIN", "MONITOR_RULE_PLUGIN", "DOS_PROTECTION_RULE_PLUGIN", "TUNNEL_RULE_PLUGIN"}; for(int i = 0; i < PXY_TABLE_DEFENCE; i++) { diff --git a/resource/table_info.conf b/resource/table_info.conf index ce75abb..cb73eef 100644 --- a/resource/table_info.conf +++ b/resource/table_info.conf @@ -111,20 +111,20 @@ }, { "table_id":15, - "table_name":"STATISTICS_COMPILE", + "table_name":"STATISTICS_RULE", "table_type":"rule" }, { "table_id":16, - "table_name":"STATISTICS_COMPILE_CONJUNCTION", - "db_tables":["STATISTICS_COMPILE"], + "table_name":"STATISTICS_RULE_CONJUNCTION", + "db_tables":["STATISTICS_RULE"], "default_rule_table":1, "table_type":"rule" }, { "table_id":17, - "table_name":"STATISTICS_COMPILE_PLUGIN", - "db_tables":["STATISTICS_COMPILE"], + "table_name":"STATISTICS_RULE_PLUGIN", + "db_tables":["STATISTICS_RULE"], "table_type":"plugin", "custom": { "key_name":"uuid", diff --git a/test/resource/HitPolicyRequest.json b/test/resource/HitPolicyRequest.json index 8cdbd8b..85d5aa0 100644 --- a/test/resource/HitPolicyRequest.json +++ b/test/resource/HitPolicyRequest.json @@ -5,7 +5,7 @@ "vsys": 1, "verify_list": [ { - "type": "pxy_manipulation", + "type": "proxy_manipulation", "verify_session": { "attributes": [ { @@ -28,7 +28,7 @@ "vsys": 1, "verify_list": [ { - "type": "pxy_manipulation", + "type": "proxy_manipulation", "verify_session": { "attributes": [ { @@ -147,7 +147,7 @@ "vsys": 1, "verify_list": [ { - "type": "pxy_manipulation", + "type": "proxy_manipulation", "verify_session": { "attributes": [ { @@ -193,7 +193,7 @@ "vsys": 1, "verify_list": [ { - "type": "pxy_manipulation", + "type": "proxy_manipulation", "verify_session": { "attributes": [ { @@ -242,7 +242,7 @@ "vsys": 1, "verify_list": [ { - "type": "pxy_manipulation", + "type": "proxy_manipulation", "verify_session": { "attributes": [ { @@ -282,7 +282,7 @@ "vsys": 1, "verify_list": [ { - "type": "pxy_manipulation", + "type": "proxy_manipulation", "verify_session": { "attributes": [ { @@ -356,7 +356,7 @@ "vsys": 1, "verify_list": [ { - "type": "pxy_manipulation", + "type": "proxy_manipulation", "vsys": 1, "verify_session": { "attributes": [ diff --git a/test/resource/HitPolicyResult.json b/test/resource/HitPolicyResult.json index f2c7a9d..77042ad 100644 --- a/test/resource/HitPolicyResult.json +++ b/test/resource/HitPolicyResult.json @@ -476,10 +476,6 @@ { "item_uuid": "00000000-0000-0000-0000-000000000000", "superior_object_uuid": "00003021-0000-0000-0000-000000000000" - }, - { - "item_uuid": "00000000-0000-0000-0000-000000000000", - "superior_object_uuid": "00003022-0000-0000-0000-000000000000" } ] } diff --git a/test/verify_policy_test.cpp b/test/verify_policy_test.cpp index adc0d90..15ef658 100644 --- a/test/verify_policy_test.cpp +++ b/test/verify_policy_test.cpp @@ -397,6 +397,9 @@ TEST(VerifyPolicy, HitTunnelEndpointaPolicy_1027) char *hit_policy_query = cJSON_PrintUnformatted(result_json); ASSERT_TRUE(hit_policy_query != NULL); + printf("hit_policy_query = %s\n", hit_policy_query); + printf("hit_policy_result = %s\n", hit_policy_result); + int equal = strncasecmp(hit_policy_query+2, hit_policy_result+16, strlen(hit_policy_result)); EXPECT_EQ(equal, 0);