summaryrefslogtreecommitdiff
path: root/plugin/business/tsg-http/src/tsg_logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/business/tsg-http/src/tsg_logger.cpp')
-rw-r--r--plugin/business/tsg-http/src/tsg_logger.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/plugin/business/tsg-http/src/tsg_logger.cpp b/plugin/business/tsg-http/src/tsg_logger.cpp
index 3e25f82..256a5d5 100644
--- a/plugin/business/tsg-http/src/tsg_logger.cpp
+++ b/plugin/business/tsg-http/src/tsg_logger.cpp
@@ -32,15 +32,12 @@ struct proxy_logger
enum _log_action
{
LG_ACTION_NONE = 0,
- LG_ACTION_DENY = 1,
- LG_ACTION_ALLOW = 2,
+ LG_ACTION_ALLOW = 1,
+ LG_ACTION_DENY = 2,
LG_ACTION_MONITOR = 3,
LG_ACTION_REDIRECT = 4,
- LG_ACTION_REPLACE = 5,
- LG_ACTION_HIJACK = 6,
- LG_ACTION_REJECT = 7,
- LG_ACTION_EDIT_ELEMENT = 8,
- LG_ACTION_RUN_SCRIPT = 9,
+ LG_ACTION_EXECUTE = 5,
+ LG_ACTION_MANIPULATE = 6,
__LG_ACTION_MAX
};
@@ -214,7 +211,9 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg)
char dst_ip_str[MAX(INET6_ADDRSTRLEN,INET_ADDRSTRLEN)] = {0};
const char *app_proto[]= {"unkonw","http1", "http2"};
- const char *manipulate_action_map[]= {"none","deny","allow","monitor","redirect","replace","hijack","inject","edit_element","run_script"};
+
+ const char *manipulate_action_map[]= {"replace_text","replace_file","edit_element","inject_javascript","inject_css"};
+ const char *panggu_action_map[] = {"none", "allow", "deny", "monitor", "redirect", "execute", "modify"};
struct json_spec req_fields[]={ {"http_cookie", TFE_HTTP_COOKIE},
{"http_referer", TFE_HTTP_REFERER},
@@ -235,7 +234,7 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg)
gettimeofday(&cur_time, NULL);
cJSON_AddNumberToObject(common_obj, "start_timestamp_ms", get_time_ms(http->start_time));
cJSON_AddNumberToObject(common_obj, "end_timestamp_ms", get_time_ms(cur_time));
-
+
struct tfe_cmsg *cmsg = tfe_stream_get0_cmsg(log_msg->stream);
if (cmsg != NULL)
{
@@ -394,8 +393,16 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg)
}
cJSON_AddItemToObject(per_hit_obj, "proxy_rule_list", proxy_rule_list);
cJSON_AddNumberToObject(per_hit_obj, "vsys_id", log_msg->result[i].vsys_id);
- cJSON_AddStringToObject(per_hit_obj, "proxy_action", manipulate_action_map[log_msg->result[i].action]);
- cJSON_AddNumberToObject(per_hit_obj, "http_action_file_size", log_msg->inject_sz);
+ if(log_msg->result[i].action == LG_ACTION_MANIPULATE)
+ {
+ cJSON_AddStringToObject(per_hit_obj, "proxy_action", manipulate_action_map[log_msg->action]);
+ cJSON_AddNumberToObject(per_hit_obj, "http_action_file_size", log_msg->inject_sz);
+ }
+ else
+ {
+ cJSON_AddStringToObject(per_hit_obj, "proxy_action", panggu_action_map[(unsigned char)(log_msg->result[i].action)]);
+ }
+
log_payload = cJSON_PrintUnformatted(per_hit_obj);
TFE_LOG_DEBUG(handle->local_logger, "%s", log_payload);