diff options
| author | tanghao <[email protected]> | 2023-10-20 18:08:02 +0800 |
|---|---|---|
| committer | tanghao <[email protected]> | 2023-10-20 18:08:02 +0800 |
| commit | 6bf9d5df98a308d1231cde6eb75b3aac622582f4 (patch) | |
| tree | 87789abc7158c53f25cdf509fdb82791f204611f | |
| parent | c739c4a37ef3e3e8717a1e1b95a22252523dea7b (diff) | |
fix: 安全事件总数返回类型变更
| -rw-r--r-- | cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql b/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql index 14c9834..ab9c996 100644 --- a/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql +++ b/cn-admin/src/main/resources/db/R__AZ_magic_api_file.sql @@ -728,7 +728,7 @@ INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detec INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/victim-ip/group.json', '{\r\n \"properties\" : { },\r\n \"id\" : \"7df655bd31fa4aafb376f3b936ae78fb\",\r\n \"name\" : \"victim-ip\",\r\n \"type\" : \"api\",\r\n \"parentId\" : \"de526fab02d442ccbbee9790c3c7f53d\",\r\n \"path\" : \"/victim-ip\",\r\n \"createTime\" : 1697782114252,\r\n \"updateTime\" : null,\r\n \"createBy\" : \"admin\",\r\n \"updateBy\" : null,\r\n \"paths\" : [ ],\r\n \"options\" : [ ]\r\n}'); INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/victim-ip/受害者IP统计.ms', '{\r\n \"properties\" : { },\r\n \"id\" : \"90342eac26ac4711a541f2d020bca92e\",\r\n \"script\" : null,\r\n \"groupId\" : \"7df655bd31fa4aafb376f3b936ae78fb\",\r\n \"name\" : \"受害者IP统计\",\r\n \"createTime\" : null,\r\n \"updateTime\" : 1697792205066,\r\n \"lock\" : null,\r\n \"createBy\" : null,\r\n \"updateBy\" : \"admin\",\r\n \"path\" : \"/statistics\",\r\n \"method\" : \"GET\",\r\n \"parameters\" : [ {\r\n \"name\" : \"startTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"endTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"resource\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : false,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n } ],\r\n \"options\" : [ ],\r\n \"requestBody\" : \"\",\r\n \"headers\" : [ ],\r\n \"paths\" : [ ],\r\n \"responseBody\" : null,\r\n \"description\" : null,\r\n \"requestBodyDefinition\" : null,\r\n \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport net.geedge.common.utils.FreeMarkerUtil as freeMarkerUtil;\r\nimport net.geedge.common.utils.JSONUtil as jsonUtil;\r\nimport \'@/pre/timeHandle\' as preHandle;\r\nimport \'@/post/table\' as postHandle;\r\nimport \'@/public/getGalaxyResult\' as getGalaxyResult;\r\n\r\n\r\n/**\r\n * 入参整理 包括调用公共函数\r\n */\r\nvar parameter={\r\n \"startTime\":startTime,\r\n \"endTime\":endTime,\r\n \"resource\":resource\r\n}\r\npreHandle(parameter);\r\n\r\n/**\r\n * 接口sql相关内容整理 通过freemarker模板生成最后执行语句\r\n */\r\nvar q = \"{\\\"query\\\": \\\"SELECT victim_ip AS victim_ip,COUNT(*) AS count FROM cn_security_event WHERE start_time >= ${startTime} AND start_time < ${endTime} <#if resource?default(\'\')?trim? length gt 0> AND ${resource} </#if> GROUP BY victim_ip ORDER BY count DESC limit 100\\\",\\\"option\\\": \\\"real-time\\\",\\\"format\\\": \\\"json\\\"}\"\r\nvar result = freeMarkerUtil.processTemplateIntoString(\"detectionSecurityList\",q,parameter);\r\n\r\n/**\r\n * 调用galaxy接口获取结果信息\r\n */\r\nvar res = jsonUtil.toBean(result,HashMap.class);\r\nvar galaxyRes = getGalaxyResult(res);\r\n\r\n/**\r\n * 处理galaxy返回的数据结果 将新结果返回前端界面\r\n */\r\nvar result = postHandle(galaxyRes);\r\nprintln(jsonUtil.toJsonStr(galaxyRes));\r\n\r\nreturn result;'); INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/安全事件列表.ms', '{\r\n \"properties\" : { },\r\n \"id\" : \"868948a7dad9416c84cee0fb1da2a524\",\r\n \"script\" : null,\r\n \"groupId\" : \"de526fab02d442ccbbee9790c3c7f53d\",\r\n \"name\" : \"安全事件列表\",\r\n \"createTime\" : null,\r\n \"updateTime\" : 1697792865401,\r\n \"lock\" : null,\r\n \"createBy\" : null,\r\n \"updateBy\" : \"admin\",\r\n \"path\" : \"/list\",\r\n \"method\" : \"GET\",\r\n \"parameters\" : [ {\r\n \"name\" : \"startTime\",\r\n \"value\" : \"1672544582\",\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"endTime\",\r\n \"value\" : \"1698810182\",\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"resource\",\r\n \"value\" : \"severity=\'critical\'\",\r\n \"description\" : null,\r\n \"required\" : false,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"pageNo\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Integer\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"pageSize\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Integer\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n } ],\r\n \"options\" : [ ],\r\n \"requestBody\" : \"\",\r\n \"headers\" : [ {\r\n \"name\" : \"cn-Authorization\",\r\n \"value\" : \"cntest\",\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n } ],\r\n \"paths\" : [ ],\r\n \"responseBody\" : \"{\\n \\\"code\\\": 999,\\n \\\"time\\\": \\\"2023-10-20 07:07:34\\\",\\n \\\"message\\\": \\\"404 null at Row:10~10,Col:32~36\\\\n\\\\nvar galaxyResult = httpRequest.get().getBody();\\\\r\\\\n ^^^^^ \\\"\\n}\",\r\n \"description\" : null,\r\n \"requestBodyDefinition\" : null,\r\n \"responseBodyDefinition\" : {\r\n \"name\" : \"\",\r\n \"value\" : \"\",\r\n \"description\" : \"\",\r\n \"required\" : false,\r\n \"dataType\" : \"Object\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : \"\",\r\n \"error\" : \"\",\r\n \"expression\" : \"\",\r\n \"children\" : [ {\r\n \"name\" : \"code\",\r\n \"value\" : \"999\",\r\n \"description\" : \"\",\r\n \"required\" : false,\r\n \"dataType\" : \"Integer\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : \"\",\r\n \"error\" : \"\",\r\n \"expression\" : \"\",\r\n \"children\" : [ ]\r\n }, {\r\n \"name\" : \"time\",\r\n \"value\" : \"2023-10-20 07:07:34\",\r\n \"description\" : \"\",\r\n \"required\" : false,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : \"\",\r\n \"error\" : \"\",\r\n \"expression\" : \"\",\r\n \"children\" : [ ]\r\n }, {\r\n \"name\" : \"message\",\r\n \"value\" : \"404 null at Row:10~10,Col:32~36\\\\n\\\\nvar galaxyResult = httpRequest.get().getBody();\\\\r\\\\n ^^^^^\",\r\n \"description\" : \"\",\r\n \"required\" : false,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : \"\",\r\n \"error\" : \"\",\r\n \"expression\" : \"\",\r\n \"children\" : [ ]\r\n } ]\r\n }\r\n}\r\n================================\r\nimport net.geedge.common.utils.FreeMarkerUtil as freeMarkerUtil;\r\nimport net.geedge.common.utils.JSONUtil as jsonUtil;\r\nimport \'@/pre/timeHandle\' as preHandle;\r\nimport \'@/post/table\' as postHandle;\r\nimport \'@/public/getGalaxyResult\' as getGalaxyResult;\r\nimport \'@/pre/pageFieldsHandle\' as pageFieldsHandle;\r\n\r\n\r\n/**\r\n * 入参整理 包括调用公共函数\r\n */\r\nvar parameter={\r\n \"startTime\":startTime,\r\n \"endTime\":endTime,\r\n \"resource\":resource,\r\n \"pageNo\":pageNo,\r\n \"pageSize\":pageSize\r\n}\r\npageFieldsHandle(parameter);\r\npreHandle(parameter);\r\n\r\n/**\r\n * 接口sql相关内容整理 通过freemarker模板生成最后执行语句\r\n */\r\nvar q = \"{\\\"query\\\": \\\"SELECT event_id AS event_id, event_type AS event_type, event_name AS event_name, event_key AS event_key, rule_id AS rule_id, rule_type AS rule_type, is_builtin AS is_builtin, severity AS severity, offender_ip AS offender_ip, victim_ip AS victim_ip, domain AS domain, app AS app, start_time AS start_time, end_time AS end_time, duration_s AS duration_s, match_times AS match_times, status AS status, event_info AS event_info FROM cn_security_event WHERE start_time >= ${startTime} AND start_time < ${endTime} <#if resource?default(\'\')?trim? length gt 0> AND ${resource} </#if> ORDER BY start_time DESC <#if pageSize?default(\\\'\\\')?trim? length gt 0&&pageNo?default(\\\'\\\')?trim? length gt 0> LIMIT ${pageNo},${pageSize}</#if>\\\",\\\"option\\\": \\\"real-time\\\",\\\"format\\\": \\\"json\\\"}\"\r\nvar result = freeMarkerUtil.processTemplateIntoString(\"detectionSecurityList\",q,parameter);\r\n\r\n/**\r\n * 调用galaxy接口获取结果信息\r\n */\r\nvar res = jsonUtil.toBean(result,HashMap.class);\r\nvar galaxyRes = getGalaxyResult(res);\r\n\r\n/**\r\n * 处理galaxy返回的数据结果 将新结果返回前端界面\r\n */\r\nvar result = postHandle(galaxyRes);\r\nprintln(jsonUtil.toJsonStr(galaxyRes));\r\n\r\nreturn result;'); -INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/安全事件总数.ms', '{\r\n \"properties\" : { },\r\n \"id\" : \"0df4b899f7604767897aac295e7df9f2\",\r\n \"script\" : null,\r\n \"groupId\" : \"de526fab02d442ccbbee9790c3c7f53d\",\r\n \"name\" : \"安全事件总数\",\r\n \"createTime\" : null,\r\n \"updateTime\" : 1697787250841,\r\n \"lock\" : null,\r\n \"createBy\" : null,\r\n \"updateBy\" : \"admin\",\r\n \"path\" : \"/count\",\r\n \"method\" : \"GET\",\r\n \"parameters\" : [ {\r\n \"name\" : \"startTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"endTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"resource\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : false,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n } ],\r\n \"options\" : [ ],\r\n \"requestBody\" : \"\",\r\n \"headers\" : [ ],\r\n \"paths\" : [ ],\r\n \"responseBody\" : null,\r\n \"description\" : null,\r\n \"requestBodyDefinition\" : null,\r\n \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport net.geedge.common.utils.FreeMarkerUtil as freeMarkerUtil;\r\nimport net.geedge.common.utils.JSONUtil as jsonUtil;\r\nimport \'@/pre/timeHandle\' as preHandle;\r\nimport \'@/post/table\' as postHandle;\r\nimport \'@/public/getGalaxyResult\' as getGalaxyResult;\r\n\r\n\r\n/**\r\n * 入参整理 包括调用公共函数\r\n */\r\nvar parameter={\r\n \"startTime\":startTime,\r\n \"endTime\":endTime,\r\n \"resource\":resource\r\n}\r\npreHandle(parameter);\r\n\r\n/**\r\n * 接口sql相关内容整理 通过freemarker模板生成最后执行语句\r\n */\r\nvar q = \"{\\\"query\\\": \\\"SELECT count(*) AS count FROM cn_security_event WHERE start_time >= ${startTime} AND start_time < ${endTime} <#if resource?default(\'\')?trim? length gt 0> AND ${resource} </#if> \\\",\\\"option\\\": \\\"real-time\\\",\\\"format\\\": \\\"json\\\"}\"\r\nvar result = freeMarkerUtil.processTemplateIntoString(\"detectionSecurityList\",q,parameter);\r\n\r\n/**\r\n * 调用galaxy接口获取结果信息\r\n */\r\nvar res = jsonUtil.toBean(result,HashMap.class);\r\nvar galaxyRes = getGalaxyResult(res);\r\n\r\n/**\r\n * 处理galaxy返回的数据结果 将新结果返回前端界面\r\n */\r\nvar result = postHandle(galaxyRes);\r\nprintln(jsonUtil.toJsonStr(galaxyRes));\r\n\r\nreturn result;'); +INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/detection/security/安全事件总数.ms', '{\r\n \"properties\" : { },\r\n \"id\" : \"0df4b899f7604767897aac295e7df9f2\",\r\n \"script\" : null,\r\n \"groupId\" : \"de526fab02d442ccbbee9790c3c7f53d\",\r\n \"name\" : \"安全事件总数\",\r\n \"createTime\" : null,\r\n \"updateTime\" : 1697796277922,\r\n \"lock\" : null,\r\n \"createBy\" : null,\r\n \"updateBy\" : \"admin\",\r\n \"path\" : \"/count\",\r\n \"method\" : \"GET\",\r\n \"parameters\" : [ {\r\n \"name\" : \"startTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"endTime\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : true,\r\n \"dataType\" : \"Long\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n }, {\r\n \"name\" : \"resource\",\r\n \"value\" : null,\r\n \"description\" : null,\r\n \"required\" : false,\r\n \"dataType\" : \"String\",\r\n \"type\" : null,\r\n \"defaultValue\" : null,\r\n \"validateType\" : null,\r\n \"error\" : null,\r\n \"expression\" : null,\r\n \"children\" : null\r\n } ],\r\n \"options\" : [ ],\r\n \"requestBody\" : \"\",\r\n \"headers\" : [ ],\r\n \"paths\" : [ ],\r\n \"responseBody\" : null,\r\n \"description\" : null,\r\n \"requestBodyDefinition\" : null,\r\n \"responseBodyDefinition\" : null\r\n}\r\n================================\r\nimport net.geedge.common.utils.FreeMarkerUtil as freeMarkerUtil;\r\nimport net.geedge.common.utils.JSONUtil as jsonUtil;\r\nimport \'@/pre/timeHandle\' as preHandle;\r\nimport \'@/post/single\' as postHandle;\r\nimport \'@/public/getGalaxyResult\' as getGalaxyResult;\r\n\r\n\r\n/**\r\n * 入参整理 包括调用公共函数\r\n */\r\nvar parameter={\r\n \"startTime\":startTime,\r\n \"endTime\":endTime,\r\n \"resource\":resource\r\n}\r\npreHandle(parameter);\r\n\r\n/**\r\n * 接口sql相关内容整理 通过freemarker模板生成最后执行语句\r\n */\r\nvar q = \"{\\\"query\\\": \\\"SELECT count(*) AS count FROM cn_security_event WHERE start_time >= ${startTime} AND start_time < ${endTime} <#if resource?default(\'\')?trim? length gt 0> AND ${resource} </#if> \\\",\\\"option\\\": \\\"real-time\\\",\\\"format\\\": \\\"json\\\"}\"\r\nvar result = freeMarkerUtil.processTemplateIntoString(\"detectionSecurityList\",q,parameter);\r\n\r\n/**\r\n * 调用galaxy接口获取结果信息\r\n */\r\nvar res = jsonUtil.toBean(result,HashMap.class);\r\nvar galaxyRes = getGalaxyResult(res);\r\n\r\n/**\r\n * 处理galaxy返回的数据结果 将新结果返回前端界面\r\n */\r\nvar result = postHandle(galaxyRes);\r\nprintln(jsonUtil.toJsonStr(galaxyRes));\r\n\r\nreturn result;'); INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/entity/', 'this is directory'); INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/entity/detail/', 'this is directory'); INSERT INTO `magic_api_file`(`file_path`, `file_content`) VALUES ('/api/v1/entity/detail/app/', 'this is directory'); |
