Skip to content

Commit 8f17d06

Browse files
committed
enable google osv flag
Signed-off-by: Sahiba Mittal <[email protected]>
1 parent 12c67b7 commit 8f17d06

File tree

4 files changed

+84
-1
lines changed

4 files changed

+84
-1
lines changed

src/i18n/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@
384384
"nvd": "NVD",
385385
"national_vulnerability_database": "National Vulnerability Database",
386386
"github_advisories": "GitHub Advisories",
387+
"osv_advisories": "Google OSV Advisories",
387388
"repositories": "Repositories",
388389
"cargo": "Cargo",
389390
"composer": "Composer",
@@ -445,6 +446,8 @@
445446
"vulnsource_nvd_feeds_url": "NVD Feeds URL",
446447
"vulnsource_github_advisories_enable": "Enable GitHub Advisory mirroring",
447448
"vulnsource_github_advisories_desc": "GitHub Advisories (GHSA) is a database of CVEs and GitHub-originated security advisories affecting the open source world. Dependency-Track integrates with GHSA by mirroring advisories via GitHub's public GraphQL API. The mirror is refreshed daily, or upon restart of the Dependency-Track instance. A personal access token (PAT) is required in order to authenticate with GitHub, but no scopes need to be assigned to it.",
449+
"vulnsource_osv_advisories_enable": "Enable Google OSV Advisory mirroring",
450+
"vulnsource_osv_advisories_desc": "Google OSV is a distributed vulnerability and triage infrastructure for open source projects aimed at helping both open source maintainers and consumers of open source. It serves as an aggregator of vulnerability databases that have adopted the OpenSSF Vulnerability format.",
448451
"registered_email_address": "Registered email address",
449452
"api_token": "API token",
450453
"consumer_key": "Consumer key",

src/views/administration/AdminMenu.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@
9797
component: "VulnSourceGitHubAdvisories",
9898
name: this.$t('admin.github_advisories'),
9999
href: "#vulnsourceGitHubAdvisoriesTab"
100+
},
101+
{
102+
component: "VulnSourceOSVAdvisories",
103+
name: this.$t('admin.osv_advisories'),
104+
href: "#vulnsourceOSVAdvisoriesTab"
100105
}
101106
]
102107
},

src/views/administration/Administration.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
// Vulnerability sources
3131
import VulnSourceNvd from "./vuln-sources/VulnSourceNvd";
3232
import VulnSourceGitHubAdvisories from "./vuln-sources/VulnSourceGitHubAdvisories";
33+
import VulnSourceOSVAdvisories from "./vuln-sources/VulnSourceOSVAdvisories";
3334
// Repositories
3435
import Cargo from "./repositories/Cargo";
3536
import Composer from "./repositories/Composer";
@@ -62,7 +63,7 @@
6263
AdminMenu,
6364
General, BomFormats, Email, InternalComponents,
6465
InternalAnalyzer, OssIndexAnalyzer, VulnDbAnalyzer,
65-
VulnSourceNvd, VulnSourceGitHubAdvisories,
66+
VulnSourceNvd, VulnSourceGitHubAdvisories, VulnSourceOSVAdvisories,
6667
Cargo, Composer, Gem, GoModules, Hex, Maven, Npm, Nuget, Python,
6768
Alerts, Templates,
6869
FortifySsc, DefectDojo, KennaSecurity,
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<template>
2+
<b-card no-body :header="header">
3+
<b-card-body>
4+
<hr/>
5+
<c-switch
6+
:disabled="!this.vulnsourceEnabled"
7+
color="primary"
8+
id="vulnsourceEnabled"
9+
label
10+
v-bind="labelIcon"
11+
v-model="vulnsourceEnabled"
12+
/>
13+
{{$t('admin.vulnsource_osv_advisories_enable')}}
14+
<hr/>
15+
{{ $t('admin.vulnsource_osv_advisories_desc') }}
16+
</b-card-body>
17+
<b-card-footer>
18+
<b-button
19+
:disabled="this.vulnsourceEnabled"
20+
@click="saveChanges"
21+
class="px-4"
22+
variant="outline-primary">
23+
{{ $t('message.update') }}
24+
</b-button>
25+
</b-card-footer>
26+
</b-card>
27+
</template>
28+
29+
<script>
30+
import { Switch as cSwitch } from '@coreui/vue';
31+
import BValidatedInputGroupFormInput from '../../../forms/BValidatedInputGroupFormInput';
32+
import common from "../../../shared/common";
33+
import configPropertyMixin from "../mixins/configPropertyMixin";
34+
35+
export default {
36+
mixins: [configPropertyMixin],
37+
props: {
38+
header: String
39+
},
40+
components: {
41+
cSwitch,
42+
BValidatedInputGroupFormInput
43+
},
44+
data() {
45+
return {
46+
vulnsourceEnabled: false,
47+
apitoken: '',
48+
labelIcon: {
49+
dataOn: '\u2713',
50+
dataOff: '\u2715'
51+
},
52+
}
53+
},
54+
methods: {
55+
saveChanges: function() {
56+
this.updateConfigProperties([
57+
{groupName: 'vuln-source', propertyName: 'google.osv.enabled', propertyValue: this.vulnsourceEnabled}
58+
]);
59+
}
60+
},
61+
created () {
62+
this.axios.get(this.configUrl).then((response) => {
63+
let configItems = response.data.filter(function (item) { return item.groupName === "vuln-source" });
64+
for (let i=0; i<configItems.length; i++) {
65+
let item = configItems[i];
66+
switch (item.propertyName) {
67+
case "google.osv.enabled":
68+
this.vulnsourceEnabled = common.toBoolean(item.propertyValue); break;
69+
}
70+
}
71+
});
72+
}
73+
}
74+
</script>

0 commit comments

Comments
 (0)