TSG-23454 Add key scan in http request header and response header.

TSG-23455 Change profile_name to content_name in Replace File policy.
TSG-23424 Change tsg_policy_id to tsg_policy_uuid in Redirect policy.
This commit is contained in:
fengweihao
2024-11-07 16:13:55 +08:00
parent d4d76f0951
commit ec75b72bd9
2 changed files with 19 additions and 6 deletions

View File

@@ -965,7 +965,7 @@ void ma_hijack_profile_table_new_cb(const char *table_name, const char* key, con
{
ply_profile->profile_uuid = tfe_strdup(uuid->valuestring);
}
cJSON *profile_name = cJSON_GetObjectItem(hihijack_files, "profile_name");
cJSON *profile_name = cJSON_GetObjectItem(hihijack_files, "content_name");
if(profile_name && profile_name->type==cJSON_String)
{
ply_profile->profile_name=tfe_strdup(profile_name->valuestring);
@@ -2214,10 +2214,10 @@ static int http_regex_replace(const struct tfe_stream * stream, char *message, c
return 0;
}
if(strcasestr(message,"{{tsg_policy_id}}") != NULL)
if(strcasestr(message,"{{tsg_policy_uuid}}") != NULL)
{
rule[n_rule].zone = kZoneRequestUri;
rule[n_rule].find = tfe_strdup("{{tsg_policy_id}}");
rule[n_rule].find = tfe_strdup("{{tsg_policy_uuid}}");
snprintf(replace_with, TFE_SYMBOL_MAX, "%s", profile_id_str);
rule[n_rule].replace_with = tfe_strdup(replace_with);
n_rule++;
@@ -2892,6 +2892,19 @@ enum proxy_action http_scan(const struct tfe_http_session * session, enum tfe_ht
{
hit_cnt += n_hit_result;
}
const char * str_field_name = http_field_name_to_string(&field_name);
if(str_field_name == NULL)
{
break;
}
scan_ret = maat_scan_string(g_proxy_rt->feather, "TSG_OBJ_KEYWORD", attribute_name, str_field_name, strlen(str_field_name),
result + hit_cnt, MAX_SCAN_RESULT - hit_cnt, &n_hit_result, ctx->scan_mid);
if (scan_ret == MAAT_SCAN_HIT)
{
hit_cnt += n_hit_result;
}
}
scan_ret = maat_scan_not_logic(g_proxy_rt->feather, "TSG_OBJ_KEYWORD", attribute_name, result + hit_cnt, MAX_SCAN_RESULT - hit_cnt,
&n_hit_result, ctx->scan_mid);