From 560f72e826e46ac0c1a64159deb787c6f3ec57ab Mon Sep 17 00:00:00 2001 From: PushM <584406942@qq.com> Date: Thu, 30 May 2024 03:34:47 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=91=8A=E8=AD=A6=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E6=94=B6=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/alert/AlertMessage.java | 138 ++++++++++++++++++ .../resources/mappers/AlertMessageMapper.xml | 77 +++++++++- 2 files changed, 213 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/realtime/protection/configuration/entity/alert/AlertMessage.java b/src/main/java/com/realtime/protection/configuration/entity/alert/AlertMessage.java index 89942f8..aad73c3 100644 --- a/src/main/java/com/realtime/protection/configuration/entity/alert/AlertMessage.java +++ b/src/main/java/com/realtime/protection/configuration/entity/alert/AlertMessage.java @@ -5,6 +5,8 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.realtime.protection.configuration.entity.task.FiveTupleWithMask; import lombok.Data; +import java.time.LocalDateTime; + @Data public class AlertMessage { @@ -37,4 +39,140 @@ public class AlertMessage { //1代表防护对象命中告警信息里的是目的ip,0代表防护对象命中告警信息里的是源ip @JsonProperty("protect_object_is_src_dst") private int protectIsSrcOrDst; + + @JsonProperty("c_netnum") + private Integer c_netnum; + @JsonProperty("c_ip") + private Long c_ip; + @JsonProperty("c_inoutid") + private Integer c_inoutid; + @JsonProperty("c_gkid") + private Integer c_gkid; + @JsonProperty("c_provid") + private Integer c_provid; + @JsonProperty("c_event_id") + private Long c_event_id; + @JsonProperty("c_priority") + private Integer c_priority; + @JsonProperty("c_time") + private LocalDateTime c_time; + @JsonProperty("c_flowid") + private String c_flowid; + @JsonProperty("c_src_ipv4") + private Long c_src_ipv4; + @JsonProperty("c_src_ipv6") + private String c_src_ipv6; + @JsonProperty("c_src_port") + private Integer c_src_port; + @JsonProperty("c_s_tunnel_ip") + private Long c_s_tunnel_ip; + @JsonProperty("c_s_tunnel_port") + private Integer c_s_tunnel_port; + @JsonProperty("c_dest_ipv4") + private Long c_dest_ipv4; + @JsonProperty("c_dest_ipv6") + private String c_dest_ipv6; + @JsonProperty("c_dest_port") + private Integer c_dest_port; + @JsonProperty("c_d_tunnel_ip") + private Long c_d_tunnel_ip; + @JsonProperty("c_d_tunnel_port") + private Integer c_d_tunnel_port; + @JsonProperty("c_proto_type") + private Integer c_proto_type; + @JsonProperty("c_return_info") + private String c_return_info; + @JsonProperty("c_s_boundary") + private Long c_s_boundary; + @JsonProperty("c_s_region") + private Long c_s_region; + @JsonProperty("c_s_city") + private Long c_s_city; + @JsonProperty("c_s_district") + private Long c_s_district; + @JsonProperty("c_s_operators") + private Long c_s_operators; + @JsonProperty("c_s_owner") + private String c_s_owner; + @JsonProperty("c_d_boundary") + private Long c_d_boundary; + @JsonProperty("c_d_region") + private Long c_d_region; + @JsonProperty("c_d_city") + private Long c_d_city; + @JsonProperty("c_d_district") + private Long c_d_district; + @JsonProperty("c_d_operators") + private Long c_d_operators; + @JsonProperty("c_d_owner") + private String c_d_owner; + @JsonProperty("c_ret_file_type") + private Integer c_ret_file_type; + @JsonProperty("c_ret_filename") + private String c_ret_filename; + @JsonProperty("c_ret_file") + private String c_ret_file; + @JsonProperty("c_url") + private String c_url; + @JsonProperty("c_s_mark1") + private Long c_s_mark1; + @JsonProperty("c_s_mark2") + private Long c_s_mark2; + @JsonProperty("c_s_mark3") + private Long c_s_mark3; + @JsonProperty("c_s_mark4") + private Long c_s_mark4; + @JsonProperty("c_s_mark5") + private Long c_s_mark5; + @JsonProperty("c_d_mark1") + private Long c_d_mark1; + @JsonProperty("c_d_mark2") + private Long c_d_mark2; + @JsonProperty("c_d_mark3") + private Long c_d_mark3; + @JsonProperty("c_d_mark4") + private Long c_d_mark4; + @JsonProperty("c_d_mark5") + private Long c_d_mark5; +// "c_priority": 0, +// "c_time": 1714528212, +// "c_flowid": "ca0c192021", +// "c_src_ipv4": 1921297587, +// "c_src_ipv6": "fe80::1", +// "c_src_port": 1234, +// "c_s_tunnel_ip": "172.16.0.1", +// "c_s_tunnel_port": 5678, +// "c_dest_ipv4": 310737541, +// "c_dest_ipv6": "fe80::2", +// "c_dest_port": 4321, +// "c_d_tunnel_ip": 0, +// "c_d_tunnel_port": 0, +// "c_proto_type": 6, +// "c_return_info": "r=\\00\\05\\00", +// "c_s_boundary": 2, +// "c_s_region": 510000, +// "c_s_city": 511600, +// "c_s_district": 0, +// "c_s_operators": 2, +// "c_s_owner": "Owner1", +// "c_d_boundary": 2, +// "c_d_region": 530000, +// "c_d_city": 530100, +// "c_d_district": 0, +// "c_d_operators": 2, +// "c_d_owner": "Owner2", +// "c_ret_file_type": 0, +// "c_ret_filename": "example.txt", +// "c_ret_file": "This is a test file.", +// "c_url": "http://example.com", +// "c_s_mark1": 1, +// "c_s_mark2": 0, +// "c_s_mark3": 0, +// "c_s_mark4": 0, +// "c_s_mark5": 0, +// "c_d_mark1": 0, +// "c_d_mark2": 0, +// "c_d_mark3": 0, +// "c_d_mark4": 0, +// "c_d_mark5": 1594 } diff --git a/src/main/resources/mappers/AlertMessageMapper.xml b/src/main/resources/mappers/AlertMessageMapper.xml index 9b22ddd..0f36aef 100644 --- a/src/main/resources/mappers/AlertMessageMapper.xml +++ b/src/main/resources/mappers/AlertMessageMapper.xml @@ -87,7 +87,43 @@ CREATE_TIME, LAST_UPDATE, ALERT_MESSAGE_ID, - CONTENT) + CONTENT, + c_netnum, + c_ip, + c_inoutid, + c_gkid, + c_provid, + c_event_id, + c_priority, + c_time, + c_flowid, + c_s_boundary, + + c_src_ipv6, + c_s_tunnel_ip, + c_s_tunnel_port, + c_dest_ipv6, + c_d_tunnel_ip, + c_d_tunnel_port, + c_des_IPv6, + c_proto_type, +-- c_return_info, + c_s_boundary, + c_s_region, + c_s_city, + c_s_district, + c_s_operators, + c_s_owner, + c_d_boundary, + c_d_region, + c_d_city, + c_d_district, + c_d_operators, + c_d_owner, + c_ret_file_type, + c_ret_file_name, + c_curl + ) values ( #{taskId}, #{dynamicRuleId}, @@ -106,7 +142,44 @@ NOW(), NOW(), UUID(), - #{content}) + #{content}, + #{c_netnum}, + #{c_ip}, + #{c_inoutid}, + #{c_gkid}, + #{c_provid}, + #{c_event_id}, + #{c_priority}, + #{c_time}, + #{c_flowid}, +-- #{c_src_ipv4}, + #{c_src_ipv6}, +-- #{c_src_port}, + #{c_s_tunnel_ip}, + #{c_s_tunnel_port}, +-- #{c_dest_ipv4}, + #{c_dest_ipv6}, +-- #{c_dest_port}, + #{c_d_tunnel_ip}, + #{c_d_tunnel_port}, +-- #{c_proto_type}, +-- #{c_return_info}, + #{c_s_boundary}, + #{c_s_region}, + #{c_s_city}, + #{c_s_district}, + #{c_s_operators}, + #{c_s_owner}, + #{c_d_boundary}, + #{c_d_region}, + #{c_d_city}, + #{c_d_district}, + #{c_d_operators}, + #{c_d_owner}, + #{c_ret_file_type}, + #{c_ret_file_name}, + #{c_curl} + )