Skip to content

feat(analyzer): add option to ignore severity reported by Trivy scan #1268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"analyzer_snyk_why_multiple_cvss": "Why are there multiple CVSS Scores for the same vulnerability?",
"analyzer_trivy_enable": "Enable Trivy analyzer",
"analyzer_trivy_ignore_unfixed": "Ignore unfixed vulnerabilities",
"analyzer_trivy_ignore_severity": "Ignore severity reported by Trivy scan",
"analyzer_trivy_scan_library": "Scan language-specific packages (e.g. packages installed by pip, npm, or gem)",
"analyzer_trivy_scan_os": "Scan OS packages managed by the OS package manager (e.g. dpkg, yum, apk)",
"analyzer_vulndb_desc": "VulnDB is a commercial service from Risk Based Security which identifies vulnerabilities in third-party components. Dependency-Track integrates natively with the VulnDB service to provide highly accurate results. Use of this analyzer requires a valid CPE for the components being analyzed.",
Expand Down
18 changes: 18 additions & 0 deletions src/views/administration/analyzers/TrivyAnalyzer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@
v-bind="labelIcon"
/>
{{ $t('admin.analyzer_trivy_scan_os') }}
<br />
<c-switch
id="ignoreSeverity"
color="primary"
v-model="ignoreSeverity"
label
v-bind="labelIcon"
/>
{{ $t('admin.analyzer_trivy_ignore_severity') }}
</b-card-body>
<b-card-footer>
<b-button
Expand Down Expand Up @@ -91,6 +100,7 @@ export default {
ignoreUnfixed: false,
scanLibrary: true,
scanOs: true,
ignoreSeverity: true,
};
},
methods: {
Expand Down Expand Up @@ -126,6 +136,11 @@ export default {
propertyName: 'trivy.scanner.scanOs',
propertyValue: this.scanOs,
},
{
groupName: 'scanner',
propertyName: 'trivy.ignore.severity',
propertyValue: this.ignoreSeverity,
},
]);
},
},
Expand Down Expand Up @@ -155,6 +170,9 @@ export default {
case 'trivy.scanner.scanOs':
this.scanOs = common.toBoolean(item.propertyValue);
break;
case 'trivy.ignore.severity':
this.ignoreSeverity = common.toBoolean(item.propertyValue);
break;
}
}
});
Expand Down