Skip to content

Commit e141e7d

Browse files
committed
Add Fuzzy Config to frontend
Signed-off-by: Drew Thompson <[email protected]>
1 parent 506494c commit e141e7d

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

src/i18n/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@
439439
"internal_identification_queued": "Internal component identification queued",
440440
"internal_identification_error": "An error occurred queueing internal component identification. Check server logs for details",
441441
"analyzer_internal_enable": "Enable internal analyzer",
442+
"analyzer_internal_fuzzy_enable": "Enable fuzzy CPE matching. Helps with inconsistent NVD data, highlighting missing risks but also increasing false positives",
443+
"analyzer_internal_fuzzy_exclude_purl": "Enable fuzzy CPE matching on components that have a Package URL (PURL) defined",
444+
"analyzer_internal_fuzzy_exclude_internal": "Enable fuzzy CPE matching on internal components",
442445
"analyzer_internal_desc": "The internal analyzer evaluates components against an internal vulnerability database derived from the National Vulnerability Database, GitHub Advisories (if enabled) and VulnDB (if enabled). This analyzer makes use of the Common Platform Enumeration (CPE) defined in components. Components with a valid CPE will be evaluated with this analyzer.",
443446
"analyzer_ossindex_enable": "Enable OSS Index analyzer",
444447
"analyzer_ossindex_desc": "OSS Index is a service provided by Sonatype which identifies vulnerabilities in third-party components. Dependency-Track integrates natively with the OSS Index service to provide highly accurate results. Use of this analyzer requires a valid PackageURL for the components being analyzed.",

src/views/administration/analyzers/InternalAnalyzer.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<b-card no-body :header="header">
33
<b-card-body>
44
<c-switch id="scannerEnabled" color="primary" v-model="scannerEnabled" label v-bind="labelIcon" />{{$t('admin.analyzer_internal_enable')}}
5-
<!--
65
<br/>
76
<c-switch id="scannerCpeFuzzyEnableInput" color="primary" v-model="scannerCpeFuzzyEnableInput" label v-bind="labelIcon" />{{$t('admin.analyzer_internal_fuzzy_enable')}}
87
<br/>
98
<c-switch id="scannerCpeFuzzyExcludePurlInput" color="primary" v-model="scannerCpeFuzzyExcludePurlInput" label v-bind="labelIcon" />{{$t('admin.analyzer_internal_fuzzy_exclude_purl')}}
10-
-->
9+
<br/>
10+
<c-switch id="scannerCpeFuzzyExcludeInternalInput" color="primary" v-model="scannerCpeFuzzyExcludeInternalInput" label v-bind="labelIcon" />{{$t('admin.analyzer_internal_fuzzy_exclude_internal')}}
1111
<hr/>
1212
{{ $t('admin.analyzer_internal_desc') }}
1313
</b-card-body>
@@ -34,7 +34,8 @@
3434
return {
3535
scannerEnabled: false,
3636
scannerCpeFuzzyEnableInput: false,
37-
scannerCpeFuzzyExcludePurlInput: false,
37+
scannerCpeFuzzyExcludePurlInput: true,
38+
scannerCpeFuzzyExcludeInternalInput: true,
3839
labelIcon: {
3940
dataOn: '\u2713',
4041
dataOff: '\u2715'
@@ -44,11 +45,15 @@
4445
methods: {
4546
saveChanges: function() {
4647
this.updateConfigProperties([
47-
{groupName: 'scanner', propertyName: 'internal.enabled', propertyValue: this.scannerEnabled}
48-
// TODO: Future
49-
// {groupName: 'scanner', propertyName: 'internal.fuzzy.enabled', propertyValue: this.fuzzyEnabled}
50-
// {groupName: 'scanner', propertyName: 'internal.fuzzy.exclude.purl', propertyValue: this.fuzzyExcludePurl}
48+
{groupName: 'scanner', propertyName: 'internal.enabled', propertyValue: this.scannerEnabled},
49+
{groupName: 'scanner', propertyName: 'internal.fuzzy.enabled', propertyValue: this.scannerCpeFuzzyEnableInput},
50+
{groupName: 'scanner', propertyName: 'internal.fuzzy.exclude.purl', propertyValue: !this.scannerCpeFuzzyEnableInput || !this.scannerCpeFuzzyExcludePurlInput},
51+
{groupName: 'scanner', propertyName: 'internal.fuzzy.exclude.internal', propertyValue: !this.scannerCpeFuzzyEnableInput || !this.scannerCpeFuzzyExcludeInternalInput}
5152
]);
53+
if (!this.scannerCpeFuzzyEnableInput){
54+
this.scannerCpeFuzzyExcludePurlInput = false;
55+
this.scannerCpeFuzzyExcludeInternalInput = false;
56+
}
5257
}
5358
},
5459
created () {
@@ -62,7 +67,9 @@
6267
case "internal.fuzzy.enabled":
6368
this.scannerCpeFuzzyEnableInput = common.toBoolean(item.propertyValue); break;
6469
case "internal.fuzzy.exclude.purl":
65-
this.scannerCpeFuzzyExcludePurlInput = common.toBoolean(item.propertyValue); break;
70+
this.scannerCpeFuzzyExcludePurlInput = !common.toBoolean(item.propertyValue); break;
71+
case "internal.fuzzy.exclude.internal":
72+
this.scannerCpeFuzzyExcludeInternalInput = !common.toBoolean(item.propertyValue); break;
6673
}
6774
}
6875
});

0 commit comments

Comments
 (0)