...
|
...
|
@@ -211,13 +211,14 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
String ip=jo.getString("ip");
|
|
|
String reason=jo.getString("reason");
|
|
|
String hbaseTime=String.valueOf(jo.getLongValue("timestamp"));
|
|
|
//String duration=jo.get("duration")==null?"":""+jo.get("duration");
|
|
|
String duration=jo.get("duration")==null?"":""+jo.get("duration");
|
|
|
if(StringUtils.isNotBlank(ip)){
|
|
|
|
|
|
MaliciousIpsRecordForbid record=new MaliciousIpsRecordForbid();
|
|
|
record.setIp(ip);
|
|
|
record.setReason(reason);
|
|
|
record.setHbaseTime(hbaseTime);
|
|
|
record.setDur(duration);
|
|
|
maliciousIpsRecordForbidMapper.insert(record);
|
|
|
|
|
|
logger.info("MaliciousIpServiceImpl writeMipsObjToOpsReids - "+ip);
|
...
|
...
|
@@ -363,6 +364,8 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
String insertTime2="";
|
|
|
String hbaseTime="";
|
|
|
String hbaseTime2="";
|
|
|
String dur="";
|
|
|
String dur2="";
|
|
|
for(String mipKey : mipKeys){
|
|
|
MaliciousIp mip = new MaliciousIp();
|
|
|
mip.setIp(mipKey);
|
...
|
...
|
@@ -374,6 +377,7 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
String reason=awsInfo.get("reason");
|
|
|
insertTime=awsInfo.get("createtime");
|
|
|
hbaseTime=awsInfo.get("hbasetime");
|
|
|
dur=awsInfo.get("dur");
|
|
|
try{
|
|
|
MaliciousIpModel model=JSON.parseObject(reason,MaliciousIpModel.class);
|
|
|
reason=model.toHtmlString();
|
...
|
...
|
@@ -393,6 +397,7 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
String reason=qcloudInfo.get("reason");
|
|
|
insertTime2=qcloudInfo.get("createtime");
|
|
|
hbaseTime2=qcloudInfo.get("hbasetime");
|
|
|
dur2=qcloudInfo.get("dur");
|
|
|
try{
|
|
|
MaliciousIpModel model=JSON.parseObject(reason,MaliciousIpModel.class);
|
|
|
reason=model.toHtmlString();
|
...
|
...
|
@@ -424,16 +429,20 @@ public class MaliciousIpServiceImpl implements MaliciousIpService { |
|
|
if(hbaseTime.compareTo(hbaseTime2)>0){
|
|
|
mip.setHbaseTime(hbaseTime);
|
|
|
mip.setTime(insertTime);
|
|
|
mip.setDur(dur);
|
|
|
}else{
|
|
|
mip.setHbaseTime(hbaseTime2);
|
|
|
mip.setTime(insertTime2);
|
|
|
mip.setDur(dur2);
|
|
|
}
|
|
|
}else if(StringUtils.isNotBlank(hbaseTime2)){
|
|
|
mip.setHbaseTime(hbaseTime2);
|
|
|
mip.setTime(insertTime2);
|
|
|
mip.setDur(dur2);
|
|
|
}else{
|
|
|
mip.setHbaseTime(hbaseTime);
|
|
|
mip.setTime(insertTime);
|
|
|
mip.setDur(dur);
|
|
|
}
|
|
|
|
|
|
listMaliciousIp.add(mip);
|
...
|
...
|
|