64 lines
2.8 KiB
Java
64 lines
2.8 KiB
Java
package com.realtime.protection.server.command;
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
|
import com.realtime.protection.configuration.entity.task.FiveTupleWithMask;
|
|
import com.realtime.protection.configuration.entity.task.TaskCommandInfo;
|
|
import com.realtime.protection.configuration.entity.whitelist.WhiteListObject;
|
|
import org.apache.ibatis.annotations.Mapper;
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
|
import java.util.List;
|
|
|
|
@Mapper
|
|
public interface CommandMapper {
|
|
void createCommand(@Param("info") TaskCommandInfo taskCommandInfo);
|
|
|
|
void createCommands(@Param("command_infos") List<TaskCommandInfo> taskCommandInfos);
|
|
|
|
Boolean stopCommandsByTaskId(@Param("task_id") Long taskId);
|
|
|
|
@DS("doris")
|
|
Boolean removeCommandsByTaskId(@Param("task_id") Long taskId);
|
|
|
|
Boolean startCommandsByTaskId(@Param("task_id") Long taskId);
|
|
|
|
Boolean setCommandJudged(@Param("command_id") String commandId,
|
|
@Param("is_judged") Integer isJudged);
|
|
|
|
List<TaskCommandInfo> queryCommandInfos(@Param("task_id") Long taskId,
|
|
@Param("src_ip") String sourceIP,
|
|
@Param("src_port") String sourcePort,
|
|
@Param("dst_ip") String destinationIP,
|
|
@Param("dst_port") String destinationPort,
|
|
@Param("page") Integer page,
|
|
@Param("page_num") Integer pageNum);
|
|
|
|
TaskCommandInfo queryCommandInfoByUUID(@Param("uuid") String uuid);
|
|
|
|
String queryCommandInfo(@Param("command_info") TaskCommandInfo commandInfo);
|
|
|
|
Integer queryCommandTotalNum(@Param("task_id") Long taskId,
|
|
@Param("src_ip") String sourceIP,
|
|
@Param("src_port") String sourcePort,
|
|
@Param("dst_ip") String destinationIP,
|
|
@Param("dst_port") String destinationPort);
|
|
|
|
void createCommandInWhiteListHit(@Param("info") TaskCommandInfo commandInfo);
|
|
|
|
|
|
void updateCommandHistoryExpireTime(@Param("command_id") String commandUUID);
|
|
|
|
void insertCommandHistory(@Param("command_id") String commandUUID);
|
|
|
|
void updateCommandHistoryExpireTimeBatch(@Param("commandIds")List<String> commandIds);
|
|
|
|
void insertCommandHistoryBatch(@Param("commandIds")List<String> commandIds);
|
|
|
|
@DS("mysql")
|
|
List<WhiteListObject> whiteListCommandCheck(@Param("command") FiveTupleWithMask fiveTupleWithMask);
|
|
@DS("mysql")
|
|
void createCommandWhiteListConnect(@Param("command_id") String uuid, @Param("whiteLists") List<WhiteListObject> whiteListsHit);
|
|
|
|
void updateCommandIsJudgedIfIgnoreThisTime(@Param("command_id") String commandUUID);
|
|
}
|