新增读取DoS Detection Profiles IP冲突检测机制

修复DoS event日志end_time大于当前时间bug
This commit is contained in:
wanglihui
2021-09-26 18:41:36 +08:00
parent 77bc6a844e
commit c44250bf73
4 changed files with 20 additions and 10 deletions

View File

@@ -16,7 +16,6 @@ import org.slf4j.LoggerFactory;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -180,7 +179,19 @@ public class ParseStaticThreshold {
thresholdRangeMap.put(Range.closed(lower, upper), floodTypeThresholdMap);
}
}else {
thresholdRangeMap.put(Range.closed(address, address), floodTypeThresholdMap);
Map.Entry<Range<IPAddress>, Map<String, DosDetectionThreshold>> entry = thresholdRangeMap.getEntry(address);
if (entry != null){
Range<IPAddress> entryKey = entry.getKey();
Map<String, DosDetectionThreshold> entryValue = entry.getValue();
entryValue.put(threshold.getAttackType(), threshold);
if (entryKey.lowerEndpoint() == entryKey.upperEndpoint()){
thresholdRangeMap.put(Range.closed(address, address), entryValue);
}else {
thresholdRangeMap.put(Range.closed(address, address), floodTypeThresholdMap);
}
}else {
thresholdRangeMap.put(Range.closed(address, address), floodTypeThresholdMap);
}
}
}
}