Skip to content

Commit

Permalink
Rename "CVSS" to "CVSSv3"
Browse files Browse the repository at this point in the history
Signed-off-by: RBickert <[email protected]>
  • Loading branch information
rbt-mm committed Aug 23, 2023
1 parent b8185cd commit 215ed78
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 60 deletions.
59 changes: 30 additions & 29 deletions src/views/globalAudit/VulnerabilityAuditByOccurrence.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
stacked>
</b-form-checkbox-group>
</b-form-group>
<b-form-group id="cvss-form-group" :label="this.$t('message.cvss')">
<b-form-group id="cvssv3-form-group" :label="this.$t('message.cvss_v3')">
<b-form-row>
<b-col><b-form-input id="cvss-from-form-input" v-model="cvssFrom" type="number" min="0" :max="cvssUpperLimit()" step="0.1" debounce="750" :state="cvssFromState()" :placeholder="this.$t('message.from')"></b-form-input></b-col>
<b-col><b-form-input id="cvss-to-form-input" v-model="cvssTo" type="number" :min="cvssLowerLimit()" max="10" step="0.1" debounce="750" :state="cvssToState()" :placeholder="this.$t('message.to')"></b-form-input></b-col>
<b-col><b-form-input id="cvssv3-from-form-input" v-model="cvssv3From" type="number" min="0" :max="cvssv3UpperLimit()" step="0.1" debounce="750" :state="cvssv3FromState()" :placeholder="this.$t('message.from')"></b-form-input></b-col>
<b-col><b-form-input id="cvssv3-to-form-input" v-model="cvssv3To" type="number" :min="cvssv3LowerLimit()" max="10" step="0.1" debounce="750" :state="cvssv3ToState()" :placeholder="this.$t('message.to')"></b-form-input></b-col>
</b-form-row>
</b-form-group>
</div>
Expand Down Expand Up @@ -117,13 +117,13 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
this.refreshTable();
}
});
this.cvssFromWatcher = this.$watch('cvssFrom', () => {
if (this.cvssFromState() !== false) {
this.cvssv3FromWatcher = this.$watch('cvssv3From', () => {
if (this.cvssv3FromState() !== false) {
this.refreshTable();
}
});
this.cvssToWatcher = this.$watch('cvssTo', () => {
if (this.cvssToState() !== false) {
this.cvssv3ToWatcher = this.$watch('cvssv3To', () => {
if (this.cvssv3ToState() !== false) {
this.refreshTable();
}
});
Expand Down Expand Up @@ -155,20 +155,20 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
if (this.textSearchInput && this.textSearchInput.trim().length > 0) {
url += "&textSearchField=" + this.textSearchSelected + "&textSearchInput=" + this.textSearchInput.trim();
}
if (this.cvssFrom && this.cvssFrom.trim().length > 0) {
url += "&cvssFrom=" + this.cvssFrom;
if (this.cvssv3From && this.cvssv3From.trim().length > 0) {
url += "&cvssv3From=" + this.cvssv3From;
}
if (this.cvssTo && this.cvssTo.trim().length > 0) {
url += "&cvssTo=" + this.cvssTo;
if (this.cvssv3To && this.cvssv3To.trim().length > 0) {
url += "&cvssv3To=" + this.cvssv3To;
}
return url;
},
clearAllFilters: function () {
this.simpleWatcher();
this.textSearchSelectedWatcher();
this.textSearchInputWatcher();
this.cvssFromWatcher();
this.cvssToWatcher();
this.cvssv3FromWatcher();
this.cvssv3ToWatcher();
this.showInactive = false;
this.showSuppressed = false;
this.severitySelected = [];
Expand All @@ -180,33 +180,34 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
this.attributedOnDateTo = '';
this.textSearchInput = '';
this.textSearchSelected = this.textSearchOptions.map(option => option.value);
this.cvssFrom = '';
this.cvssTo = '';
this.cvssv3From = '';
this.cvssv3To = '';
this.refreshTable();
this.initializeWatchers();
},
refreshTable: function() {
this.$refs.table.refresh({
url: this.apiUrl(),
silent: true
silent: true,
pageNumber: 1
});
},
initializeTooltips: function () {
$('[data-toggle="tooltip"]').tooltip({
trigger: "hover"
});
},
cvssUpperLimit: function () {
return this.cvssTo ? this.cvssTo : 10;
cvssv3UpperLimit: function () {
return this.cvssv3To ? this.cvssv3To : 10;
},
cvssLowerLimit: function () {
return this.cvssFrom ? this.cvssFrom : 0;
cvssv3LowerLimit: function () {
return this.cvssv3From ? this.cvssv3From : 0;
},
cvssFromState() {
return this.cvssFrom ? (!isNaN(this.cvssFrom) && (!this.cvssTo || !isNaN(this.cvssTo) || this.cvssFrom <= this.cvssTo) && this.cvssFrom <= 10 && this.cvssFrom >= 0) : null;
cvssv3FromState() {
return this.cvssv3From ? (!isNaN(this.cvssv3From) && (!this.cvssv3To || !isNaN(this.cvssv3To) || this.cvssv3From <= this.cvssv3To) && this.cvssv3From <= 10 && this.cvssv3From >= 0) : null;
},
cvssToState() {
return this.cvssTo ? (!isNaN(this.cvssTo) && (!this.cvssFrom || !isNaN(this.cvssFrom) || this.cvssTo >= this.cvssFrom) && this.cvssTo <= 10 && this.cvssTo >= 0) : null;
cvssv3ToState() {
return this.cvssv3To ? (!isNaN(this.cvssv3To) && (!this.cvssv3From || !isNaN(this.cvssv3From) || this.cvssv3To >= this.cvssv3From) && this.cvssv3To <= 10 && this.cvssv3To >= 0) : null;
},
onLoadSuccess: function () {
loadUserPreferencesForBootstrapTable(this, "VulnerabilityAuditByOccurrence", this.$refs.table.columns);
Expand All @@ -217,8 +218,8 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
simpleWatcher: null,
textSearchSelectedWatcher: null,
textSearchInputWatcher: null,
cvssFromWatcher: null,
cvssToWatcher: null,
cvssv3FromWatcher: null,
cvssv3ToWatcher: null,
showInactive: false,
showSuppressed: false,
severitySelected: [],
Expand Down Expand Up @@ -260,8 +261,8 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
{ text: 'Project Name', value: 'project_name' }
],
textSearchSelected: [],
cvssFrom: '',
cvssTo: '',
cvssv3From: '',
cvssv3To: '',
columns: [
{
title: this.$t('message.vulnerability'),
Expand Down Expand Up @@ -325,7 +326,7 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
}
},
{
title: this.$t('message.cvss'),
title: this.$t('message.cvss_v3'),
field: "vulnerability.cvssV3BaseScore",
sortable: true,
formatter(value, row, index) {
Expand Down
63 changes: 32 additions & 31 deletions src/views/globalAudit/VulnerabilityAuditGroupedByVulnerability.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
stacked>
</b-form-checkbox-group>
</b-form-group>
<b-form-group id="grouped-cvss-form-group" :label="this.$t('message.cvss')">
<b-form-group id="grouped-cvssv3-form-group" :label="this.$t('message.cvss_v3')">
<b-form-row>
<b-col><b-form-input id="grouped-cvss-from-form-input" v-model="cvssFrom" type="number" min="0" :max="cvssUpperLimit()" step="0.1" debounce="750" :state="cvssFromState()" :placeholder="this.$t('message.from')"></b-form-input></b-col>
<b-col><b-form-input id="grouped-cvss-to-form-input" v-model="cvssTo" type="number" :min="cvssLowerLimit()" max="10" step="0.1" debounce="750" :state="cvssToState()" :placeholder="this.$t('message.to')"></b-form-input></b-col>
<b-col><b-form-input id="grouped-cvssv3-from-form-input" v-model="cvssv3From" type="number" min="0" :max="cvssv3UpperLimit()" step="0.1" debounce="750" :state="cvssv3FromState()" :placeholder="this.$t('message.from')"></b-form-input></b-col>
<b-col><b-form-input id="grouped-cvssv3-to-form-input" v-model="cvssv3To" type="number" :min="cvssv3LowerLimit()" max="10" step="0.1" debounce="750" :state="cvssv3ToState()" :placeholder="this.$t('message.to')"></b-form-input></b-col>
</b-form-row>
</b-form-group>
<b-form-group id="occurrences-form-group" :label="this.$t('message.occurrences_in_projects')">
Expand Down Expand Up @@ -90,13 +90,13 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
this.refreshTable();
}
});
this.cvssFromWatcher = this.$watch('cvssFrom', () => {
if (this.cvssFromState() !== false) {
this.cvssv3FromWatcher = this.$watch('cvssv3From', () => {
if (this.cvssv3FromState() !== false) {
this.refreshTable();
}
});
this.cvssToWatcher = this.$watch('cvssTo', () => {
if (this.cvssToState() !== false) {
this.cvssv3ToWatcher = this.$watch('cvssv3To', () => {
if (this.cvssv3ToState() !== false) {
this.refreshTable();
}
});
Expand Down Expand Up @@ -126,11 +126,11 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
if (this.textSearchInput && this.textSearchInput.trim().length > 0) {
url += "&textSearchField=" + this.textSearchSelected + "&textSearchInput=" + this.textSearchInput.trim();
}
if (this.cvssFrom && this.cvssFrom.trim().length > 0) {
url += "&cvssFrom=" + this.cvssFrom;
if (this.cvssv3From && this.cvssv3From.trim().length > 0) {
url += "&cvssv3From=" + this.cvssv3From;
}
if (this.cvssTo && this.cvssTo.trim().length > 0) {
url += "&cvssTo=" + this.cvssTo;
if (this.cvssv3To && this.cvssv3To.trim().length > 0) {
url += "&cvssv3To=" + this.cvssv3To;
}
if (this.occurrencesFrom && this.occurrencesFrom.trim().length > 0) {
url += "&occurrencesFrom=" + this.occurrencesFrom;
Expand All @@ -144,8 +144,8 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
this.simpleWatcher();
this.textSearchSelectedWatcher();
this.textSearchInputWatcher();
this.cvssFromWatcher();
this.cvssToWatcher();
this.cvssv3FromWatcher();
this.cvssv3ToWatcher();
this.occurrencesFromWatcher();
this.occurrencesToWatcher();
this.showInactive = false;
Expand All @@ -154,8 +154,8 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
this.publishDateTo = '';
this.textSearchInput = '';
this.textSearchSelected = this.textSearchOptions.map(option => option.value);
this.cvssFrom = '';
this.cvssTo = '';
this.cvssv3From = '';
this.cvssv3To = '';
this.occurrencesFrom = '';
this.occurrencesTo = '';
this.refreshTable();
Expand All @@ -164,20 +164,21 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
refreshTable: function() {
this.$refs.table.refresh({
url: this.apiUrl(),
silent: true
silent: true,
pageNumber: 1
});
},
cvssUpperLimit: function () {
return this.cvssTo ? this.cvssTo : 10;
cvssv3UpperLimit: function () {
return this.cvssv3To ? this.cvssv3To : 10;
},
cvssLowerLimit: function () {
return this.cvssFrom ? this.cvssFrom : 0;
cvssv3LowerLimit: function () {
return this.cvssv3From ? this.cvssv3From : 0;
},
cvssFromState() {
return this.cvssFrom ? (!isNaN(this.cvssFrom) && (!this.cvssTo || !isNaN(this.cvssTo) || this.cvssFrom <= this.cvssTo) && this.cvssFrom <= 10) : null;
cvssv3FromState() {
return this.cvssv3From ? (!isNaN(this.cvssv3From) && (!this.cvssv3To || !isNaN(this.cvssv3To) || this.cvssv3From <= this.cvssv3To) && this.cvssv3From <= 10) : null;
},
cvssToState() {
return this.cvssTo ? (!isNaN(this.cvssTo) && (!this.cvssFrom || !isNaN(this.cvssFrom) || this.cvssTo >= this.cvssFrom) && this.cvssTo >= 0) : null;
cvssv3ToState() {
return this.cvssv3To ? (!isNaN(this.cvssv3To) && (!this.cvssv3From || !isNaN(this.cvssv3From) || this.cvssv3To >= this.cvssv3From) && this.cvssv3To >= 0) : null;
},
occurrencesUpperLimit: function () {
return this.occurrencesTo ? this.occurrencesTo : null;
Expand All @@ -186,10 +187,10 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
return this.occurrencesFrom ? this.occurrencesFrom : 0;
},
occurrencesFromState: function () {
return this.occurrencesFrom ? (!isNaN(this.occurrencesFrom) && (!this.occurrencesTo || !isNaN(this.occurrencesTo) || this.occurrencesFrom <= this.occurrencesTo) && this.cvssFrom >= 0) : null;
return this.occurrencesFrom ? (!isNaN(this.occurrencesFrom) && (!this.occurrencesTo || !isNaN(this.occurrencesTo) || this.occurrencesFrom <= this.occurrencesTo) && this.cvssv3From >= 0) : null;
},
occurrencesToState: function () {
return this.occurrencesTo ? (!isNaN(this.occurrencesTo) && (!this.occurrencesFrom || !isNaN(this.occurrencesFrom) || this.occurrencesTo >= this.occurrencesFrom) && this.cvssTo >= 0) : null;
return this.occurrencesTo ? (!isNaN(this.occurrencesTo) && (!this.occurrencesFrom || !isNaN(this.occurrencesFrom) || this.occurrencesTo >= this.occurrencesFrom) && this.cvssv3To >= 0) : null;
},
onLoadSuccess: function () {
loadUserPreferencesForBootstrapTable(this, "VulnerabilityAuditGroupedByVulnerability", this.$refs.table.columns);
Expand All @@ -200,8 +201,8 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
simpleWatcher: null,
textSearchSelectedWatcher: null,
textSearchInputWatcher: null,
cvssFromWatcher: null,
cvssToWatcher: null,
cvssv3FromWatcher: null,
cvssv3ToWatcher: null,
occurrencesFromWatcher: null,
occurrencesToWatcher: null,
showInactive: false,
Expand All @@ -224,8 +225,8 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
{ text: 'Project Name', value: 'project_name' }
],
textSearchSelected: [],
cvssFrom: '',
cvssTo: '',
cvssv3From: '',
cvssv3To: '',
occurrencesFrom: '',
occurrencesTo: '',
columns: [
Expand Down Expand Up @@ -291,7 +292,7 @@ import {loadUserPreferencesForBootstrapTable} from "@/shared/utils";
}
},
{
title: this.$t('message.cvss'),
title: this.$t('message.cvss_v3'),
field: "vulnerability.cvssV3BaseScore",
sortable: true,
formatter(value, row, index) {
Expand Down

0 comments on commit 215ed78

Please sign in to comment.