From 327ae1956d931ae3e74ed5b35dab29596b7d833a Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Tue, 24 Oct 2023 18:01:59 +0800 Subject: [PATCH] =?UTF-8?q?CN-1391=20fix:=20=E8=B0=83=E6=95=B4detection?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=92=8C=E4=B8=8B=E6=8B=89=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/constants.js | 7 + src/views/detections/DetectionList.vue | 22 +- src/views/detections/DetectionRow.vue | 19 +- .../DetectionSecurityEventOverview.vue | 298 ++++++++++++------ 4 files changed, 216 insertions(+), 130 deletions(-) diff --git a/src/utils/constants.js b/src/utils/constants.js index 9afc82d1..0fbb17da 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -178,6 +178,13 @@ export const eventSeverityColor = { low: '#FFD82D', info: '#D1BD50' } +export const riskLevelColor = { + 5: '#D84C4C', + 4: '#FE845D', + 3: '#FFB65A', + 2: '#FFD82D', + 1: '#D1BD50' +} export const eventSeverityColor1 = { Critical: '#D84C4C', High: '#FE845D', diff --git a/src/views/detections/DetectionList.vue b/src/views/detections/DetectionList.vue index 04abb8c8..e033e3b9 100644 --- a/src/views/detections/DetectionList.vue +++ b/src/views/detections/DetectionList.vue @@ -67,18 +67,17 @@ export default { this.myListData = [] this.listData.forEach((item, i) => { this.myListData.push(this.$_.cloneDeep(item)) - if (item.eventInfoObj) { - axios.get(`${api.detection.securityEvent.detail}/${item.eventInfoObj.ioc_type}?resource=${item.eventInfoObj.ioc_value}`).then(res => { - if (res.status === 200 && this.myListData[i]) { - this.myListData[i].malwareName = (this.$_.get(res, 'data.data.malware.malwareName', '-')) || '-' - } else if (this.myListData[i]) { - this.myListData[i].malwareName = '-' + if (item.eventInfoObj && item.isBuiltin === 1) { + axios.get(`${api.detection.securityEvent.detail}/${item.eventInfoObj.ioc_type.toLowerCase()}?resource=${item.eventInfoObj.ioc_value}`).then(res => { + if (res.status === 200) { + if (item.eventType === 'Anonymity') { + item.darkweb = this.$_.get(res, 'data.data.darkweb', {}) || {} + } else if (item.eventType === 'Command and Control') { + item.malware = this.$_.get(res, 'data.data.malware', {}) || {} + } } }).catch(e => { console.error(e) - if (this.myListData[i]) { - this.myListData[i].malwareName = '-' - } }) } }) @@ -118,10 +117,7 @@ export default { } else { clearTimeout(this.timeout) this.noData = false - const timer = setTimeout(() => { - this.initData() - clearTimeout(timer) - }, 200) + this.initData() } } } diff --git a/src/views/detections/DetectionRow.vue b/src/views/detections/DetectionRow.vue index 1e0f4ad5..6cd37328 100644 --- a/src/views/detections/DetectionRow.vue +++ b/src/views/detections/DetectionRow.vue @@ -41,21 +41,16 @@ {{$t('detections.severity')}} : {{detection.eventSeverity || '-'}} - - - - - -