管控策略日志增加字段common_data_center

管控策略统计计数修改
解密流量删除用户自定义判断fata日志
This commit is contained in:
fengweihao
2020-10-23 19:03:08 +08:00
committed by 卢文朋
parent 99731ae689
commit b1c3ba754a
8 changed files with 89 additions and 5 deletions

View File

@@ -2071,7 +2071,6 @@ void enforce_control_policy(const struct tfe_stream * stream, const struct tfe_h
case PG_ACTION_NONE:
break;
case PG_ACTION_MONIT:
ATOMIC_INC(&(g_pangu_rt->stat_val[STAT_ACTION_MONIT]));
//send log on close.
break;
case PG_ACTION_REJECT:
@@ -2407,6 +2406,7 @@ void pangu_on_http_begin(const struct tfe_stream * stream,
}
if (ctx->action == PG_ACTION_WHITELIST)
{
ATOMIC_INC(&(g_pangu_rt->stat_val[STAT_ACTION_WHITELSIT]));
TFE_LOG_INFO(g_pangu_rt->local_logger, "Bypass rules matched on http begin: url=%s policy id=%d.",
session->req->req_spec.url, ctx->enforce_rules[0].config_id);
tfe_http_session_detach(session);
@@ -2422,7 +2422,7 @@ static inline int ctx_actually_replaced(struct pangu_http_ctx * ctx)
if(ctx->action == PG_ACTION_MANIPULATE &&
ctx->param->action == MA_ACTION_REPLACE &&
ctx->n_enforce==1 && ctx->rep_ctx->actually_replaced==1)
ctx->rep_ctx->actually_replaced==1)
{
return 1;
}
@@ -2437,7 +2437,7 @@ static inline int ctx_actually_inserted(struct pangu_http_ctx * ctx)
if(ctx->action == PG_ACTION_MANIPULATE &&
ctx->param->action == MA_ACTION_INSERT &&
ctx->n_enforce==1 && ctx->ins_ctx->actually_inserted==1)
ctx->ins_ctx->actually_inserted==1)
{
return 1;
}
@@ -2452,7 +2452,7 @@ static inline int ctx_actually_manipulate(struct pangu_http_ctx * ctx)
if(ctx->action == PG_ACTION_MANIPULATE &&
(ctx->param->action == MA_ACTION_REDIRECT ||
ctx->param->action == MA_ACTION_HIJACK)&&
ctx->n_enforce==1 && ctx->manipulate_replaced==1)
ctx->manipulate_replaced==1)
{
return 1;
}
@@ -2514,6 +2514,14 @@ void pangu_on_http_end(const struct tfe_stream * stream,
{
ret=pangu_send_log(g_pangu_rt->send_logger, &log_msg);
ATOMIC_ADD(&(g_pangu_rt->stat_val[STAT_LOG_NUM]), ret);
for(i=0; i< ctx->n_enforce; i++)
{
if(ctx->enforce_rules[i].action == PG_ACTION_MONIT)
{
ATOMIC_INC(&(g_pangu_rt->stat_val[STAT_ACTION_MONIT]));
}
}
}
if(ctx->rep_ctx && ctx->rep_ctx->actually_replaced==1 && ctx->enforce_rules[0].do_log ==1)