AlertMessage:

1、alertmessage添加is_distribute(待删除)、command_uuid、create_time、modify_time、alert_message_uuid属性。
2、AlertMessageController添加queryAlarmsByCommandId方法,根据commandUUID查询alertmessage
3、AlertMessageMapper添加新建、查询alertmessage
4、service重写处理alertmessage逻辑,现在alertmessage的isdistribute不需要了,需要删除
Command:
1、service添加updateCommandVaid方法,用于对研判后任务生成的指令研判下发
Task:
1、TaskCommandInfo类添加taskStatus,减少AlertMessageService的查询,并做了标注
2、Controller添加研判后任务下发指令\停止指令的方法validCommandInfoByTaskId
StaticRule、DynamicRule、WhiteList:
1、添加分页查询返回数据总数
This commit is contained in:
Hao Miao
2024-01-21 00:51:10 +08:00
parent 073dfc9ba4
commit 44abfe096c
24 changed files with 389 additions and 51 deletions

View File

@@ -0,0 +1,45 @@
package com.realtime.protection.server.alertmessage;
import com.realtime.protection.configuration.entity.rule.dynamicrule.AlertMessage;
import com.realtime.protection.configuration.entity.task.FiveTupleWithMask;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class AlertMessageTest {
private final AlertMessageService alertMessageService;
@Autowired
public AlertMessageTest(AlertMessageService alertMessageService) {
this.alertMessageService = alertMessageService;
}
@Test
void testReceiveAlertMessage() {
for (int i = 1; i < 10; i++) {
AlertMessage alertMessage = new AlertMessage();
FiveTupleWithMask fiveTupleWithMask = new FiveTupleWithMask();
fiveTupleWithMask.setSourceIP("1.1.1." + i);
fiveTupleWithMask.setMaskSourceIP("255.255.255.0");
fiveTupleWithMask.setDestinationIP("2.2.3.4");
fiveTupleWithMask.setMaskDestinationIP("255.255.255.255");
fiveTupleWithMask.setSourcePort("80");
fiveTupleWithMask.setDestinationPort("80");
fiveTupleWithMask.setProtocol("TCP");
alertMessage.setTaskId(1937L);
alertMessage.setFiveTupleWithMask(fiveTupleWithMask);
alertMessage.setDynamicRuleId(31);
alertMessageService.processAlertMessage(alertMessage);
}
}
@Test
void queryAlertMessageByCommandId() {
// String commandId = "3e2fde7c-cd91-41f3-aedf-bd9993a61737";
//
// System.out.println(alertMessageService.queryAlarmsByCommandId(commandId));
}
}