1、修复防护对象按id、ids查询返回ip不正确问题。

2、指令入库增加写入RULE_NAME字段
This commit is contained in:
PushM
2024-06-11 00:39:28 +08:00
parent 1edea5b31a
commit b1a211630a
6 changed files with 23 additions and 9 deletions

View File

@@ -118,6 +118,9 @@ public class TaskCommandInfo {
@Schema(description = "指令展示id", accessMode = Schema.AccessMode.READ_ONLY)
private String displayId;
@Schema(description = "规则名称", accessMode = Schema.AccessMode.READ_ONLY)
private String ruleName;
// 复制构造函数
public void copyTaskCommandInfo(TaskCommandInfo original) {
this.UUID = original.UUID;
@@ -144,6 +147,7 @@ public class TaskCommandInfo {
this.templateId = original.templateId;
this.protectLevel = original.protectLevel;
this.taskStatus = original.taskStatus;
this.ruleName = original.ruleName;
}
public void setProtocolNum() {

View File

@@ -34,6 +34,7 @@ public class AuditAdvice implements ResponseBodyAdvice<ResponseResult> {
private final WebClient webClient = WebClient
.builder()
.baseUrl("http://39.105.210.156:8090/chanct-log/audit-xgs")
// .baseUrl("http://10.58.44.241:1888/api/chanct-log/audit-xgs")
.build();
@Data

View File

@@ -26,6 +26,8 @@
<result column="dynamic_rule_protect_level" property="protectLevel"/>
<result column="task_status" property="taskStatus"/>
<result column="dynamic_rule_name" property="ruleName"/>
</resultMap>
<resultMap id="protectLevelMap" type="com.realtime.protection.configuration.entity.defense.template.ProtectLevel">
<!-- <id column="protect_level_id" property="protectLevelId"/>-->
@@ -238,8 +240,9 @@
t_task.task_range,
t_task.protect_level,
t_task.task_status,
t_task.event_type
t_task.event_type,
-- t_tmplate.strategy_template_name
t_dr.dynamic_rule_name
from t_task
left join realtime_protection.t_dynamic_rule t_dr on

View File

@@ -9,7 +9,7 @@
MASK_SRC_IP, MASK_SRC_PORT, MASK_DST_IP, MASK_DST_PORT, MASK_PROTOCOL, VALID_TIME,
INVALID_TIME, IS_VALID, IS_JUDGED,
SEND_TIMES, SUCCESS_TIMES, CREATE_TIME, LAST_UPDATE, IS_DELETED,
TASKTYPE, RULE_ID, display_id)
TASKTYPE, RULE_ID, display_id,RULE_NAME)
values (#{info.UUID}, #{info.taskId}, #{info.taskAct}, #{info.taskName}, #{info.eventType}, #{info.taskCreateDepart}, #{info.distributePoint},
#{info.frequency},
DEFAULT,
@@ -22,7 +22,8 @@
#{info.startTime}, #{info.endTime}, #{info.isValid},
#{info.isJudged},
0, 0,
NOW(), NOW(), FALSE, #{info.taskType}, #{info.ruleId}, #{info.displayId}
NOW(), NOW(), FALSE, #{info.taskType}, #{info.ruleId}, #{info.displayId},
#{info.ruleName}
)
</insert>
@@ -33,7 +34,7 @@
MASK_SRC_IP, MASK_SRC_PORT, MASK_DST_IP, MASK_DST_PORT, MASK_PROTOCOL, VALID_TIME, INVALID_TIME, IS_VALID,
IS_JUDGED,
SEND_TIMES, SUCCESS_TIMES, CREATE_TIME, LAST_UPDATE, IS_DELETED,
TASKTYPE, RULE_ID, display_id)
TASKTYPE, RULE_ID, display_id,RULE_NAME)
values
<foreach collection="command_infos" item="info" separator=",">
(#{info.UUID}, #{info.taskId}, #{info.taskAct}, #{info.taskName}, #{info.eventType}, #{info.taskCreateDepart}, #{info.distributePoint},
@@ -48,7 +49,8 @@
#{info.startTime}, #{info.endTime}, #{info.isValid},
#{info.isJudged},
0, 0,
NOW(), NOW(), FALSE, #{info.taskType}, #{info.ruleId}, #{info.displayId}
NOW(), NOW(), FALSE, #{info.taskType}, #{info.ruleId}, #{info.displayId},
#{info.ruleName}
)
</foreach>
</insert>

View File

@@ -203,7 +203,7 @@
SELECT protect_object_id,
protect_object_name,
protect_object_system_name,
INET_NTOA(protect_object_ip) as protect_object_ip,
INET_NTOA(protect_object_ip) as protect_object_ip_d,
protect_object_port,
protect_object_url,
protect_object_protocol,
@@ -278,7 +278,8 @@
WHERE protect_object_id = #{proobj_id}
</select>
<select id="queryHistory" resultMap="protectObjectMap">
SELECT *
SELECT *,
INET_NTOA(protect_object_ip) as protect_object_ip_d
FROM t_protect_object_status_log
WHERE protect_object_id = #{id}
ORDER BY effective_time DESC
@@ -286,7 +287,8 @@
</select>
<select id="queryProtectObjectByIds"
resultMap="protectObjectMap">
SELECT *
SELECT *,
INET_NTOA(protect_object_ip) as protect_object_ip_d
FROM t_protect_object
WHERE protect_object_id IN
<foreach collection="protectObjectIds" item="id" open="(" separator="," close=")">

View File

@@ -332,6 +332,7 @@
<result column="task_start_time" property="startTime"/>
<result column="task_end_time" property="endTime"/>
<result column="event_type" property="eventType"/>
<result column="static_rule_name" property="ruleName"/>
<association property="fiveTupleWithMask">
<result column="addr_type" property="addrType"/>
@@ -511,7 +512,8 @@
tsr.static_rule_msport,
INET_NTOA(tsr.static_rule_mdip) as static_rule_mdip,
tsr.static_rule_mdport,
tsr.static_rule_mprotocol
tsr.static_rule_mprotocol,
tsr.static_rule_name
FROM t_task
LEFT JOIN realtime_protection.t_static_rule tsr on t_task.task_id = tsr.static_rule_used_task_id
WHERE task_id = #{task_id}