TSG-17512 Proxy适配Maat4关于compile表特性变更
This commit is contained in:
@@ -152,7 +152,7 @@ static void doh_get_cheat_data(long long p_result, int qtype, struct doh_ctx *ct
|
||||
cJSON *answer_array = NULL;
|
||||
int table_id=0;
|
||||
|
||||
table_id=maat_get_table_id(g_doh_conf->maat, "PXY_CTRL_COMPILE");
|
||||
table_id=maat_get_table_id(g_doh_conf->maat, "PXY_CTRL_COMPILE_PLUGIN");
|
||||
if(table_id < 0)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -174,7 +174,7 @@ struct tsg_proxy_rt
|
||||
Ratelimiter_handle_t ratelimiter;
|
||||
int enable_rate;
|
||||
|
||||
int ctrl_compile_idx;
|
||||
int ctrl_plugin_idx;
|
||||
int ca_store_reseting;
|
||||
int enable_plugin;
|
||||
};
|
||||
@@ -1037,8 +1037,8 @@ int proxy_policy_init(const char* profile_path, const char* static_section, cons
|
||||
}
|
||||
}
|
||||
|
||||
g_proxy_rt->ctrl_compile_idx=maat_get_table_id(g_proxy_rt->feather, "PXY_CTRL_COMPILE");
|
||||
maat_plugin_table_ex_schema_register(g_proxy_rt->feather, "PXY_CTRL_COMPILE",
|
||||
g_proxy_rt->ctrl_plugin_idx=maat_get_table_id(g_proxy_rt->feather, "PXY_CTRL_COMPILE_PLUGIN");
|
||||
maat_plugin_table_ex_schema_register(g_proxy_rt->feather, "PXY_CTRL_COMPILE_PLUGIN",
|
||||
policy_action_param_new,
|
||||
policy_action_param_free_cb,
|
||||
policy_action_param_dup,
|
||||
@@ -1499,7 +1499,7 @@ static enum proxy_action decide_ctrl_action(long long *results, size_t n_hit,
|
||||
hit_rules=ALLOC(struct maat_rule_t, n_hit);
|
||||
for (i = 0; i < n_hit && i<MAX_SCAN_RESULT; i++)
|
||||
{
|
||||
get_ex_param =(struct policy_action_param *)maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_compile_idx, (const char *)&results[i], sizeof(results[i]));
|
||||
get_ex_param =(struct policy_action_param *)maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_plugin_idx, (const char *)&results[i], sizeof(results[i]));
|
||||
if(get_ex_param==NULL)
|
||||
{
|
||||
continue;
|
||||
@@ -1548,7 +1548,7 @@ static enum proxy_action decide_ctrl_action(long long *results, size_t n_hit,
|
||||
}
|
||||
*enforce_rules[0]=*prior_rule;
|
||||
*n_enforce=1;
|
||||
ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_compile_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id));
|
||||
ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_plugin_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id));
|
||||
if(ex_data!=NULL)
|
||||
{
|
||||
*param=(struct policy_action_param*)ex_data;
|
||||
@@ -1582,7 +1582,7 @@ static enum proxy_action decide_ctrl_action(long long *results, size_t n_hit,
|
||||
memcpy(*enforce_rules + exist_enforce_num + 1, monit_rule, n_monit * sizeof(struct maat_rule_t));
|
||||
}
|
||||
|
||||
ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_compile_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id));
|
||||
ex_data=maat_plugin_table_get_ex_data(g_proxy_rt->feather, g_proxy_rt->ctrl_plugin_idx, (const char *)&prior_rule->config_id, sizeof(prior_rule->config_id));
|
||||
if(ex_data!=NULL)
|
||||
{
|
||||
*param=(struct policy_action_param*)ex_data;
|
||||
|
||||
@@ -784,10 +784,10 @@ struct cache_handle* create_web_cache_handle(const char* profile_path, const cha
|
||||
|
||||
if(cache->cache_policy_enabled)
|
||||
{
|
||||
cache->cache_param_idx=maat_get_table_id(feather, "PXY_CACHE_COMPILE");
|
||||
cache->cache_param_idx=maat_get_table_id(feather, "PXY_CACHE_COMPILE_PLUGIN");
|
||||
cache->table_url_constraint=maat_get_table_id(feather, "PXY_CACHE_HTTP_URL");
|
||||
cache->table_cookie_constraint=maat_get_table_id(feather, "PXY_CACHE_HTTP_COOKIE");
|
||||
cache->cache_param_idx=maat_plugin_table_ex_schema_register(feather, "PXY_CACHE_COMPILE",
|
||||
cache->cache_param_idx=maat_plugin_table_ex_schema_register(feather, "PXY_CACHE_COMPILE_PLUGIN",
|
||||
cache_param_new, cache_param_free, cache_param_dup,
|
||||
0, cache);
|
||||
cache->ref_feather=feather;
|
||||
|
||||
@@ -7,21 +7,41 @@
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"service_id":2,
|
||||
"action":3,
|
||||
"do_blacklist":4,
|
||||
"do_log":5,
|
||||
"tags":6,
|
||||
"user_region":7,
|
||||
"clause_num":9,
|
||||
"evaluation_order":10
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":1,
|
||||
"table_name":"PXY_CTRL_COMPILE_CONJUNCTION",
|
||||
"db_tables":["PXY_CTRL_COMPILE"],
|
||||
"default_compile_table":1,
|
||||
"table_type":"compile",
|
||||
"user_region_encoded":"escape",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":2,
|
||||
"table_name":"PXY_CTRL_COMPILE_PLUGIN",
|
||||
"db_tables":["PXY_CTRL_COMPILE"],
|
||||
"table_type":"plugin",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"key":1,
|
||||
"key_type":"integer",
|
||||
"key_len": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":3,
|
||||
"table_name":"GROUP_PXY_CTRL_COMPILE_RELATION",
|
||||
"table_type":"group2compile",
|
||||
"associated_compile_table_id":0,
|
||||
"associated_compile_table_id":1,
|
||||
"valid_column":3,
|
||||
"custom": {
|
||||
"group_id":1,
|
||||
@@ -32,7 +52,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":2,
|
||||
"table_id":4,
|
||||
"table_name":"GROUP_GROUP_RELATION",
|
||||
"table_type":"group2group",
|
||||
"valid_column":4,
|
||||
@@ -43,7 +63,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":3,
|
||||
"table_id":5,
|
||||
"table_name":"TSG_OBJ_IP",
|
||||
"db_tables":["TSG_OBJ_IP_ADDR","TSG_OBJ_IP_LEARNING_ADDR"],
|
||||
"table_type":"ip_plus",
|
||||
@@ -62,7 +82,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":4,
|
||||
"table_id":6,
|
||||
"table_name":"TSG_OBJ_URL",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -76,13 +96,13 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":5,
|
||||
"table_id":7,
|
||||
"table_name":"TSG_FIELD_HTTP_URL",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_URL"
|
||||
},
|
||||
{
|
||||
"table_id":6,
|
||||
"table_id":8,
|
||||
"table_name":"TSG_OBJ_FQDN",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -96,7 +116,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":7,
|
||||
"table_id":9,
|
||||
"table_name":"TSG_OBJ_FQDN_CAT",
|
||||
"table_type":"intval",
|
||||
"valid_column":5,
|
||||
@@ -108,19 +128,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":8,
|
||||
"table_id":10,
|
||||
"table_name":"TSG_FIELD_HTTP_HOST",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_FQDN"
|
||||
},
|
||||
{
|
||||
"table_id":9,
|
||||
"table_id":11,
|
||||
"table_name":"TSG_FIELD_HTTP_HOST_CAT",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_FQDN_CAT"
|
||||
},
|
||||
{
|
||||
"table_id":10,
|
||||
"table_id":12,
|
||||
"table_name":"TSG_OBJ_HTTP_SIGNATURE",
|
||||
"table_type":"expr_plus",
|
||||
"valid_column":8,
|
||||
@@ -135,19 +155,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":11,
|
||||
"table_id":13,
|
||||
"table_name":"TSG_FIELD_HTTP_REQ_HDR",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_HTTP_SIGNATURE"
|
||||
},
|
||||
{
|
||||
"table_id":12,
|
||||
"table_id":14,
|
||||
"table_name":"TSG_FIELD_HTTP_RES_HDR",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_HTTP_SIGNATURE"
|
||||
},
|
||||
{
|
||||
"table_id":13,
|
||||
"table_id":15,
|
||||
"table_name":"TSG_OBJ_KEYWORDS",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -161,19 +181,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":14,
|
||||
"table_id":16,
|
||||
"table_name":"TSG_FIELD_HTTP_REQ_BODY",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_KEYWORDS"
|
||||
},
|
||||
{
|
||||
"table_id":15,
|
||||
"table_id":17,
|
||||
"table_name":"TSG_FIELD_HTTP_RES_BODY",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_KEYWORDS"
|
||||
},
|
||||
{
|
||||
"table_id":16,
|
||||
"table_id":18,
|
||||
"table_name":"TSG_OBJ_SUBSCRIBER_ID",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -187,7 +207,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":17,
|
||||
"table_id":19,
|
||||
"table_name":"TSG_OBJ_APP_ID",
|
||||
"table_type":"intval",
|
||||
"valid_column":5,
|
||||
@@ -199,37 +219,57 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":18,
|
||||
"table_id":20,
|
||||
"table_name":"TSG_SECURITY_SOURCE_ADDR",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_IP"
|
||||
},
|
||||
{
|
||||
"table_id":19,
|
||||
"table_id":21,
|
||||
"table_name":"TSG_SECURITY_DESTINATION_ADDR",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_IP"
|
||||
},
|
||||
{
|
||||
"table_id":20,
|
||||
"table_id":22,
|
||||
"table_name":"PXY_CACHE_COMPILE",
|
||||
"table_type":"compile",
|
||||
"user_region_encoded":"escape",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"service_id":2,
|
||||
"action":3,
|
||||
"do_blacklist":4,
|
||||
"do_log":5,
|
||||
"tags":6,
|
||||
"user_region":7,
|
||||
"clause_num":9,
|
||||
"evaluation_order":10
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":21,
|
||||
"table_id":23,
|
||||
"table_name":"PXY_CACHE_COMPILE_CONJUNCTION",
|
||||
"db_tables":["PXY_CACHE_COMPILE"],
|
||||
"default_compile_table":1,
|
||||
"table_type":"compile",
|
||||
"user_region_encoded":"escape",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"compile_id":1,
|
||||
"tags":6,
|
||||
"clause_num":9
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":24,
|
||||
"table_name":"PXY_CACHE_COMPILE_PLUGIN",
|
||||
"db_tables":["PXY_CACHE_COMPILE"],
|
||||
"table_type":"plugin",
|
||||
"valid_column":8,
|
||||
"custom": {
|
||||
"key":1,
|
||||
"key_type":"integer",
|
||||
"key_len": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":25,
|
||||
"table_name":"PXY_CACHE_GROUP",
|
||||
"table_type":"group2compile",
|
||||
"associated_compile_table_id":0,
|
||||
@@ -243,7 +283,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":22,
|
||||
"table_id":26,
|
||||
"table_name":"PXY_CACHE_HTTP_URL",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -257,7 +297,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":23,
|
||||
"table_id":27,
|
||||
"table_name":"PXY_CACHE_HTTP_COOKIE",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -271,7 +311,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":24,
|
||||
"table_id":28,
|
||||
"table_name":"PXY_PROFILE_TRUSTED_CA_CERT",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
@@ -282,7 +322,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":25,
|
||||
"table_id":29,
|
||||
"table_name":"PXY_OBJ_TRUSTED_CA_CRL",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
@@ -293,7 +333,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":26,
|
||||
"table_id":30,
|
||||
"table_name":"TSG_PROFILE_RESPONSE_PAGES",
|
||||
"table_type":"plugin",
|
||||
"valid_column":5,
|
||||
@@ -304,7 +344,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":27,
|
||||
"table_id":31,
|
||||
"table_name":"PXY_PROFILE_HIJACK_FILES",
|
||||
"table_type":"plugin",
|
||||
"valid_column":6,
|
||||
@@ -315,7 +355,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":28,
|
||||
"table_id":32,
|
||||
"table_name":"PXY_PROFILE_INSERT_SCRIPTS",
|
||||
"table_type":"plugin",
|
||||
"valid_column":6,
|
||||
@@ -326,7 +366,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":29,
|
||||
"table_id":33,
|
||||
"table_name":"PXY_INTERCEPT_COMPILE",
|
||||
"table_type":"plugin",
|
||||
"valid_column":8,
|
||||
@@ -336,7 +376,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":30,
|
||||
"table_id":34,
|
||||
"table_name":"TSG_PROFILE_TRAFFIC_MIRROR",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
@@ -346,7 +386,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":31,
|
||||
"table_id":35,
|
||||
"table_name":"PXY_PROFILE_DECRYPTION",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
@@ -356,7 +396,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":32,
|
||||
"table_id":36,
|
||||
"table_name":"TSG_OBJ_AS_NUMBER",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -370,19 +410,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":33,
|
||||
"table_id":37,
|
||||
"table_name":"TSG_SECURITY_SOURCE_ASN",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_AS_NUMBER"
|
||||
},
|
||||
{
|
||||
"table_id":34,
|
||||
"table_id":38,
|
||||
"table_name":"TSG_SECURITY_DESTINATION_ASN",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_AS_NUMBER"
|
||||
},
|
||||
{
|
||||
"table_id":35,
|
||||
"table_id":39,
|
||||
"table_name":"TSG_OBJ_GEO_LOCATION",
|
||||
"table_type":"expr",
|
||||
"valid_column":7,
|
||||
@@ -396,37 +436,37 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":36,
|
||||
"table_id":40,
|
||||
"table_name":"TSG_SECURITY_SOURCE_LOCATION",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_GEO_LOCATION"
|
||||
},
|
||||
{
|
||||
"table_id":37,
|
||||
"table_id":41,
|
||||
"table_name":"TSG_SECURITY_DESTINATION_LOCATION",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_GEO_LOCATION"
|
||||
},
|
||||
{
|
||||
"table_id":38,
|
||||
"table_id":42,
|
||||
"table_name":"TSG_FIELD_DOH_QNAME",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_FQDN"
|
||||
},
|
||||
{
|
||||
"table_id":39,
|
||||
"table_id":43,
|
||||
"table_name":"TSG_FIELD_DOH_HOST",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_FQDN"
|
||||
},
|
||||
{
|
||||
"table_id":40,
|
||||
"table_id":44,
|
||||
"table_name":"TSG_FIELD_DOH_HOST_CAT",
|
||||
"table_type":"virtual",
|
||||
"physical_table": "TSG_OBJ_FQDN_CAT"
|
||||
},
|
||||
{
|
||||
"table_id":41,
|
||||
"table_id":45,
|
||||
"table_name":"PXY_SSL_FINGERPRINT",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
@@ -436,7 +476,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":42,
|
||||
"table_id":46,
|
||||
"table_name":"PXY_PROFILE_RUN_SCRIPTS",
|
||||
"table_type":"plugin",
|
||||
"valid_column":4,
|
||||
@@ -447,7 +487,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":43,
|
||||
"table_id":47,
|
||||
"table_name":"PXY_PROFILE_TCP_OPTION",
|
||||
"table_type":"plugin",
|
||||
"valid_column":6,
|
||||
@@ -457,7 +497,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"table_id":44,
|
||||
"table_id":48,
|
||||
"table_name":"SERVICE_CHAINING_COMPILE",
|
||||
"table_type":"plugin",
|
||||
"valid_column":8,
|
||||
|
||||
Reference in New Issue
Block a user