diff --git a/load_springboot.sh b/load_springboot.sh index 81c697d..50fd369 100644 --- a/load_springboot.sh +++ b/load_springboot.sh @@ -18,5 +18,6 @@ docker build -t protection_springboot -f realtime_protection/docker-springboot/D echo "============built backend servers============" # 使用privileged模式,在中心部署时不会遭遇Java内存异常错误 -docker run --privileged -itd --name springboot_backend -p 8081:8081 protection_springboot +#增加-v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone,使容器时间与宿主机时间一致 +docker run -v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone --privileged -itd --name springboot_backend -p 8081:8081 protection_springboot echo "============started backend servers============" \ No newline at end of file diff --git a/src/main/java/com/realtime/protection/server/task/TaskService.java b/src/main/java/com/realtime/protection/server/task/TaskService.java index e951953..fd02677 100644 --- a/src/main/java/com/realtime/protection/server/task/TaskService.java +++ b/src/main/java/com/realtime/protection/server/task/TaskService.java @@ -281,6 +281,7 @@ public class TaskService { @Transactional public Boolean updateTask(Task task) { + //未审核不能修改 if (!Objects.equals(taskMapper.queryTaskAuditStatus(task.getTaskId()), AuditStatusEnum.AUDITED.getNum())) { return false; } @@ -368,7 +369,8 @@ public class TaskService { List staticCommandInfos = taskMapper.getStaticCommandInfos(taskId); staticCommandInfos.forEach(taskCommandInfo -> { - taskCommandInfo.setProtocolNum(); +// taskCommandInfo.setProtocolNum(); + taskCommandInfo.getFiveTupleWithMask().setProtocolNum(Integer.valueOf(taskCommandInfo.getFiveTupleWithMask().getProtocol())); // taskCommandInfo.setMask(); }); diff --git a/src/main/resources/mappers/CommandMapper.xml b/src/main/resources/mappers/CommandMapper.xml index 1b0a074..613a123 100644 --- a/src/main/resources/mappers/CommandMapper.xml +++ b/src/main/resources/mappers/CommandMapper.xml @@ -15,7 +15,7 @@ DEFAULT, #{info.fiveTupleWithMask.sourceIP}, #{info.fiveTupleWithMask.sourcePort}, #{info.fiveTupleWithMask.destinationIP}, #{info.fiveTupleWithMask.destinationPort}, - #{info.fiveTupleWithMask.protocolNum}, + #{info.fiveTupleWithMask.protocol}, #{info.fiveTupleWithMask.maskSourceIP}, #{info.fiveTupleWithMask.maskSourcePort}, #{info.fiveTupleWithMask.maskDestinationIP}, #{info.fiveTupleWithMask.maskDestinationPort}, #{info.fiveTupleWithMask.maskProtocol}, @@ -41,7 +41,7 @@ DEFAULT, #{info.fiveTupleWithMask.sourceIP}, #{info.fiveTupleWithMask.sourcePort}, #{info.fiveTupleWithMask.destinationIP}, #{info.fiveTupleWithMask.destinationPort}, - #{info.fiveTupleWithMask.protocolNum}, + #{info.fiveTupleWithMask.protocol}, #{info.fiveTupleWithMask.maskSourceIP}, #{info.fiveTupleWithMask.maskSourcePort}, #{info.fiveTupleWithMask.maskDestinationIP}, #{info.fiveTupleWithMask.maskDestinationPort}, #{info.fiveTupleWithMask.maskProtocol}, @@ -64,7 +64,7 @@ DEFAULT, #{info.fiveTupleWithMask.sourceIP}, #{info.fiveTupleWithMask.sourcePort}, #{info.fiveTupleWithMask.destinationIP}, #{info.fiveTupleWithMask.destinationPort}, - #{info.fiveTupleWithMask.protocolNum}, + #{info.fiveTupleWithMask.protocol}, #{info.fiveTupleWithMask.maskSourceIP}, #{info.fiveTupleWithMask.maskSourcePort}, #{info.fiveTupleWithMask.maskDestinationIP}, #{info.fiveTupleWithMask.maskDestinationPort}, #{info.fiveTupleWithMask.maskProtocol}, @@ -511,6 +511,9 @@ and white_list_port = CAST(#{command.sourcePort} AS UNSIGNED) + + and white_list_protocol = #{command.protocol} + ) @@ -529,6 +532,9 @@ or (white_list_ip = INET_ATON(#{command.destinationIP}) and white_list_port = CAST(#{command.destinationPort} AS UNSIGNED) + + + and white_list_protocol = #{command.protocol} ) @@ -536,6 +542,9 @@ (INET_ATON(#{command.destinationIP}) & INET_ATON(#{command.maskDestinationIP})) and white_list_port = CAST(#{command.destinationPort} AS UNSIGNED) + + + and white_list_protocol = #{command.protocol} )