From b699660ef9fa579d6f7e3bcf69996efd288baf2c Mon Sep 17 00:00:00 2001 From: leec94 Date: Tue, 11 Jun 2024 14:10:58 -0400 Subject: [PATCH 1/3] front end changes for risk score Signed-off-by: leec94 --- src/i18n/locales/en.json | 9 + src/router/index.js | 11 ++ src/views/administration/AdminMenu.vue | 5 + src/views/administration/Administration.vue | 3 +- .../configuration/RiskScore.vue | 160 ++++++++++++++++++ 5 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 src/views/administration/configuration/RiskScore.vue diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 9cecb043..16f47965 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -806,6 +806,15 @@ "index_general_description": "Dependency Track uses Apache Lucene to enable full-text search on various entities like projects or vulnerabilities.", "index_use_cases": "The full-text search feature is principally used for the search API (i.e. all the indexes) and internal analyzer fuzzy matching on CPE (i.e. the vulnerable software index).", "index_issues_description": "The lucene indexes can degrade or drift from Dependency Track database over time. Even though DT does its best to minimize the drift, the administrative features below are provided to check or restore the indexes if need be. It must be used with caution.", + "index_risk_score_description": "Dependency Track calculates the risk score of each project as a weighted severity score using the following calculation as default: ", + "index_risk_score_calc": "((critical * 10) + (high * 5) + (medium * 3) + (low * 1) + (unassigned * 5))", + "index_risk_score_weighting_description": "You can customize the weighting of each severity to customize the risk score.", + "enable_risk_score_history_check": "Recalculate risk score weighting on project history", + "risk_score_weight_critical": "Critical (default: 10)", + "risk_score_weight_high": "High (default: 5)", + "risk_score_weight_medium": "Medium (default: 3)", + "risk_score_weight_low": "Low (default: 1)", + "risk_score_weight_unassigned": "Unassigned (default: 5)", "index_consistency_check_description": "You can enable a periodic background task that will check that all indexes exists, are not corrupted and that their difference with Dependency Track database is under a defined threshold percentage. Any check failure will trigger a rebuild of the corresponding index. A restart is required to take cadence modification into account.", "index_rebuild_description" : "You can selectively trigger an immediate rebuild of some or all indexes. The index rebuild will be perform by an asynchronous tasks. You can check the progress using Dependency Track logs.", "enable_index_consistency_check": "Enable periodic consistency check", diff --git a/src/router/index.js b/src/router/index.js index 6f3298f2..6fff8904 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -25,6 +25,7 @@ const Jira = () => import('@/views/administration/configuration/JiraConfig') const InternalComponents = () => import('@/views/administration/configuration/InternalComponents') const TaskScheduler = () => import('@/views/administration/configuration/TaskScheduler') const Search = () => import('@/views/administration/configuration/Search') +const RiskScore = () => import('@/views/administration/configuration/RiskScore') const InternalAnalyzer = () => import('@/views/administration/analyzers/InternalAnalyzer') const OssIndexAnalyzer = () => import('@/views/administration/analyzers/OssIndexAnalyzer') @@ -336,6 +337,16 @@ function configRoutes() { permission: 'SYSTEM_CONFIGURATION' }, }, + { + path: 'configuration/riskscore', + component: RiskScore, + meta: { + title: i18n.t('message.administration'), + i18n: 'message.administration', + sectionPath: '/admin', + permission: 'SYSTEM_CONFIGURATION' + }, + }, { path: 'analyzers/internal', alias: ['analyzers'], diff --git a/src/views/administration/AdminMenu.vue b/src/views/administration/AdminMenu.vue index b9973395..16773556 100644 --- a/src/views/administration/AdminMenu.vue +++ b/src/views/administration/AdminMenu.vue @@ -82,6 +82,11 @@ import { ACCESS_MANAGEMENT, SYSTEM_CONFIGURATION } from "../../shared/permission component: 'Search', name: this.$t('message.search'), route: "configuration/search" + }, + { + component: 'RiskScore', + name: this.$t('message.risk_score'), + route: "configuration/RiskScore" } ] }, diff --git a/src/views/administration/Administration.vue b/src/views/administration/Administration.vue index 52403f87..e00f369b 100644 --- a/src/views/administration/Administration.vue +++ b/src/views/administration/Administration.vue @@ -26,6 +26,7 @@ import InternalComponents from "./configuration/InternalComponents"; import Jira from "./configuration/JiraConfig"; import Search from "./configuration/Search.vue"; import TaskScheduler from "./configuration/TaskScheduler.vue"; +import RiskScore from "./configuration/RiskScore.vue"; // Analyzer plugins import InternalAnalyzer from "./analyzers/InternalAnalyzer"; import OssIndexAnalyzer from "./analyzers/OssIndexAnalyzer"; @@ -67,7 +68,7 @@ export default { components: { EventBus, AdminMenu, - General, BomFormats, Email, Jira, InternalComponents, TaskScheduler, Search, + General, BomFormats, Email, Jira, InternalComponents, TaskScheduler, Search, RiskScore, InternalAnalyzer, OssIndexAnalyzer, VulnDbAnalyzer, SnykAnalyzer, VulnSourceNvd, VulnSourceGitHubAdvisories, VulnSourceOSVAdvisories, Cargo, Composer, Gem, GitHub, GoModules, Hex, Maven, Npm, Cpan, Nuget, Python, diff --git a/src/views/administration/configuration/RiskScore.vue b/src/views/administration/configuration/RiskScore.vue new file mode 100644 index 00000000..005c2a50 --- /dev/null +++ b/src/views/administration/configuration/RiskScore.vue @@ -0,0 +1,160 @@ + + + \ No newline at end of file From 7622b08f89d233f5aae87eaddf11b0be61887fff Mon Sep 17 00:00:00 2001 From: leec94 Date: Fri, 14 Jun 2024 09:08:01 -0400 Subject: [PATCH 2/3] change propertyvalues to weight Signed-off-by: leec94 --- .../configuration/RiskScore.vue | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/views/administration/configuration/RiskScore.vue b/src/views/administration/configuration/RiskScore.vue index 005c2a50..d703a642 100644 --- a/src/views/administration/configuration/RiskScore.vue +++ b/src/views/administration/configuration/RiskScore.vue @@ -6,7 +6,7 @@

{{ $t('admin.index_risk_score_weighting_description') }}

- {{$t('admin.enable_risk_score_history_check')}} + {{$t('admin.enable_risk_score_history_check')}} Date: Mon, 17 Jun 2024 10:06:19 -0400 Subject: [PATCH 3/3] address feedback Signed-off-by: leec94 --- src/i18n/locales/en.json | 6 +++--- .../configuration/RiskScore.vue | 20 +++---------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 16f47965..d08a5544 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -806,9 +806,9 @@ "index_general_description": "Dependency Track uses Apache Lucene to enable full-text search on various entities like projects or vulnerabilities.", "index_use_cases": "The full-text search feature is principally used for the search API (i.e. all the indexes) and internal analyzer fuzzy matching on CPE (i.e. the vulnerable software index).", "index_issues_description": "The lucene indexes can degrade or drift from Dependency Track database over time. Even though DT does its best to minimize the drift, the administrative features below are provided to check or restore the indexes if need be. It must be used with caution.", - "index_risk_score_description": "Dependency Track calculates the risk score of each project as a weighted severity score using the following calculation as default: ", - "index_risk_score_calc": "((critical * 10) + (high * 5) + (medium * 3) + (low * 1) + (unassigned * 5))", - "index_risk_score_weighting_description": "You can customize the weighting of each severity to customize the risk score.", + "risk_score_description": "Dependency Track calculates the risk score of each project as a weighted severity score using the following calculation as default: ", + "risk_score_calc": "((critical * 10) + (high * 5) + (medium * 3) + (low * 1) + (unassigned * 5))", + "risk_score_weighting_description": "You can customize the weighting of each severity to customize the risk score.", "enable_risk_score_history_check": "Recalculate risk score weighting on project history", "risk_score_weight_critical": "Critical (default: 10)", "risk_score_weight_high": "High (default: 5)", diff --git a/src/views/administration/configuration/RiskScore.vue b/src/views/administration/configuration/RiskScore.vue index d703a642..54609054 100644 --- a/src/views/administration/configuration/RiskScore.vue +++ b/src/views/administration/configuration/RiskScore.vue @@ -1,11 +1,11 @@