1:新增如下业务
0x28 网页关键字阻断 0x98 网页关键字监测 0x42邮件账号白名单 2:添加NTC_KEYWORDS_URL_LOG日志表查询接口
This commit is contained in:
30
src/main/java/com/nis/domain/restful/NtcKeywordsUrlLog.java
Normal file
30
src/main/java/com/nis/domain/restful/NtcKeywordsUrlLog.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.nis.domain.restful;
|
||||
|
||||
import com.nis.domain.LogEntity;
|
||||
|
||||
public class NtcKeywordsUrlLog extends LogEntity<NtcKeywordsUrlLog> {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String url;
|
||||
private String website;
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getWebsite() {
|
||||
return website;
|
||||
}
|
||||
|
||||
public void setWebsite(String website) {
|
||||
this.website = website;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zdjizhi.utils.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -25,6 +24,7 @@ import com.nis.domain.restful.NtcFtpLog;
|
||||
import com.nis.domain.restful.NtcHttpLog;
|
||||
import com.nis.domain.restful.NtcIpLog;
|
||||
import com.nis.domain.restful.NtcIpsecLog;
|
||||
import com.nis.domain.restful.NtcKeywordsUrlLog;
|
||||
import com.nis.domain.restful.NtcL2tpLog;
|
||||
import com.nis.domain.restful.NtcMailLog;
|
||||
import com.nis.domain.restful.NtcOpenvpnLog;
|
||||
@@ -35,11 +35,10 @@ import com.nis.domain.restful.NtcSslLog;
|
||||
import com.nis.domain.restful.NtcStreamingMediaLog;
|
||||
import com.nis.domain.restful.NtcVoipLog;
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.LogJDBCByDruid;
|
||||
import com.nis.util.JsonMapper;
|
||||
import com.nis.util.LogJDBCByDruid;
|
||||
import com.nis.web.controller.BaseRestController;
|
||||
import com.nis.web.service.AuditLogThread;
|
||||
import com.nis.web.service.HiveSqlService;
|
||||
@@ -47,6 +46,7 @@ import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.restful.NtcLogService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import com.zdjizhi.utils.StringUtil;
|
||||
|
||||
/**
|
||||
* @ClassName:NtcLogSearchController
|
||||
@@ -1079,6 +1079,60 @@ public class NtcLogSearchController extends BaseRestController {
|
||||
logPage, 0);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/ntcKeywordsUrlLogs", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "NTC关键字转URL日志查询", httpMethod = "GET", notes = "对日志功能“NTC关键字转URL日志”提供数据基础查询服务")
|
||||
public Map<String, ?> ntcKeywordsUrlLogs(Page page, NtcKeywordsUrlLog ntcKeywordsUrlLog, Model model, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
long start = System.currentTimeMillis();
|
||||
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET,
|
||||
request, null);
|
||||
|
||||
Page<NtcStreamingMediaLog> logPage = null;
|
||||
try {
|
||||
resetTime(ntcKeywordsUrlLog);
|
||||
ntcLogService.queryConditionCheck(auditLogThread, start, ntcKeywordsUrlLog, NtcKeywordsUrlLog.class, page);
|
||||
logPage = new Page<NtcStreamingMediaLog>();
|
||||
logPage.setPageNo(page.getPageNo());
|
||||
logPage.setPageSize(page.getPageSize());
|
||||
String orderBy = "";
|
||||
if (null != page.getOrderBy() && !page.getOrderBy().equals("")) {
|
||||
orderBy = Page.getOrderBySql(NtcStreamingMediaLog.class.getSimpleName(), page.getOrderBy());
|
||||
} else {
|
||||
orderBy = "found_Time";
|
||||
}
|
||||
String sql = HiveSqlService.getSql(page, ntcKeywordsUrlLog,
|
||||
getTableName(NtcKeywordsUrlLog.class.getSimpleName() + "HiveTable", "NTC_KEYWORDS_URL_LOG"),
|
||||
getCol2Col(), orderBy, null);
|
||||
Map<String, List<Object>> tableMapping = new LogJDBCByDruid().tableMapping(page, null, sql, NtcStreamingMediaLog.class, "foundTime",
|
||||
"recvTime");
|
||||
if (tableMapping == null) {
|
||||
logPage.setList(new ArrayList());
|
||||
} else {
|
||||
List list = tableMapping.get("obj");
|
||||
if (list.size() > 0) {
|
||||
String jsonString = JsonMapper.toJsonString(list);
|
||||
List<NtcStreamingMediaLog> List = (java.util.List<NtcStreamingMediaLog>) JsonMapper.fromJsonList(jsonString,
|
||||
NtcStreamingMediaLog.class);
|
||||
logPage.setList(List);
|
||||
logPage.setCount(List.size());
|
||||
|
||||
} else {
|
||||
logPage.setList(new ArrayList());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
auditLogThread.setExceptionInfo(e.getMessage() + " " + e.getCause());
|
||||
logger.error(e);
|
||||
if (!(e instanceof RestServiceException)) {
|
||||
e = new RestServiceException(auditLogThread, System.currentTimeMillis() - start, "NTC关键字转URL日志检索失败");
|
||||
}
|
||||
throw ((RestServiceException) e);
|
||||
}
|
||||
return serviceLogResponse(auditLogThread, System.currentTimeMillis() - start, request, "NTC关键字转URL日志检索成功",
|
||||
logPage, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
*判断开始和结束时间是否为null,如果为null则初始化时间
|
||||
* @param entity
|
||||
|
||||
@@ -1229,4 +1229,34 @@
|
||||
<result column="fd_type" jdbcType="INTEGER" property="fdType" />
|
||||
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
|
||||
</resultMap>
|
||||
<resultMap id="NtcKeywordsUrlLogMap" type="com.nis.domain.restful.NtcKeywordsUrlLog">
|
||||
<result column="cfg_id" jdbcType="BIGINT" property="cfgId" />
|
||||
<result column="found_Time" jdbcType="TIMESTAMP" property="foundTime" />
|
||||
<result column="recv_Time" jdbcType="TIMESTAMP" property="recvTime" />
|
||||
<result column="trans_proto" jdbcType="VARCHAR" property="transProto" />
|
||||
<result column="addr_type" jdbcType="INTEGER" property="addrType" />
|
||||
<result column="d_ip" jdbcType="VARCHAR" property="dIp" />
|
||||
<result column="s_ip" jdbcType="VARCHAR" property="sIp" />
|
||||
<result column="d_port" jdbcType="VARCHAR" property="dPort" />
|
||||
<result column="s_port" jdbcType="VARCHAR" property="sPort" />
|
||||
<result column="service" jdbcType="INTEGER" property="service" />
|
||||
<result column="entrance_id" jdbcType="BIGINT" property="entranceId" />
|
||||
<result column="device_id" jdbcType="INTEGER" property="deviceId" />
|
||||
<result column="direction" jdbcType="INTEGER" property="direction" />
|
||||
<result column="stream_dir" jdbcType="INTEGER" property="streamDir" />
|
||||
<result column="cap_ip" jdbcType="VARCHAR" property="capIp" />
|
||||
<result column="addr_list" jdbcType="VARCHAR" property="addrList" />
|
||||
<result column="user_region" jdbcType="VARCHAR" property="userRegion" />
|
||||
<result column="server_locate" jdbcType="VARCHAR" property="serverLocate" />
|
||||
<result column="client_locate" jdbcType="VARCHAR" property="clientLocate" />
|
||||
<result column="s_asn" jdbcType="VARCHAR" property="sAsn" />
|
||||
<result column="d_asn" jdbcType="VARCHAR" property="dAsn" />
|
||||
<result column="s_subscribe_id" jdbcType="VARCHAR" property="sSubscribeId" />
|
||||
<result column="d_subscribe_id" jdbcType="VARCHAR" property="dSubscribeId" />
|
||||
<result column="scene_file" jdbcType="VARCHAR" property="sceneFile" />
|
||||
|
||||
<result column="url" jdbcType="VARCHAR" property="url" />
|
||||
<result column="website" jdbcType="VARCHAR" property="website" />
|
||||
|
||||
</resultMap>
|
||||
</mapper>
|
||||
@@ -20,7 +20,7 @@
|
||||
##回流 0x60 96 loop
|
||||
##白名单 0x80 128 whitelist
|
||||
|
||||
service=1:128;2:128;16:16;17:16;18:16;19:16;20:16;21:16;22:16;23:16;24:16;26:16;27:16;30:16;31:16;32:16;33:16;34:16;35:16;36:16;37:16;38:16;39:16;128:1;129:1;130:1;131:1;132:1;133:1;134:1;135:1;136:1;137:1;138:1;139:1;140:1;142:1;143:1;144:1;145:1;146:1;147:1;148:1;149:1;150:1;151:1;256:128;257:128;258:16;259:16;260:16;267:16;271:16;272:16;273:16;384:1;385:1;386:1;387:1;388:1;395:1;399:1;512:1;513:1;514:64;515:64;517:80;521:128;528:48;544:2;560:80;576:16;592:1;750:128;768:96;1024:1;1025:1;1026:1;1027:1;1028:1;1029:1;1030:1;1040:32;1041:32;1042:32;1056:64;1057:64;1058:64;1059:64;1060:64;1152:1
|
||||
service=1:128;2:128;16:16;17:16;18:16;19:16;20:16;21:16;22:16;23:16;24:16;26:16;27:16;30:16;31:16;32:16;33:16;34:16;35:16;36:16;37:16;38:16;39:16;40:16;66:128;128:1;129:1;130:1;131:1;132:1;133:1;134:1;135:1;136:1;137:1;138:1;139:1;140:1;142:1;143:1;144:1;145:1;146:1;147:1;148:1;149:1;150:1;151:1;152:1;256:128;257:128;258:16;259:16;260:16;267:16;271:16;272:16;273:16;384:1;385:1;386:1;387:1;388:1;395:1;399:1;512:1;513:1;514:64;515:64;517:80;521:128;528:48;544:2;560:80;576:16;592:1;750:128;768:96;1024:1;1025:1;1026:1;1027:1;1028:1;1029:1;1030:1;1040:32;1041:32;1042:32;1056:64;1057:64;1058:64;1059:64;1060:64;1152:1
|
||||
|
||||
#0x1E 0x8E 有问题:14:NTC_XMPP_REGION,NTC_XMPP_CONT 无表结构 不确定表是不是字符串类
|
||||
|
||||
@@ -71,7 +71,11 @@ service=1:128;2:128;16:16;17:16;18:16;19:16;20:16;21:16;22:16;23:16;24:16;26:16;
|
||||
38=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_VOIP_ACCOUNT,NTC_SUBSCRIBE_ID;18:NTC_IP_RANGE
|
||||
#0x27 流媒体协议阻断
|
||||
39=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_STREAMING_MEDIA_URL,NTC_SUBSCRIBE_ID;18:NTC_IP_RANGE
|
||||
#0x28 网页关键字阻断
|
||||
40=10:NTC_COMPILE;11:NTC_GROUP;14:NTC_HTTP_REQ_BODY,NTC_HTTP_RES_BODY;18:NTC_IP_RANGE
|
||||
|
||||
#0x42 邮件账号白名单
|
||||
66=10:NTC_COMPILE;11:NTC_GROUP;15:NTC_MAIL_HDR;18:NTC_IP_RANGE
|
||||
|
||||
#0x80 IP地址监测
|
||||
128=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_IP;14:NTC_SUBSCRIBE_ID;18:NTC_IP_RANGE
|
||||
@@ -119,6 +123,8 @@ service=1:128;2:128;16:16;17:16;18:16;19:16;20:16;21:16;22:16;23:16;24:16;26:16;
|
||||
150=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_VOIP_ACCOUNT,NTC_SUBSCRIBE_ID;18:NTC_IP_RANGE
|
||||
#0x97 流媒体协议监测
|
||||
151=10:NTC_COMPILE;11:NTC_GROUP;12:NTC_UNIVERSAL_IP;13:NTC_UNIVERSAL_PROTO_TYPE;14:NTC_STREAMING_MEDIA_URL,NTC_SUBSCRIBE_ID;18:NTC_IP_RANGE
|
||||
#0x98 网页关键字监测
|
||||
152=10:NTC_COMPILE;11:NTC_GROUP;14:NTC_HTTP_REQ_BODY,NTC_HTTP_RES_BODY;18:NTC_IP_RANGE
|
||||
|
||||
#0xA0 通联关系监测 monit 无配置
|
||||
#0xA1 邮件泛收 monit 无配置
|
||||
@@ -244,6 +250,8 @@ unMaatService=3:32;4:96;5:32;25:32;28:32;64;65;261:16;262:16;263:16;264:16;265:1
|
||||
#0x41 DNS 响应策略配置(回调)
|
||||
65=0:NTC_DNS_RES_STRATEGY
|
||||
|
||||
|
||||
|
||||
#0x105 音频样例阻断
|
||||
261=0:MM_SAMPLE_AUDIO
|
||||
#0x106 视频样例阻断
|
||||
@@ -297,8 +305,10 @@ unMaatService=3:32;4:96;5:32;25:32;28:32;64;65;261:16;262:16;263:16;264:16;265:1
|
||||
#APP 0x400-0x420 目前配置入到NTC系统对应的库中
|
||||
########## 配置分发
|
||||
##MAAT配置
|
||||
#0x01 全局IP白名单 1:2,3,4,5;
|
||||
#0x02 全局域名白名单 2:2,3,4,5;
|
||||
#0x01 全局IP白名单 1:2,4,5;(杨威说不往ysp库下发了,所以就不往3号库里面写了)
|
||||
#0x02 全局域名白名单 2:2,4,5;(杨威说不往ysp库下发了,所以就不往3号库里面写了)
|
||||
#0x42 邮件账号白名单 66:2,4,5;(杨威说不往ysp库下发了,所以就不往3号库里面写了)
|
||||
|
||||
#0x21 APP阻断 33:2,5;
|
||||
#0x200 PXY拦截IP 512:4,5;
|
||||
#0x201 PXY拦截域名 513:4,2,5;
|
||||
@@ -307,7 +317,7 @@ unMaatService=3:32;4:96;5:32;25:32;28:32;64;65;261:16;262:16;263:16;264:16;265:1
|
||||
##回调类配置
|
||||
#0x340 IP复用地址池配置(回调)832:2,4,5
|
||||
##########
|
||||
serviceDBIndex=1:2,4,5;2:2,4,5;16:2;17:2;18:2;19:2;20:2;21:2;22:2;23:2;24:2;26:2;27:2;30:2;31:2;32:2;33:2,5;34:2;35:2;36:2;37:2;38:2;39:2;128:2;129:2;130:2;131:2;132:2;133:2;134:2;135:2;136:2;137:2;138:2;139:2;140:2;142:2;143:2;144:2;145:2;146:2;147:2;148:2;149:2;150:2;151:2;256:2;257:2;258:2;259:2;260:2;267:2;271:2;272:2;273:3;274:5;384:2;385:2;386:2;387:2;388:2;395:2;399:3;512:4,5;513:4,2,5;514:4;515:4;517:4;520:4;521:4;528:4;544:4;560:4;576:4;592:4;608:4;750:4;768:4;1024:2;1025:2;1026:2,5;1027:2;1028:2,5;1029:2;1030:2;1040:2;1041:2;1042:2;1152:2;3:5;4:5;5:2;25:5;28:5;64:2;65:2;261:3;262:3;263:3;264:3;265:3;266:3;268:3;269:3;270:3;389:3;390:3;391:3;392:3;393:3;394:3;396:3;397:3;398:3;832:2,4,5;
|
||||
serviceDBIndex=1:2,4,5;2:2,4,5;66:2,4,5;16:2;17:2;18:2;19:2;20:2;21:2;22:2;23:2;24:2;26:2;27:2;30:2;31:2;32:2;33:2,5;34:2;35:2;36:2;37:2;38:2;39:2;40:2;128:2;129:2;130:2;131:2;132:2;133:2;134:2;135:2;136:2;137:2;138:2;139:2;140:2;142:2;143:2;144:2;145:2;146:2;147:2;148:2;149:2;150:2;151:2;152:2;256:2;257:2;258:2;259:2;260:2;267:2;271:2;272:2;273:3;274:5;384:2;385:2;386:2;387:2;388:2;395:2;399:3;512:4,5;513:4,2,5;514:4;515:4;517:4;520:4;521:4;528:4;544:4;560:4;576:4;592:4;608:4;750:4;768:4;1024:2;1025:2;1026:2,5;1027:2;1028:2,5;1029:2;1030:2;1040:2;1041:2;1042:2;1152:2;3:5;4:5;5:2;25:5;28:5;64:2;65:2;261:3;262:3;263:3;264:3;265:3;266:3;268:3;269:3;270:3;389:3;390:3;391:3;392:3;393:3;394:3;396:3;397:3;398:3;832:2,4,5;
|
||||
|
||||
##阀门配置在redisdb的序号
|
||||
tapRedisDb=5
|
||||
|
||||
@@ -34,6 +34,7 @@ MmSpeakerRecognizationLogClickHouseTable=TBS_ODS_MM_SPEAKER_RECOGNIZATION_LOG
|
||||
NtcVoipLogClickHouseTable=TBS_ODS_NTC_VOIP_LOG
|
||||
NtcStreamingMediaLogClickHouseTable=TBS_ODS_NTC_STREAMING_MEDIA_LOG
|
||||
MmFileDigestLogClickHouseTable=TBS_ODS_MM_FILE_DIGEST_LOG
|
||||
NtcKeywordsUrlLogClickHouseTable=TBS_ODS_NTC_KEYWORDS_URL_LOG
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ MmSpeakerRecognizationLogHiveTable=MM_SPEAKER_RECOGNIZATION_LOG
|
||||
NtcVoipLogHiveTable=NTC_VOIP_LOG
|
||||
NtcStreamingMediaLogHiveTable=NTC_STREAMING_MEDIA_LOG
|
||||
MmFileDigestLogHiveTable=MM_FILE_DIGEST_LOG
|
||||
NtcKeywordsUrlLogHiveTable=NTC_KEYWORDS_URL_LOG
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@
|
||||
</p:expressions>
|
||||
</p:maatType>
|
||||
<p:maatType
|
||||
service="1;2;16;17;18;19;20;21;22;23;24;26;27;30;31;32;33;34;35;36;37;38;39;128;129;130;131;132;133;134;135;136;137;138;139;140;141;142;143;144;145;146;147;148;149;150;151;256;257;258;259;260;267;271;272;273;384;385;386;387;388;395;399;512;513;514;515;517;521;528;544;560;576;592;750;768;848;1024;1025;1026;1027;1028;1029;1030;1040;1041;1042;1056;1057;1058;1059;1060;1152">
|
||||
service="1;2;66;16;17;18;19;20;21;22;23;24;26;27;30;31;32;33;34;35;36;37;38;39;40;128;129;130;131;132;133;134;135;136;137;138;139;140;141;142;143;144;145;146;147;148;149;150;151;152;256;257;258;259;260;267;271;272;273;384;385;386;387;388;395;399;512;513;514;515;517;521;528;544;560;576;592;750;768;848;1024;1025;1026;1027;1028;1029;1030;1040;1041;1042;1056;1057;1058;1059;1060;1152">
|
||||
<p:expressions>
|
||||
<p:keyExpression>EFFECTIVE_RULE;:;{compile_table_name};,;[compile_id]</p:keyExpression>
|
||||
<p:valueExpression>[compile_id];\t;[service];\t;[action];\t;[do_blacklist];\t;[do_log];\t;[effective_range];\t;[user_region];\t;[is_valid];\t;[group_num];\t;[father_cfg_id];\t;[op_time];&nbsp;0;\n</p:valueExpression>
|
||||
|
||||
Reference in New Issue
Block a user