Skip to content

Commit

Permalink
add Composer data source admin info page
Browse files Browse the repository at this point in the history
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
  • Loading branch information
valentijnscholten committed Jan 11, 2025
1 parent 1a0b7cc commit e55ff49
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@
"vulnsource_osv_base_url": "OSV Base URL",
"welcome_message": "Welcome Message",
"welcome_message_desc": "Customize the welcome message that appears on the start page of Dependency-Track before users sign in.",
"welcome_message_enable": "Enable welcome message"
"welcome_message_enable": "Enable welcome message",
"composer_advisories": "Composer Security Advisories",
"vulnsource_composer_advisories_desc": "The Composer ecosystem provides security advisories via its Composer repositories. Examples are https://packagist.org and https://packages.drupal.org/8. These security advisories are used by Composer to provide the composer audit command.",
"vulnsource_composer_to_enable": "Composer advisory mirroring can be enabled for a repository via it configuration:",
"composer_repositories": "Composer Repositories",
"documentation": "Documentation"
},
"condition": {
"forbidden": "Forbidden (403)",
Expand Down
13 changes: 13 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ const VulnSourceGitHubAdvisories = () =>
import('@/views/administration/vuln-sources/VulnSourceGitHubAdvisories');
const VulnSourceOSVAdvisories = () =>
import('@/views/administration/vuln-sources/VulnSourceOSVAdvisories');
const VulnSourceComposerAdvisories = () =>
import('@/views/administration/vuln-sources/VulnSourceComposerAdvisories');

const Cargo = () => import('@/views/administration/repositories/Cargo');
const Composer = () => import('@/views/administration/repositories/Composer');
Expand Down Expand Up @@ -552,6 +554,17 @@ function configRoutes() {
permission: 'SYSTEM_CONFIGURATION',
},
},
{
path: 'vulnerabilitySources/composer',
component: VulnSourceComposerAdvisories,
meta: {
title: i18n.t('message.administration'),
i18n: 'message.administration',
sectionPath: '/admin',
sectionName: 'Admin',
permission: 'SYSTEM_CONFIGURATION',
},
},
{
path: 'repositories/cargo',
alias: ['repositories'],
Expand Down
5 changes: 5 additions & 0 deletions src/views/administration/AdminMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ export default {
name: this.$t('admin.osv_advisories'),
route: 'vulnerabilitySources/osv',
},
{
component: 'VulnSourceComposerAdvisories',
name: this.$t('admin.composer_advisories'),
route: 'vulnerabilitySources/composer',
},
],
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/views/administration/Administration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ import VulnDbAnalyzer from './analyzers/VulnDbAnalyzer';
import VulnSourceGitHubAdvisories from './vuln-sources/VulnSourceGitHubAdvisories';
import VulnSourceNvd from './vuln-sources/VulnSourceNvd';
import VulnSourceOSVAdvisories from './vuln-sources/VulnSourceOSVAdvisories';
import VulnSourceComposerAdvisories from './vuln-sources/VulnSourceComposerAdvisories';
// Repositories
import Cargo from './repositories/Cargo';
import Composer from './repositories/Composer';
Expand Down Expand Up @@ -89,6 +91,7 @@ export default {
VulnSourceNvd,
VulnSourceGitHubAdvisories,
VulnSourceOSVAdvisories,
VulnSourceComposerAdvisories,
Cargo,
Composer,
Gem,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<template>
<b-card no-body>
<b-card-body>
<img alt="Composer logo" src="@/assets/img/composer-logo.png" />
<hr />
{{ $t('admin.vulnsource_composer_advisories_desc') }}
<hr />
{{ $t('admin.vulnsource_composer_to_enable') }}
<a href="/admin/repositories/composer">
{{ $t('admin.composer_repositories') }} </a
>.
<hr />
{{ $t('admin.documentation') }}
<a href="https://docs.dependencytrack.org/datasources/composer/"
>https://docs.dependencytrack.org/datasources/composer/</a
>.
</b-card-body>
</b-card>
</template>

0 comments on commit e55ff49

Please sign in to comment.