From 675116a51d3f595245ee0ffbad28ba1777836cb5 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 29 Jan 2024 09:16:07 -0500 Subject: [PATCH] feat(dashboard): add auditing cards for findings and policy violations Signed-off-by: Adam Setch --- src/i18n/locales/en.json | 3 + src/views/Dashboard.vue | 74 +++++++++++-- ....vue => ChartAuditingFindingsProgress.vue} | 0 .../ChartAuditingViolationsProgress.vue | 100 ++++++++++++++++++ .../portfolio/projects/ComponentDashboard.vue | 10 -- .../portfolio/projects/ProjectDashboard.vue | 16 +-- .../portfolio/projects/ServiceDashboard.vue | 10 -- 7 files changed, 172 insertions(+), 41 deletions(-) rename src/views/dashboard/{ChartAuditingProgress.vue => ChartAuditingFindingsProgress.vue} (100%) create mode 100644 src/views/dashboard/ChartAuditingViolationsProgress.vue diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index d7d0fafac..f296a9d2a 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -42,8 +42,10 @@ "inherited_risk_score": "Inherited Risk Score", "risk_score": "Risk Score", "vulnerable_projects": "Vulnerable Projects", + "findings": "Findings", "total_findings": "Total Findings", "findings_audited": "Findings Audited", + "findings_unaudited": "Findings Unaudited", "auditing_progress": "Auditing Progress", "show_suppressed_findings": "Show suppressed findings", "show_suppressed_violations": "Show suppressed violations", @@ -84,6 +86,7 @@ "license_risk": "License Risk", "operational_risk": "Operational Risk", "violations_audited": "Violations Audited", + "violations_unaudited": "Violations Unaudited", "attributed_on": "Attributed On", "view_details": "View Details", "project_details": "Project Details", diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index 06383f12e..3aa18cc13 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -32,8 +32,8 @@
{{ $t('message.findings_audited') }}
- {{auditedFindings}} ({{auditedFindingPercent}}%) - + {{auditedFindings}} ({{auditedFindingsPercent}}%) +
@@ -71,16 +71,61 @@ + + + -

{{ $t('message.auditing_progress') }}

+

{{ $t('message.auditing_progress') }}

+
{{ $t('message.findings') }}
- + +
+ + +
{{ $t("message.findings_unaudited") }}
+ {{ unauditedFindings }} ({{ unauditedFindingsPercent }}%) + +
+ +
{{ $t("message.findings_audited") }}
+ {{ auditedFindings }} ({{ auditedFindingsPercent }}%) + +
+
+
+
+
+ + + + +

{{ $t('message.auditing_progress') }}

+
{{$t('message.policy_violations')}}
+
+ + +
+ +
+ + +
{{ $t('message.violations_unaudited') }}
+ {{unauditedViolations}} ({{unauditedViolationsPercent}}%) + +
+ +
{{ $t('message.violations_audited') }}
+ {{auditedViolations}} ({{auditedViolationsPercent}}%) + +
+
+
@@ -161,7 +206,8 @@ import PortfolioWidgetRow from './dashboard/PortfolioWidgetRow' import ChartPortfolioVulnerabilities from './dashboard/ChartPortfolioVulnerabilities' import ChartProjectVulnerabilities from "./dashboard/ChartProjectVulnerabilities"; - import ChartAuditedProgress from "./dashboard/ChartAuditingProgress"; + import ChartAuditingFindingsProgress from "./dashboard/ChartAuditingFindingsProgress"; + import ChartAuditingViolationsProgress from "./dashboard/ChartAuditingViolationsProgress"; import ChartPolicyViolations from "./dashboard/ChartPolicyViolations"; import ChartComponentVulnerabilities from "./dashboard/ChartComponentVulnerabilities"; import { Callout } from '@coreui/vue' @@ -175,7 +221,8 @@ PortfolioWidgetRow, ChartPortfolioVulnerabilities, ChartProjectVulnerabilities, - ChartAuditedProgress, + ChartAuditingFindingsProgress, + ChartAuditingViolationsProgress, ChartPolicyViolations, ChartComponentVulnerabilities }, @@ -191,11 +238,15 @@ totalFindings: 0, auditedFindings: 0, - auditedFindingPercent: 0, + auditedFindingsPercent: 0, + unauditedFindings: 0, + unauditedFindingsPercent: 0, totalViolations: 0, auditedViolations: 0, auditedViolationsPercent: 0, + unauditedViolations: 0, + unauditedViolationsPercent: 0, failViolations: 0, failViolationsPercent: 0, warnViolations: 0, @@ -224,11 +275,15 @@ this.totalFindings = common.valueWithDefault(metric.findingsTotal, "0"); this.auditedFindings = common.valueWithDefault(metric.findingsAudited, "0"); - this.auditedFindingPercent = common.calcProgressPercent(this.totalFindings, this.auditedFindings); + this.auditedFindingsPercent = common.calcProgressPercent(this.totalFindings, this.auditedFindings); + this.unauditedFindings = common.valueWithDefault(metric.findingsUnaudited, "0"); + this.unauditedFindingsPercent = common.calcProgressPercent(this.totalFindings, this.unauditedFindings); this.totalViolations = common.valueWithDefault(metric.policyViolationsTotal, "0"); this.auditedViolations = common.valueWithDefault(metric.policyViolationsAudited, "0"); this.auditedViolationsPercent = common.calcProgressPercent(this.totalViolations, this.auditedViolations); + this.unauditedViolations = this.totalViolations - this.auditedViolations; + this.unauditedViolationsPercent = common.calcProgressPercent(this.totalViolations, this.unauditedViolations); this.failViolations = common.valueWithDefault(metric.policyViolationsFail, "0"); this.failViolationsPercent = common.calcProgressPercent(this.totalViolations, this.failViolations); this.warnViolations = common.valueWithDefault(metric.policyViolationsWarn, "0"); @@ -255,7 +310,8 @@ this.$refs.portfolioWidgetRow.render(response.data) this.$refs.chartPortfolioVulnerabilities.render(response.data); this.$refs.chartProjectVulnerabilities.render(response.data); - this.$refs.chartAuditedProgress.render(response.data); + this.$refs.chartAuditingFindingsProgress.render(response.data); + this.$refs.chartAuditingViolationsProgress.render(response.data); this.$refs.chartPolicyViolations.render(response.data); this.$refs.chartComponentVulnerabilities.render(response.data); this.extractStats(response.data); diff --git a/src/views/dashboard/ChartAuditingProgress.vue b/src/views/dashboard/ChartAuditingFindingsProgress.vue similarity index 100% rename from src/views/dashboard/ChartAuditingProgress.vue rename to src/views/dashboard/ChartAuditingFindingsProgress.vue diff --git a/src/views/dashboard/ChartAuditingViolationsProgress.vue b/src/views/dashboard/ChartAuditingViolationsProgress.vue new file mode 100644 index 000000000..3f9a1eaf0 --- /dev/null +++ b/src/views/dashboard/ChartAuditingViolationsProgress.vue @@ -0,0 +1,100 @@ + diff --git a/src/views/portfolio/projects/ComponentDashboard.vue b/src/views/portfolio/projects/ComponentDashboard.vue index 2641a9b63..bd2d07e5d 100644 --- a/src/views/portfolio/projects/ComponentDashboard.vue +++ b/src/views/portfolio/projects/ComponentDashboard.vue @@ -103,7 +103,6 @@