diff --git a/.github/workflows/_meta-build.yaml b/.github/workflows/_meta-build.yaml index 9636d12b4..c31f295d9 100644 --- a/.github/workflows/_meta-build.yaml +++ b/.github/workflows/_meta-build.yaml @@ -14,13 +14,13 @@ on: app-version: type: string required: false - default: "snapshot" - description: "Set the version that should be set/used as tag for the container image" + default: 'snapshot' + description: 'Set the version that should be set/used as tag for the container image' publish-container: type: boolean required: false default: false - description: "Set if the container image gets publish and scan once its build" + description: 'Set if the container image gets publish and scan once its build' secrets: registry-0-usr: required: true diff --git a/.github/workflows/ci-release.yaml b/.github/workflows/ci-release.yaml index 6b1a71740..740ea2e58 100644 --- a/.github/workflows/ci-release.yaml +++ b/.github/workflows/ci-release.yaml @@ -6,7 +6,7 @@ on: version-to-bump: type: choice required: true - description: "Select which part of the version to bump and release" + description: 'Select which part of the version to bump and release' options: - patch - minor @@ -41,7 +41,7 @@ jobs: - name: Create GitHub Release env: GITHUB_TOKEN: ${{ secrets.BOT_RELEASE_TOKEN }} - GH_OPTS: "" + GH_OPTS: '' run: |- VERSION=`jq -r '.version' package.json` diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml index 1433cf3af..dd1279d6c 100644 --- a/.github/workflows/codeql-analysis.yaml +++ b/.github/workflows/codeql-analysis.yaml @@ -1,4 +1,4 @@ -name: "CodeQL" +name: 'CodeQL' on: push: @@ -25,34 +25,34 @@ jobs: # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection steps: - - name: Checkout repository - uses: actions/checkout@v4.1.1 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Checkout repository + uses: actions/checkout@v4.1.1 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.postcssrc.js b/.postcssrc.js index 100cc0124..a47ef4f95 100644 --- a/.postcssrc.js +++ b/.postcssrc.js @@ -1,5 +1,5 @@ module.exports = { plugins: { - autoprefixer: {} - } -} \ No newline at end of file + autoprefixer: {}, + }, +}; diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 2a97dd0df..1147e63ed 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities diff --git a/README.md b/README.md index 01e716f14..70e2ef73e 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,18 @@ [![Build Status](https://github.com/DependencyTrack/frontend/actions/workflows/ci-build.yaml/badge.svg)](https://github.com/DependencyTrack/frontend/actions?workflow=Build+CI) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/364443f9f30c4b70b56e5be76c9e079c)](https://www.codacy.com/gh/DependencyTrack/frontend/dashboard?utm_source=github.com&utm_medium=referral&utm_content=DependencyTrack/frontend&utm_campaign=Badge_Grade) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/364443f9f30c4b70b56e5be76c9e079c)](https://www.codacy.com/gh/DependencyTrack/frontend/dashboard?utm_source=github.com&utm_medium=referral&utm_content=DependencyTrack/frontend&utm_campaign=Badge_Grade) [![License](https://img.shields.io/badge/license-Apache%202.0-brightgreen.svg)][License] [![Latest (including pre-releases)](https://img.shields.io/github/v/release/dependencytrack/frontend?include_prereleases)](https://github.com/DependencyTrack/frontend/releases) -Dependency-Track Front-End -========= +# Dependency-Track Front-End The Front-End is a Single Page Application (SPA) used in Dependency-Track, an open source Component Analysis platform that allows organizations to identify and reduce risk in the software supply chain. The project is built with: -* Vue.js -* Bootstrap Vue -* CoreUI +- Vue.js +- Bootstrap Vue +- CoreUI
@@ -23,28 +22,29 @@ The project is built with: Always use the Front-End version that is compatible with the Dependency-Track API Server in use. -| Dependency-Track API Server | Front-End | -|:-----|:-----| -| v4.2 | v4.2 | -| v4.1 | v1.2 | -| v4.0 | v1.1 | -| v3.8 | v1.0 | -| v1.0 - v3.7.1 | Not supported | +| Dependency-Track API Server | Front-End | +| :-------------------------- | :------------ | +| v4.2 | v4.2 | +| v4.1 | v1.2 | +| v4.0 | v1.1 | +| v3.8 | v1.0 | +| v1.0 - v3.7.1 | Not supported | Starting with Dependency-Track v4.2, the API Server and the Frontend now have the same major and minor (semantic) version. Patch versions however, may continue to be unique. ## Binary Distributions Pre-compiled distributions are available in two variants: -* [Docker container running NGINX](https://hub.docker.com/r/dependencytrack/frontend) -* [GitHub Release (zip archive)](https://github.com/DependencyTrack/frontend/releases) + +- [Docker container running NGINX](https://hub.docker.com/r/dependencytrack/frontend) +- [GitHub Release (zip archive)](https://github.com/DependencyTrack/frontend/releases) The Docker container provides the fastest, most consistent deployment option and is recommended. The Docker container includes NGINX and a pre-deployed Front-End release. ## Build Setup -``` bash +```bash # Install dependencies npm install @@ -85,8 +85,7 @@ This project supports internationalization. Currently, only English language is Note to developers: Textual labels are defined in `src/i18n/locales/{lang}.json`. Ensure that all labels are defined here and that components use i18n, not textual labels directly. -Copyright & License -------------------- +## Copyright & License Dependency-Track is Copyright (c) Steve Springett. All Rights Reserved. diff --git a/RELEASING.md b/RELEASING.md index 2b37e6541..20cc603ae 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -7,15 +7,15 @@ This document describes the process of releasing a new version of the Dependency ### Release a new major of minor version 1. Ensure the current state in `master` is ready to be released -2. Head over to the *Actions* tab in GitHub -3. Select the *Release CI* entry in the *Workflows* section +2. Head over to the _Actions_ tab in GitHub +3. Select the _Release CI_ entry in the _Workflows_ section 4. The following UI element will have a button to trigger the workflow. Once clicked, the Use workflow from dialog will appear: ![Create a release from `master`](./.github/images/release-master.png) 5. Ensure that `master` is selected in the branch dropdown 6. For the part of the version to bump, select either `major` or `minor` (see [Semantic Versioning](https://semver.org/)) -7. Finally, once all inputs are checked press the *Run Workflow* button +7. Finally, once all inputs are checked press the _Run Workflow_ button 8. **Manually** create a release branch by selecting `master` in the branch dropdown and entering the branch name: ![Create a release branch](./.github/images/release-branch.png) @@ -23,12 +23,12 @@ This document describes the process of releasing a new version of the Dependency ### Release a new bugfix version 1. Ensure the current state in the release branch is ready to be released -2. Head over to the *Actions* tab in GitHub -3. Select the *Release CI* entry in the *Workflows* section +2. Head over to the _Actions_ tab in GitHub +3. Select the _Release CI_ entry in the _Workflows_ section 4. The following UI element will have a button to trigger the workflow. Once clicked, the Use workflow from dialog will appear: ![Create a release from a release branch](./.github/images/release-releasebranch.png) 5. Ensure that a release branch (e.g. `4.6.x`) is selected in the branch dropdown 6. For the part of the version to bump, select `patch` (see [Semantic Versioning](https://semver.org/)) -7. Finally, once all inputs are checked press the *Run Workflow* button +7. Finally, once all inputs are checked press the _Run Workflow_ button diff --git a/babel.config.js b/babel.config.js index 8a159c8c3..bcdde9806 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,9 +1,12 @@ module.exports = { presets: [ ['@vue/babel-preset-jsx'], - ['@babel/preset-env', { - 'useBuiltIns': 'entry', - 'corejs': '3.33' - }] - ] -} + [ + '@babel/preset-env', + { + useBuiltIns: 'entry', + corejs: '3.33', + }, + ], + ], +}; diff --git a/package.json b/package.json index 8ea34d38f..c611386a1 100644 --- a/package.json +++ b/package.json @@ -101,4 +101,4 @@ "node": ">= 18", "npm": ">= 9" } -} \ No newline at end of file +} diff --git a/public/static/config.json b/public/static/config.json index d1d2d98bd..65372c445 100644 --- a/public/static/config.json +++ b/public/static/config.json @@ -5,5 +5,5 @@ "OIDC_CLIENT_ID": "", "OIDC_SCOPE": "openid email profile", "OIDC_FLOW": "code", - "OIDC_LOGIN_BUTTON_TEXT" : "" + "OIDC_LOGIN_BUTTON_TEXT": "" } diff --git a/src/App.vue b/src/App.vue index d3cd4c4aa..380c56467 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,136 +3,146 @@ diff --git a/src/containers/DefaultContainer.vue b/src/containers/DefaultContainer.vue index dd7feda0b..acee1809a 100644 --- a/src/containers/DefaultContainer.vue +++ b/src/containers/DefaultContainer.vue @@ -1,63 +1,72 @@ diff --git a/src/containers/DefaultFooter.vue b/src/containers/DefaultFooter.vue index ed868705d..d596dd8ef 100644 --- a/src/containers/DefaultFooter.vue +++ b/src/containers/DefaultFooter.vue @@ -4,29 +4,30 @@
- {{ dtrack.application }}  + {{ dtrack.application }}  v{{ dtrack.version }}
diff --git a/src/containers/DefaultHeader.vue b/src/containers/DefaultHeader.vue index be03e951b..55f47d8f2 100644 --- a/src/containers/DefaultHeader.vue +++ b/src/containers/DefaultHeader.vue @@ -1,24 +1,31 @@ diff --git a/src/containers/DefaultHeaderProfileDropdown.vue b/src/containers/DefaultHeaderProfileDropdown.vue index 368e9c38b..e34b8d2c5 100644 --- a/src/containers/DefaultHeaderProfileDropdown.vue +++ b/src/containers/DefaultHeaderProfileDropdown.vue @@ -1,68 +1,74 @@ diff --git a/src/directives/VuePermission.js b/src/directives/VuePermission.js index 51e4e2a06..fcc24165a 100644 --- a/src/directives/VuePermission.js +++ b/src/directives/VuePermission.js @@ -1,35 +1,35 @@ /* -* Permissions Vue Directive -*/ -import Vue from 'vue' -import {hasPermission, decodeToken, getToken} from '../shared/permissions' + * Permissions Vue Directive + */ +import Vue from 'vue'; +import { hasPermission, decodeToken, getToken } from '../shared/permissions'; -Vue.directive('permission', function(el, binding) { +Vue.directive('permission', function (el, binding) { let decodedToken = decodeToken(getToken()); if (Array.isArray(binding.value)) { let permitted = false; - if (binding.arg === "and") { + if (binding.arg === 'and') { // This is the AND case. If a user has ALL of the specified permissions, permitted will be true permitted = true; binding.value.forEach(function (b) { - if(! hasPermission(b, decodedToken)) { + if (!hasPermission(b, decodedToken)) { permitted = false; } }); - } else if (binding.arg === "or") { + } else if (binding.arg === 'or') { // This is the OR case. If a user has one or more of the specified permissions, permitted will be true binding.value.forEach(function (b) { - if(hasPermission(b, decodedToken)) { + if (hasPermission(b, decodedToken)) { permitted = true; } }); } if (!permitted) { - el.style.display = "none"; + el.style.display = 'none'; } } else { - if (! hasPermission(binding.value, decodedToken)) { - el.style.display = "none"; + if (!hasPermission(binding.value, decodedToken)) { + el.style.display = 'none'; } } }); diff --git a/src/forms/BInputGroupFormDatepicker.vue b/src/forms/BInputGroupFormDatepicker.vue index 2967ce8dd..78be41179 100644 --- a/src/forms/BInputGroupFormDatepicker.vue +++ b/src/forms/BInputGroupFormDatepicker.vue @@ -1,29 +1,48 @@ diff --git a/src/forms/BInputGroupFormInput.vue b/src/forms/BInputGroupFormInput.vue index 26f967b79..885b61c4d 100644 --- a/src/forms/BInputGroupFormInput.vue +++ b/src/forms/BInputGroupFormInput.vue @@ -1,7 +1,14 @@ diff --git a/src/forms/BInputGroupFormSelect.vue b/src/forms/BInputGroupFormSelect.vue index 0e338e423..e732ebb74 100644 --- a/src/forms/BInputGroupFormSelect.vue +++ b/src/forms/BInputGroupFormSelect.vue @@ -1,95 +1,114 @@ diff --git a/src/forms/BValidatedInputGroupFormInput.vue b/src/forms/BValidatedInputGroupFormInput.vue index 71941414f..de17a7917 100644 --- a/src/forms/BValidatedInputGroupFormInput.vue +++ b/src/forms/BValidatedInputGroupFormInput.vue @@ -1,8 +1,16 @@ diff --git a/src/i18n/index.js b/src/i18n/index.js index d8d15f503..1a6082420 100644 --- a/src/i18n/index.js +++ b/src/i18n/index.js @@ -1,12 +1,16 @@ -import Vue from 'vue' -import VueI18n from 'vue-i18n' +import Vue from 'vue'; +import VueI18n from 'vue-i18n'; Vue.use(VueI18n); -function loadLocaleMessages () { - const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i); +function loadLocaleMessages() { + const locales = require.context( + './locales', + true, + /[A-Za-z0-9-_,\s]+\.json$/i, + ); const messages = {}; - locales.keys().forEach(key => { + locales.keys().forEach((key) => { const matched = key.match(/([A-Za-z0-9-_]+)\./i); if (matched && matched.length > 1) { const locale = matched[1]; @@ -19,7 +23,7 @@ function loadLocaleMessages () { const i18n = new VueI18n({ locale: process.env.VUE_APP_I18N_LOCALE || 'en', fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en', - messages: loadLocaleMessages() + messages: loadLocaleMessages(), }); export default i18n; diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 94baacbe0..de974d7e6 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -292,14 +292,14 @@ "component_author": "Author", "coordinates": "Coordinates", "coordinates_version_tooltip": "You can use the comparison operators >, <, >=, <=, == and != to match specific versions or version ranges", - "age_tooltip": "Age in ISO-8601 period format (e.g. P1Y = 1 Year; P2Y3M = 2 Years, 3 Months)", + "age_tooltip": "Age in ISO-8601 period format (e.g. P1Y = 1 Year; P2Y3M = 2 Years, 3 Months)", "package_url_full": "Package URL (PURL)", "swid_tagid": "SWID Tag ID", "cpe": "CPE", "cpe_full": "Common Platform Enumeration (CPE)", "classifier": "Classifier", "search_parent": "Type to search parent", - "inactive_active_children" : "The project cannot be set to inactive if it has active children", + "inactive_active_children": "The project cannot be set to inactive if it has active children", "filename": "Filename", "copyright": "Copyright", "md5": "MD5", @@ -806,7 +806,7 @@ "index_use_cases": "The full-text search feature is principally used for the search API (i.e. all the indexes) and internal analyzer fuzzy matching on CPE (i.e. the vulnerable software index).", "index_issues_description": "The lucene indexes can degrade or drift from Dependency Track database over time. Even though DT does its best to minimize the drift, the administrative features below are provided to check or restore the indexes if need be. It must be used with caution.", "index_consistency_check_description": "You can enable a periodic background task that will check that all indexes exists, are not corrupted and that their difference with Dependency Track database is under a defined threshold percentage. Any check failure will trigger a rebuild of the corresponding index. A restart is required to take cadence modification into account.", - "index_rebuild_description" : "You can selectively trigger an immediate rebuild of some or all indexes. The index rebuild will be perform by an asynchronous tasks. You can check the progress using Dependency Track logs.", + "index_rebuild_description": "You can selectively trigger an immediate rebuild of some or all indexes. The index rebuild will be perform by an asynchronous tasks. You can check the progress using Dependency Track logs.", "enable_index_consistency_check": "Enable periodic consistency check", "index_consistency_check_cadence": "Cadence (in minutes)", "index_consistency_check_threshold": "Delta threshold (in percentage)", @@ -825,7 +825,7 @@ "warn": "Warn", "fail": "Fail" }, - "operator" : { + "operator": { "is": "is", "is_not": "is not", "matches": "matches", @@ -833,7 +833,7 @@ "contains_any": "contains any", "contains_all": "contains all" }, - "hashes" : { + "hashes": { "md5": "MD5", "sha_1": "SHA-1", "sha_256": "SHA-256", diff --git a/src/main.js b/src/main.js index a39b9847d..1fdfa468c 100644 --- a/src/main.js +++ b/src/main.js @@ -2,23 +2,23 @@ // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import 'core-js/stable'; import 'regenerator-runtime/runtime'; -import Vue from 'vue' -import BootstrapVue from 'bootstrap-vue' -import App from './App' -import router from './router' -import i18n from './i18n' -import './validation' -import './plugins/table.js' -import axios from 'axios' -import VueAxios from 'vue-axios' -import vueDebounce from 'vue-debounce' -import VuePageTitle from 'vue-page-title' -import '@/directives/VuePermission' -import VueToastr from "vue-toastr"; -import api from "./shared/api.json"; -import oidc from "./shared/oidc.json"; -import version from "./version"; -import { getContextPath } from "./shared/utils"; +import Vue from 'vue'; +import BootstrapVue from 'bootstrap-vue'; +import App from './App'; +import router from './router'; +import i18n from './i18n'; +import './validation'; +import './plugins/table.js'; +import axios from 'axios'; +import VueAxios from 'vue-axios'; +import vueDebounce from 'vue-debounce'; +import VuePageTitle from 'vue-page-title'; +import '@/directives/VuePermission'; +import VueToastr from 'vue-toastr'; +import api from './shared/api.json'; +import oidc from './shared/oidc.json'; +import version from './version'; +import { getContextPath } from './shared/utils'; Vue.use(BootstrapVue); Vue.use(VueAxios, axios); @@ -26,8 +26,8 @@ Vue.use(VueToastr, { defaultTimeout: 5000, defaultProgressBar: false, defaultProgressBarValue: 0, - defaultPosition: "toast-top-right", - defaultCloseOnHover: false + defaultPosition: 'toast-top-right', + defaultCloseOnHover: false, }); Vue.use(vueDebounce, { defaultTime: '750ms' }); Vue.use(VuePageTitle, { prefix: 'Dependency-Track -', router }); @@ -35,31 +35,39 @@ Vue.use(VuePageTitle, { prefix: 'Dependency-Track -', router }); Vue.prototype.$api = api; Vue.prototype.$oidc = oidc; const contextPath = getContextPath(); -axios.get(contextPath + "/static/config.json").then(response => { - if (response.data.API_BASE_URL && response.data.API_BASE_URL !== "") { - Vue.prototype.$api.BASE_URL = response.data.API_BASE_URL; - } else { - Vue.prototype.$api.BASE_URL = contextPath; - } +axios + .get(contextPath + '/static/config.json') + .then((response) => { + if (response.data.API_BASE_URL && response.data.API_BASE_URL !== '') { + Vue.prototype.$api.BASE_URL = response.data.API_BASE_URL; + } else { + Vue.prototype.$api.BASE_URL = contextPath; + } - // Send XHR cross-site cookie credentials - Vue.prototype.$api.WITH_CREDENTIALS = response.data.API_WITH_CREDENTIALS && response.data.API_WITH_CREDENTIALS.toLowerCase() === "true"; + // Send XHR cross-site cookie credentials + Vue.prototype.$api.WITH_CREDENTIALS = + response.data.API_WITH_CREDENTIALS && + response.data.API_WITH_CREDENTIALS.toLowerCase() === 'true'; - // OpenID Connect - Vue.prototype.$oidc.ISSUER = response.data.OIDC_ISSUER; - Vue.prototype.$oidc.CLIENT_ID = response.data.OIDC_CLIENT_ID; - Vue.prototype.$oidc.SCOPE = response.data.OIDC_SCOPE; - Vue.prototype.$oidc.FLOW = response.data.OIDC_FLOW; - if (response.data.OIDC_LOGIN_BUTTON_TEXT) { - Vue.prototype.$oidc.LOGIN_BUTTON_TEXT = response.data.OIDC_LOGIN_BUTTON_TEXT; - } else { - Vue.prototype.$oidc.LOGIN_BUTTON_TEXT = ""; - } - createVueApp(); -}).catch(function (error) { - console.log("Cannot retrieve static/config.json from host. This is expected behavior in development environments."); - createVueApp(); -}); + // OpenID Connect + Vue.prototype.$oidc.ISSUER = response.data.OIDC_ISSUER; + Vue.prototype.$oidc.CLIENT_ID = response.data.OIDC_CLIENT_ID; + Vue.prototype.$oidc.SCOPE = response.data.OIDC_SCOPE; + Vue.prototype.$oidc.FLOW = response.data.OIDC_FLOW; + if (response.data.OIDC_LOGIN_BUTTON_TEXT) { + Vue.prototype.$oidc.LOGIN_BUTTON_TEXT = + response.data.OIDC_LOGIN_BUTTON_TEXT; + } else { + Vue.prototype.$oidc.LOGIN_BUTTON_TEXT = ''; + } + createVueApp(); + }) + .catch(function (error) { + console.log( + 'Cannot retrieve static/config.json from host. This is expected behavior in development environments.', + ); + createVueApp(); + }); /** * Removed finally block due to: @@ -71,11 +79,11 @@ function createVueApp() { $dtrack can then be used anywhere in the app to get information about the server, the version of dtrack, timestamp, uuid, Alpine version, etc. */ - axios.get(`${Vue.prototype.$api.BASE_URL}/${Vue.prototype.$api.URL_ABOUT}`) + axios + .get(`${Vue.prototype.$api.BASE_URL}/${Vue.prototype.$api.URL_ABOUT}`) .then((result) => { - Vue.prototype.$dtrack = result.data; - } - ); + Vue.prototype.$dtrack = result.data; + }); Vue.prototype.$version = version; @@ -85,7 +93,7 @@ function createVueApp() { template: '', components: { App, - } - ,i18n + }, + i18n, }); } diff --git a/src/mixins/bootstrapTableMixin.js b/src/mixins/bootstrapTableMixin.js index fa9c90d47..5115903e0 100644 --- a/src/mixins/bootstrapTableMixin.js +++ b/src/mixins/bootstrapTableMixin.js @@ -1,22 +1,22 @@ -import Vue from 'vue' +import Vue from 'vue'; export default { - data () { + data() { return { - vueFormatters: [] - } + vueFormatters: [], + }; }, methods: { - vueFormatter (obj) { + vueFormatter(obj) { const key = `_vue_formatter_${this.vueFormatters.length}`; this.vueFormatters.push({ el: `.${key}`, name: key, - ...obj + ...obj, }); return `
`; }, - vueFormatterInit () { + vueFormatterInit() { if (!this.vueFormatters.length) { return; } @@ -27,6 +27,6 @@ export default { this.vueFormatters.splice(i, 1); } } - } - } -} + }, + }, +}; diff --git a/src/mixins/globalVarsMixin.js b/src/mixins/globalVarsMixin.js index d7a31afae..4ea8bd950 100644 --- a/src/mixins/globalVarsMixin.js +++ b/src/mixins/globalVarsMixin.js @@ -1,23 +1,23 @@ -import Vue from 'vue' -import axios from "axios"; -import EventBus from "@/shared/eventbus"; +import Vue from 'vue'; +import axios from 'axios'; +import EventBus from '@/shared/eventbus'; export default { - data () { + data() { return { dtrack: Object, - currentUser: Object - } + currentUser: Object, + }; }, created() { if (this.$dtrack) { this.dtrack = this.$dtrack; } else { - axios.get(`${Vue.prototype.$api.BASE_URL}/${Vue.prototype.$api.URL_ABOUT}`) + axios + .get(`${Vue.prototype.$api.BASE_URL}/${Vue.prototype.$api.URL_ABOUT}`) .then((result) => { - this.dtrack = result.data; - } - ); + this.dtrack = result.data; + }); } if (this.$currentUser) { this.currentUser = this.$currentUser; @@ -27,11 +27,13 @@ export default { }, mounted() { EventBus.$on('profileUpdated', () => { - axios.get(`${Vue.prototype.$api.BASE_URL}/${Vue.prototype.$api.URL_USER_SELF}`) + axios + .get( + `${Vue.prototype.$api.BASE_URL}/${Vue.prototype.$api.URL_USER_SELF}`, + ) .then((result) => { - this.currentUser = result.data; - } - ); + this.currentUser = result.data; + }); }); - } -} + }, +}; diff --git a/src/mixins/permissionsMixin.js b/src/mixins/permissionsMixin.js index a06759c25..415003535 100644 --- a/src/mixins/permissionsMixin.js +++ b/src/mixins/permissionsMixin.js @@ -1,4 +1,4 @@ -import * as permissions from "../shared/permissions"; +import * as permissions from '../shared/permissions'; export default { data() { @@ -14,21 +14,21 @@ export default { VULNERABILITY_MANAGEMENT: permissions.VULNERABILITY_MANAGEMENT, POLICY_VIOLATION_ANALYSIS: permissions.POLICY_VIOLATION_ANALYSIS, SYSTEM_CONFIGURATION: permissions.SYSTEM_CONFIGURATION, - POLICY_MANAGEMENT: permissions.POLICY_MANAGEMENT - } - } + POLICY_MANAGEMENT: permissions.POLICY_MANAGEMENT, + }, + }; }, computed: { - decodedToken () { + decodedToken() { return permissions.decodeToken(permissions.getToken()); - } + }, }, methods: { - isPermitted (permission) { + isPermitted(permission) { return permissions.hasPermission(permission, this.decodedToken); }, - isNotPermitted (permission) { + isNotPermitted(permission) { return !permissions.hasPermission(permission, this.decodedToken); }, - } + }, }; diff --git a/src/mixins/routerMixin.js b/src/mixins/routerMixin.js index 0363c227b..ba0c11a79 100644 --- a/src/mixins/routerMixin.js +++ b/src/mixins/routerMixin.js @@ -1,13 +1,13 @@ export default { methods: { - setSearchTextQuery (searchText) { + setSearchTextQuery(searchText) { let queries = JSON.parse(JSON.stringify(this.$route.query)); if (searchText === '') { delete queries.searchText; } else { queries.searchText = searchText; } - this.$router.replace({query: queries}); - } - } -} + this.$router.replace({ query: queries }); + }, + }, +}; diff --git a/src/plugins/jquery.js b/src/plugins/jquery.js index f6a86562d..597ce96ad 100644 --- a/src/plugins/jquery.js +++ b/src/plugins/jquery.js @@ -1,2 +1,2 @@ -import jQuery from 'jquery' +import jQuery from 'jquery'; window.jQuery = jQuery; diff --git a/src/plugins/table.js b/src/plugins/table.js index 76fbf4b5e..bd3b95274 100644 --- a/src/plugins/table.js +++ b/src/plugins/table.js @@ -1,11 +1,11 @@ -import 'bootstrap-table/dist/bootstrap-table.min.css' +import 'bootstrap-table/dist/bootstrap-table.min.css'; -import './jquery.js' -import Vue from 'vue' -import 'bootstrap' -import 'jquery-treegrid/js/jquery.treegrid.min.js' -import 'bootstrap-table/dist/bootstrap-table.js' -import 'bootstrap-table/dist/extensions/treegrid/bootstrap-table-treegrid.min.js' -import BootstrapTable from 'bootstrap-table/dist/bootstrap-table-vue.esm.js' +import './jquery.js'; +import Vue from 'vue'; +import 'bootstrap'; +import 'jquery-treegrid/js/jquery.treegrid.min.js'; +import 'bootstrap-table/dist/bootstrap-table.js'; +import 'bootstrap-table/dist/extensions/treegrid/bootstrap-table-treegrid.min.js'; +import BootstrapTable from 'bootstrap-table/dist/bootstrap-table-vue.esm.js'; Vue.component('BootstrapTable', BootstrapTable); diff --git a/src/router/index.js b/src/router/index.js index 30e363d07..cb6ad0e04 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,7 +3,7 @@ import Router from 'vue-router'; import i18n from '../i18n'; import EventBus from '../shared/eventbus'; import { getToken, hasPermission } from '../shared/permissions'; -import { getContextPath } from "../shared/utils"; +import { getContextPath } from '../shared/utils'; // Containers const DefaultContainer = () => import('@/containers/DefaultContainer'); @@ -11,62 +11,87 @@ const DefaultContainer = () => import('@/containers/DefaultContainer'); // Views const Dashboard = () => import('@/views/Dashboard'); const ProjectList = () => import('@/views/portfolio/projects/ProjectList'); -const ComponentSearch = () => import('@/views/portfolio/components/ComponentSearch'); -const VulnerabilityList = () => import('@/views/portfolio/vulnerabilities/VulnerabilityList'); -const VulnerabilityAudit = () => import('@/views/globalAudit/VulnerabilityAudit'); +const ComponentSearch = () => + import('@/views/portfolio/components/ComponentSearch'); +const VulnerabilityList = () => + import('@/views/portfolio/vulnerabilities/VulnerabilityList'); +const VulnerabilityAudit = () => + import('@/views/globalAudit/VulnerabilityAudit'); const LicenseList = () => import('@/views/portfolio/licenses/LicenseList'); const PolicyManagement = () => import('@/views/policy/PolicyManagement'); const Project = () => import('@/views/portfolio/projects/Project'); const Administration = () => import('@/views/administration/Administration'); -const General = () => import('@/views/administration/configuration/General') -const BomFormats = () => import('@/views/administration/configuration/BomFormats') -const Email = () => import('@/views/administration/configuration/Email') -const Jira = () => import('@/views/administration/configuration/JiraConfig') -const InternalComponents = () => import('@/views/administration/configuration/InternalComponents') -const TaskScheduler = () => import('@/views/administration/configuration/TaskScheduler') -const Search = () => import('@/views/administration/configuration/Search') +const General = () => import('@/views/administration/configuration/General'); +const BomFormats = () => + import('@/views/administration/configuration/BomFormats'); +const Email = () => import('@/views/administration/configuration/Email'); +const Jira = () => import('@/views/administration/configuration/JiraConfig'); +const InternalComponents = () => + import('@/views/administration/configuration/InternalComponents'); +const TaskScheduler = () => + import('@/views/administration/configuration/TaskScheduler'); +const Search = () => import('@/views/administration/configuration/Search'); -const InternalAnalyzer = () => import('@/views/administration/analyzers/InternalAnalyzer') -const OssIndexAnalyzer = () => import('@/views/administration/analyzers/OssIndexAnalyzer') -const VulnDbAnalyzer = () => import('@/views/administration/analyzers/VulnDbAnalyzer') -const SnykAnalyzer = () => import('@/views/administration/analyzers/SnykAnalyzer') -const TrivyAnalyzer = () => import('@/views/administration/analyzers/TrivyAnalyzer') +const InternalAnalyzer = () => + import('@/views/administration/analyzers/InternalAnalyzer'); +const OssIndexAnalyzer = () => + import('@/views/administration/analyzers/OssIndexAnalyzer'); +const VulnDbAnalyzer = () => + import('@/views/administration/analyzers/VulnDbAnalyzer'); +const SnykAnalyzer = () => + import('@/views/administration/analyzers/SnykAnalyzer'); +const TrivyAnalyzer = () => + import('@/views/administration/analyzers/TrivyAnalyzer'); -const VulnSourceNvd = () => import('@/views/administration/vuln-sources/VulnSourceNvd') -const VulnSourceGitHubAdvisories = () => import('@/views/administration/vuln-sources/VulnSourceGitHubAdvisories') -const VulnSourceOSVAdvisories = () => import('@/views/administration/vuln-sources/VulnSourceOSVAdvisories') +const VulnSourceNvd = () => + import('@/views/administration/vuln-sources/VulnSourceNvd'); +const VulnSourceGitHubAdvisories = () => + import('@/views/administration/vuln-sources/VulnSourceGitHubAdvisories'); +const VulnSourceOSVAdvisories = () => + import('@/views/administration/vuln-sources/VulnSourceOSVAdvisories'); -const Cargo = () => import('@/views/administration/repositories/Cargo') -const Composer = () => import('@/views/administration/repositories/Composer') -const Cpan = () => import('@/views/administration/repositories/Cpan') -const Gem = () => import('@/views/administration/repositories/Gem') -const GitHub = () => import('@/views/administration/repositories/GitHub.vue') -const GoModules = () => import('@/views/administration/repositories/GoModules') -const Hex = () => import('@/views/administration/repositories/Hex') -const Maven = () => import('@/views/administration/repositories/Maven') -const Npm = () => import('@/views/administration/repositories/Npm') -const Nuget = () => import('@/views/administration/repositories/Nuget') -const Python = () => import('@/views/administration/repositories/Python') +const Cargo = () => import('@/views/administration/repositories/Cargo'); +const Composer = () => import('@/views/administration/repositories/Composer'); +const Cpan = () => import('@/views/administration/repositories/Cpan'); +const Gem = () => import('@/views/administration/repositories/Gem'); +const GitHub = () => import('@/views/administration/repositories/GitHub.vue'); +const GoModules = () => import('@/views/administration/repositories/GoModules'); +const Hex = () => import('@/views/administration/repositories/Hex'); +const Maven = () => import('@/views/administration/repositories/Maven'); +const Npm = () => import('@/views/administration/repositories/Npm'); +const Nuget = () => import('@/views/administration/repositories/Nuget'); +const Python = () => import('@/views/administration/repositories/Python'); -const Alerts = () => import('@/views/administration/notifications/Alerts') -const Templates = () => import('@/views/administration/notifications/Templates') +const Alerts = () => import('@/views/administration/notifications/Alerts'); +const Templates = () => + import('@/views/administration/notifications/Templates'); -const FortifySsc = () => import('@/views/administration/integrations/FortifySsc') -const DefectDojo = () => import('@/views/administration/integrations/DefectDojo') -const KennaSecurity = () => import('@/views/administration/integrations/KennaSecurity') +const FortifySsc = () => + import('@/views/administration/integrations/FortifySsc'); +const DefectDojo = () => + import('@/views/administration/integrations/DefectDojo'); +const KennaSecurity = () => + import('@/views/administration/integrations/KennaSecurity'); -const LdapUsers = () => import('@/views/administration/accessmanagement/LdapUsers') -const ManagedUsers = () => import('@/views/administration/accessmanagement/ManagedUsers') -const OidcUsers = () => import('@/views/administration/accessmanagement/OidcUsers') -const OidcGroups = () => import('@/views/administration/accessmanagement/OidcGroups') -const Teams = () => import('@/views/administration/accessmanagement/Teams') -const Permissions = () => import('@/views/administration/accessmanagement/Permissions') -const PortfolioAccessControl = () => import('@/views/administration/accessmanagement/PortfolioAccessControl') +const LdapUsers = () => + import('@/views/administration/accessmanagement/LdapUsers'); +const ManagedUsers = () => + import('@/views/administration/accessmanagement/ManagedUsers'); +const OidcUsers = () => + import('@/views/administration/accessmanagement/OidcUsers'); +const OidcGroups = () => + import('@/views/administration/accessmanagement/OidcGroups'); +const Teams = () => import('@/views/administration/accessmanagement/Teams'); +const Permissions = () => + import('@/views/administration/accessmanagement/Permissions'); +const PortfolioAccessControl = () => + import('@/views/administration/accessmanagement/PortfolioAccessControl'); const Component = () => import('@/views/portfolio/projects/Component'); const Service = () => import('@/views/portfolio/projects/Service'); -const Vulnerability = () => import('@/views/portfolio/vulnerabilities/Vulnerability'); +const Vulnerability = () => + import('@/views/portfolio/vulnerabilities/Vulnerability'); const License = () => import('@/views/portfolio/licenses/License'); // Pages @@ -92,8 +117,8 @@ function configRoutes() { title: i18n.t('message.dashboard'), i18n: 'message.dashboard', sectionPath: '/dashboard', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'projects', @@ -103,63 +128,71 @@ function configRoutes() { title: i18n.t('message.projects'), i18n: 'message.projects', sectionPath: '/projects', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'projects/:uuid', name: 'Project', - alias: ['projects/:uuid/overview', 'projects/:uuid/components', 'projects/:uuid/services', 'projects/:uuid/dependencyGraph', 'projects/:uuid/findings', 'projects/:uuid/epss', 'projects/:uuid/policyViolations'], - props: (route) => ( { uuid: route.params.uuid } ), + alias: [ + 'projects/:uuid/overview', + 'projects/:uuid/components', + 'projects/:uuid/services', + 'projects/:uuid/dependencyGraph', + 'projects/:uuid/findings', + 'projects/:uuid/epss', + 'projects/:uuid/policyViolations', + ], + props: (route) => ({ uuid: route.params.uuid }), component: Project, meta: { i18n: 'message.projects', sectionPath: '/projects', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'projects/:uuid/dependencyGraph/:componentUuids', name: 'Dependency Graph Component Lookup', - props: (route) => ( { + props: (route) => ({ uuid: route.params.uuid, - componentUuids: route.params.componentUuids - } ), + componentUuids: route.params.componentUuids, + }), component: Project, meta: { i18n: 'message.projects', sectionPath: '/projects', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'projects/:uuid/findings/:vulnerability', name: 'Project Vulnerability Lookup', - props: (route) => ( { + props: (route) => ({ uuid: route.params.uuid, - vulnerability: route.params.vulnerability - } ), + vulnerability: route.params.vulnerability, + }), component: Project, meta: { i18n: 'message.projects', sectionPath: '/projects', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'projects/:uuid/findings/:affectedComponent/:vulnerability', name: 'Project Finding Lookup', - props: (route) => ( { + props: (route) => ({ uuid: route.params.uuid, affectedComponent: route.params.componentUuid, - vulnerability: route.params.vulnerability - } ), + vulnerability: route.params.vulnerability, + }), component: Project, meta: { i18n: 'message.projects', sectionPath: '/projects', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'components', @@ -169,31 +202,34 @@ function configRoutes() { title: i18n.t('message.component_search'), i18n: 'message.component_search', sectionPath: '/components', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: '/components/:uuid', name: 'Component', - alias: ['/components/:uuid/overview', '/components/:uuid/vulnerabilities'], - props: (route) => ( { uuid: route.params.uuid } ), + alias: [ + '/components/:uuid/overview', + '/components/:uuid/vulnerabilities', + ], + props: (route) => ({ uuid: route.params.uuid }), component: Component, meta: { i18n: 'message.projects', sectionPath: '/projects', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: '/services/:uuid', name: 'Service', - props: (route) => ( { uuid: route.params.uuid } ), + props: (route) => ({ uuid: route.params.uuid }), component: Service, meta: { i18n: 'message.projects', sectionPath: '/projects', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'vulnerabilities', @@ -203,23 +239,26 @@ function configRoutes() { title: i18n.t('message.vulnerabilities'), i18n: 'message.vulnerabilities', sectionPath: '/vulnerabilities', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'vulnerabilities/:source/:vulnId', name: 'Vulnerability', - alias: ['vulnerabilities/:source/:vulnId/overview', 'vulnerabilities/:source/:vulnId/affectedProjects'], - props: (route) => ( { + alias: [ + 'vulnerabilities/:source/:vulnId/overview', + 'vulnerabilities/:source/:vulnId/affectedProjects', + ], + props: (route) => ({ source: route.params.source, - vulnId: route.params.vulnId - } ), + vulnId: route.params.vulnId, + }), component: Vulnerability, meta: { i18n: 'message.vulnerabilities', sectionPath: '/vulnerabilities', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'licenses', @@ -229,20 +268,25 @@ function configRoutes() { title: i18n.t('message.licenses'), i18n: 'message.licenses', sectionPath: '/licenses', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'licenses/:licenseId', name: 'License', - alias: ['licenses/:licenseId/overview', 'licenses/:licenseId/licenseText', 'licenses/:licenseId/template', 'licenses/:licenseId/header'], - props: (route) => ( { licenseId: route.params.licenseId } ), + alias: [ + 'licenses/:licenseId/overview', + 'licenses/:licenseId/licenseText', + 'licenses/:licenseId/template', + 'licenses/:licenseId/header', + ], + props: (route) => ({ licenseId: route.params.licenseId }), component: License, meta: { i18n: 'message.licenses', sectionPath: '/licenses', - permission: 'VIEW_PORTFOLIO' - } + permission: 'VIEW_PORTFOLIO', + }, }, { path: 'policy', @@ -253,8 +297,8 @@ function configRoutes() { title: i18n.t('message.policy_management'), i18n: 'message.policy_management', sectionPath: '/policy', - permission: 'POLICY_MANAGEMENT' - } + permission: 'POLICY_MANAGEMENT', + }, }, { path: 'admin', @@ -263,7 +307,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, children: [ { @@ -275,7 +319,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -285,7 +329,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -295,7 +339,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -305,7 +349,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -315,7 +359,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -325,7 +369,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -335,7 +379,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -346,7 +390,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -356,7 +400,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -366,7 +410,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -376,7 +420,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -386,7 +430,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -397,7 +441,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -407,7 +451,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -417,7 +461,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -428,7 +472,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -438,7 +482,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -448,7 +492,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -458,7 +502,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -468,7 +512,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -478,7 +522,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -488,7 +532,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -498,7 +542,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -508,7 +552,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -518,7 +562,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -528,7 +572,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -539,7 +583,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -549,7 +593,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -560,7 +604,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -570,7 +614,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -580,7 +624,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'SYSTEM_CONFIGURATION' + permission: 'SYSTEM_CONFIGURATION', }, }, { @@ -591,7 +635,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'ACCESS_MANAGEMENT' + permission: 'ACCESS_MANAGEMENT', }, }, { @@ -601,7 +645,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'ACCESS_MANAGEMENT' + permission: 'ACCESS_MANAGEMENT', }, }, { @@ -611,7 +655,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'ACCESS_MANAGEMENT' + permission: 'ACCESS_MANAGEMENT', }, }, { @@ -621,7 +665,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'ACCESS_MANAGEMENT' + permission: 'ACCESS_MANAGEMENT', }, }, { @@ -631,7 +675,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'ACCESS_MANAGEMENT' + permission: 'ACCESS_MANAGEMENT', }, }, { @@ -641,7 +685,7 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'ACCESS_MANAGEMENT' + permission: 'ACCESS_MANAGEMENT', }, }, { @@ -651,79 +695,85 @@ function configRoutes() { title: i18n.t('message.administration'), i18n: 'message.administration', sectionPath: '/admin', - permission: 'ACCESS_MANAGEMENT' + permission: 'ACCESS_MANAGEMENT', }, - } - ] + }, + ], }, { path: 'vulnerabilityAudit', name: 'Vulnerability Audit', - alias: ['vulnerabilityAudit/occurrences', 'vulnerabilityAudit/grouped'], + alias: [ + 'vulnerabilityAudit/occurrences', + 'vulnerabilityAudit/grouped', + ], component: VulnerabilityAudit, meta: { title: i18n.t('message.vulnerability_audit'), i18n: 'message.vulnerability_audit', sectionPath: '/globalAudit', - permission: 'VIEW_VULNERABILITY' - } + permission: 'VIEW_VULNERABILITY', + }, }, // The following route redirects URLs from legacy Dependency-Track UI to new URL format. { // Old: http://host/project/?uuid=3a38aedf-e9e9-4e0a-8913-2d99951aa76d // New: http://host/projects/3a38aedf-e9e9-4e0a-8913-2d99951aa76d path: 'project', - props: (route) => ( { uuid: route.query.uuid } ), - redirect: to => { + props: (route) => ({ uuid: route.query.uuid }), + redirect: (to) => { let { hash, params, query } = to; if (query.uuid) { let uuid = query.uuid; - return { path: '/projects/' + uuid, query: null } + return { path: '/projects/' + uuid, query: null }; } - } + }, }, { // Old: http://host/component/?uuid=3a38aedf-e9e9-4e0a-8913-2d99951aa76d // New: http://host/components/3a38aedf-e9e9-4e0a-8913-2d99951aa76d path: 'component', - props: (route) => ( { uuid: route.query.uuid } ), - redirect: to => { + props: (route) => ({ uuid: route.query.uuid }), + redirect: (to) => { let { hash, params, query } = to; if (query.uuid) { let uuid = query.uuid; - return { path: '/components/' + uuid, query: null } + return { path: '/components/' + uuid, query: null }; } - } + }, }, { // Old: http://host/vulnerability/?source=NVD&vulnId=CVE-2019-10966 // New: http://host/vulnerabilities/NVD/CVE-2019-10966 path: 'vulnerability', - props: (route) => ( { + props: (route) => ({ source: route.query.source, vulnId: route.query.vulnId, - } ), - redirect: to => { + }), + redirect: (to) => { let { hash, params, query } = to; if (query.source && query.vulnId) { - return { path: '/vulnerabilities/' + query.source + "/" + query.vulnId, query: null } + return { + path: '/vulnerabilities/' + query.source + '/' + query.vulnId, + query: null, + }; } - } + }, }, { // Old: http://host/license/?licenseId=AFL-2.0 // New: http://host/licenses/AFL-2.0 path: 'license', - props: (route) => ( { licenseId: route.query.licenseId } ), - redirect: to => { + props: (route) => ({ licenseId: route.query.licenseId }), + redirect: (to) => { let { hash, params, query } = to; if (query.licenseId) { let licenseId = query.licenseId; - return { path: '/licenses/' + licenseId, query: null } + return { path: '/licenses/' + licenseId, query: null }; } - } + }, }, - ] + ], }, { path: '/login', @@ -731,7 +781,7 @@ function configRoutes() { component: Login, meta: { title: i18n.t('message.login'), - } + }, }, { path: '/change-password', @@ -739,7 +789,7 @@ function configRoutes() { component: PasswordForceChange, meta: { title: i18n.t('message.change_password'), - } + }, }, { path: '*', @@ -747,9 +797,9 @@ function configRoutes() { component: Page404, meta: { title: i18n.t('404.heading'), - } - } - ] + }, + }, + ]; } const router = new Router({ @@ -757,7 +807,7 @@ const router = new Router({ base: getContextPath(), linkActiveClass: 'open active', scrollBehavior: () => ({ y: 0 }), - routes: configRoutes() + routes: configRoutes(), }); router.beforeEach((to, from, next) => { @@ -771,22 +821,25 @@ router.beforeEach((to, from, next) => { if (jwt) { if (hasPermission(to.meta.permission)) { // let backend verify the token - router.app.axios.get(`${router.app.$api.BASE_URL}/${router.app.$api.URL_USER_SELF}`, { - headers: { 'Authorization': `Bearer ${jwt}` } - }).then((result) => { - Vue.prototype.$currentUser = result.data - // allowed to proceed - next(); - }).catch(() => { - // token is stale - // notify app about this - EventBus.$emit('authenticated', null); - // redirect to login page - redirectToLogin(); - }); + router.app.axios + .get(`${router.app.$api.BASE_URL}/${router.app.$api.URL_USER_SELF}`, { + headers: { Authorization: `Bearer ${jwt}` }, + }) + .then((result) => { + Vue.prototype.$currentUser = result.data; + // allowed to proceed + next(); + }) + .catch(() => { + // token is stale + // notify app about this + EventBus.$emit('authenticated', null); + // redirect to login page + redirectToLogin(); + }); } else { Vue.prototype.$toastr.e(i18n.t('condition.forbidden')); - next({name: 'Dashboard', replace: true}); + next({ name: 'Dashboard', replace: true }); } } else { // no token at all, redirect to login page diff --git a/src/shared/classes.js b/src/shared/classes.js index b8b628280..a370c720f 100644 --- a/src/shared/classes.js +++ b/src/shared/classes.js @@ -3,7 +3,7 @@ export const sidebarCssClasses = [ 'sidebar-sm-show', 'sidebar-md-show', 'sidebar-lg-show', - 'sidebar-xl-show' + 'sidebar-xl-show', ]; export const asideMenuCssClasses = [ @@ -11,11 +11,11 @@ export const asideMenuCssClasses = [ 'aside-menu-sm-show', 'aside-menu-md-show', 'aside-menu-lg-show', - 'aside-menu-xl-show' + 'aside-menu-xl-show', ]; -export const validBreakpoints = [ 'sm', 'md', 'lg', 'xl' ]; +export const validBreakpoints = ['sm', 'md', 'lg', 'xl']; -export function checkBreakpoint (breakpoint, list) { - return list.indexOf(breakpoint) > -1 +export function checkBreakpoint(breakpoint, list) { + return list.indexOf(breakpoint) > -1; } diff --git a/src/shared/common.js b/src/shared/common.js index 5df64b706..988fd5dfc 100644 --- a/src/shared/common.js +++ b/src/shared/common.js @@ -4,31 +4,33 @@ * approach was implemented. */ -"use strict"; +'use strict'; -import xssFilters from "xss-filters"; -const $common = function() { -}; +import xssFilters from 'xss-filters'; +const $common = function () {}; /** * Formats and returns a specialized label for a vulnerability source (NVD, NSP, VulnDB, OSSIndex etc). */ $common.formatSourceLabel = function formatSourceLabel(source) { - if (! source) { + if (!source) { return null; } - let sourceClass = "label-source-" + source.toLowerCase(); + let sourceClass = 'label-source-' + source.toLowerCase(); return `${source}`; }; /** * Formats and returns a specialized label for notifications (fail, warn, info) */ -$common.formatNotificationLabel = function formatNotificationLabel(violationState) { - if (! violationState) { +$common.formatNotificationLabel = function formatNotificationLabel( + violationState, +) { + if (!violationState) { return null; } - let violationStateClass = "label-notification-" + violationState.toLowerCase(); + let violationStateClass = + 'label-notification-' + violationState.toLowerCase(); return `${violationState}`; }; @@ -36,10 +38,10 @@ $common.formatNotificationLabel = function formatNotificationLabel(violationStat * Formats and returns a specialized label for a project tag. */ $common.formatProjectTagLabel = function formatProjectTagLabel(router, tag) { - if (! tag) { - return ""; + if (!tag) { + return ''; } - return `${xssFilters.inHTMLData(tag.name)}` + return `${xssFilters.inHTMLData(tag.name)}`; }; /** @@ -59,10 +61,10 @@ $common.capitalize = function capitalize(string) { */ $common.formatSeverityLabel = function formatSeverityLabel(severity) { if (!severity) { - return ""; + return ''; } let severityLabel = $common.capitalize(severity); - let severityClass = "severity-" + severity.toLowerCase() + "-bg"; + let severityClass = 'severity-' + severity.toLowerCase() + '-bg'; return `
@@ -78,70 +80,93 @@ $common.formatSeverityLabel = function formatSeverityLabel(severity) { /** * Formats and returns a specialized label for the state of policy violations. */ -$common.formatViolationStateLabel = function formatViolationStateLabel(violationState) { - if (! violationState) { +$common.formatViolationStateLabel = function formatViolationStateLabel( + violationState, +) { + if (!violationState) { return null; } - let sourceClass = "label-notification-" + violationState.toLowerCase(); + let sourceClass = 'label-notification-' + violationState.toLowerCase(); return `${violationState}`; }; $common.formatCweLabel = function formatCweLabel(cweId, cweName) { if (cweId && cweName) { - return "
CWE-" + cweId + " " + cweName + "
" + return ( + "
CWE-" + + cweId + + ' ' + + cweName + + '
' + ); } else { - return ""; + return ''; } }; $common.formatCweShortLabel = function formatCweShortLabel(cweId, cweName) { if (cweId && cweName) { - return "CWE-" + cweId + ""; + return ( + "CWE-" + + cweId + + '' + ); } else { - return ""; + return ''; } }; /** * Formats and returns a specialized label for a vulnerability analyzer (OSSINDEX_ANALYZER, INTERNAL_ANALYZER, etc). */ -$common.formatAnalyzerLabel = function formatAnalyzerLabel(analyzer, vulnSource, vulnId, alternateIdentifier, referenceUrl) { - if (! analyzer) { +$common.formatAnalyzerLabel = function formatAnalyzerLabel( + analyzer, + vulnSource, + vulnId, + alternateIdentifier, + referenceUrl, +) { + if (!analyzer) { return null; } - let analyzerLabel = ""; + let analyzerLabel = ''; let analyzerUrl = null; switch (analyzer) { case 'INTERNAL_ANALYZER': analyzerLabel = vulnSource; - if(vulnSource === "GITHUB") { - analyzerUrl = "https://github.com/advisories/" + vulnId; - } else if(vulnSource === "OSV") { - analyzerUrl = "https://osv.dev/vulnerability/" + vulnId; - } else if(vulnSource === "SNYK") { - analyzerUrl = "https://security.snyk.io/vuln/" + vulnId; + if (vulnSource === 'GITHUB') { + analyzerUrl = 'https://github.com/advisories/' + vulnId; + } else if (vulnSource === 'OSV') { + analyzerUrl = 'https://osv.dev/vulnerability/' + vulnId; + } else if (vulnSource === 'SNYK') { + analyzerUrl = 'https://security.snyk.io/vuln/' + vulnId; } break; case 'OSSINDEX_ANALYZER': - analyzerLabel = "OSS Index"; - analyzerUrl = (referenceUrl) ? referenceUrl : "https://ossindex.sonatype.org/vuln/" + vulnId; + analyzerLabel = 'OSS Index'; + analyzerUrl = referenceUrl + ? referenceUrl + : 'https://ossindex.sonatype.org/vuln/' + vulnId; break; case 'VULNDB_ANALYZER': - analyzerLabel = "VulnDB"; - analyzerUrl = "https://vulndb.cyberriskanalytics.com/vulnerabilities/" + vulnId; + analyzerLabel = 'VulnDB'; + analyzerUrl = + 'https://vulndb.cyberriskanalytics.com/vulnerabilities/' + vulnId; break; case 'SNYK_ANALYZER': - analyzerLabel = "Snyk"; - analyzerUrl = "https://security.snyk.io/vuln/" + vulnId; + analyzerLabel = 'Snyk'; + analyzerUrl = 'https://security.snyk.io/vuln/' + vulnId; break; case 'TRIVY_ANALYZER': - analyzerLabel = "Trivy"; + analyzerLabel = 'Trivy'; - analyzerUrl = "https://nvd.nist.gov/vuln/detail/" + vulnId; - if(vulnSource === "GITHUB") { - analyzerUrl = "https://github.com/advisories/" + vulnId; - } - break; + analyzerUrl = 'https://nvd.nist.gov/vuln/detail/' + vulnId; + if (vulnSource === 'GITHUB') { + analyzerUrl = 'https://github.com/advisories/' + vulnId; + } + break; } if (analyzerUrl) { analyzerLabel = `${analyzerLabel} `; @@ -159,96 +184,110 @@ $common.formatAnalyzerLabel = function formatAnalyzerLabel(analyzer, vulnSource, * @param vulnId the unique identifier * @returns a SourceInfo object */ -$common.resolveSourceVulnInfo = function resolveSourceVulnInfo(vulnSource, vulnId) { +$common.resolveSourceVulnInfo = function resolveSourceVulnInfo( + vulnSource, + vulnId, +) { let sourceInfo = {}; sourceInfo.source = vulnSource; sourceInfo.vulnId = vulnId; switch (vulnSource) { - case "INTERNAL": + case 'INTERNAL': // TODO break; - case "NVD": - sourceInfo.name = "National Vulnerability Database"; - sourceInfo.url = "https://nvd.nist.gov/vuln/detail/" + vulnId; + case 'NVD': + sourceInfo.name = 'National Vulnerability Database'; + sourceInfo.url = 'https://nvd.nist.gov/vuln/detail/' + vulnId; break; - case "GITHUB": - sourceInfo.name = "GitHub Advisories"; - sourceInfo.url = "https://github.com/advisories/" + vulnId; + case 'GITHUB': + sourceInfo.name = 'GitHub Advisories'; + sourceInfo.url = 'https://github.com/advisories/' + vulnId; break; - case "OSSINDEX": - sourceInfo.name = "OSS Index"; - sourceInfo.url = "https://ossindex.sonatype.org/vuln/" + vulnId; + case 'OSSINDEX': + sourceInfo.name = 'OSS Index'; + sourceInfo.url = 'https://ossindex.sonatype.org/vuln/' + vulnId; break; - case "SNYK": - sourceInfo.name = "Snyk"; - sourceInfo.url = "https://security.snyk.io/vuln/" + vulnId; + case 'SNYK': + sourceInfo.name = 'Snyk'; + sourceInfo.url = 'https://security.snyk.io/vuln/' + vulnId; break; - case "OSV": - sourceInfo.name = "Open Source Vulnerability Database"; - sourceInfo.url = "https://osv.dev/vulnerability/" + vulnId; + case 'OSV': + sourceInfo.name = 'Open Source Vulnerability Database'; + sourceInfo.url = 'https://osv.dev/vulnerability/' + vulnId; break; - case "GSD": - sourceInfo.name = "Global Security Database"; - sourceInfo.url = "https://github.com/cloudsecurityalliance/gsd-database"; + case 'GSD': + sourceInfo.name = 'Global Security Database'; + sourceInfo.url = 'https://github.com/cloudsecurityalliance/gsd-database'; break; - case "VULNDB": - sourceInfo.name = "VulnDB"; - sourceInfo.url = "https://vulndb.cyberriskanalytics.com/vulnerabilities/" + vulnId; + case 'VULNDB': + sourceInfo.name = 'VulnDB'; + sourceInfo.url = + 'https://vulndb.cyberriskanalytics.com/vulnerabilities/' + vulnId; break; } return sourceInfo; -} +}; $common.resolveVulnAliases = function resolveVulnAliases(vulnSource, aliases) { if (!vulnSource || !aliases) { return []; } - let resolvedAliases = aliases - .flatMap((alias) => { - const _resolvedAliases = []; - if (vulnSource !== "INTERNAL" && alias.internalId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("INTERNAL", alias.internalId)); - } - if (vulnSource !== "NVD" && alias.cveId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("NVD", alias.cveId)); - } - if (vulnSource !== "GITHUB" && alias.ghsaId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("GITHUB", alias.ghsaId)); - } - if (vulnSource !== "OSSINDEX" && alias.sonatypeId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("OSSINDEX", alias.sonatypeId)); - } - if (vulnSource !== "SNYK" && alias.snykId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("SNYK", alias.snykId)); - } - if (vulnSource !== "OSV" && alias.osvId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("OSV", alias.osvId)); - } - if (vulnSource !== "GSD" && alias.gsdId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("GSD", alias.gsdId)); - } - if (vulnSource !== "VULNDB" && alias.vulnDbId) { - _resolvedAliases.push($common.resolveSourceVulnInfo("VULNDB", alias.vulnDbId)); - } - return _resolvedAliases; - }); + let resolvedAliases = aliases.flatMap((alias) => { + const _resolvedAliases = []; + if (vulnSource !== 'INTERNAL' && alias.internalId) { + _resolvedAliases.push( + $common.resolveSourceVulnInfo('INTERNAL', alias.internalId), + ); + } + if (vulnSource !== 'NVD' && alias.cveId) { + _resolvedAliases.push($common.resolveSourceVulnInfo('NVD', alias.cveId)); + } + if (vulnSource !== 'GITHUB' && alias.ghsaId) { + _resolvedAliases.push( + $common.resolveSourceVulnInfo('GITHUB', alias.ghsaId), + ); + } + if (vulnSource !== 'OSSINDEX' && alias.sonatypeId) { + _resolvedAliases.push( + $common.resolveSourceVulnInfo('OSSINDEX', alias.sonatypeId), + ); + } + if (vulnSource !== 'SNYK' && alias.snykId) { + _resolvedAliases.push( + $common.resolveSourceVulnInfo('SNYK', alias.snykId), + ); + } + if (vulnSource !== 'OSV' && alias.osvId) { + _resolvedAliases.push($common.resolveSourceVulnInfo('OSV', alias.osvId)); + } + if (vulnSource !== 'GSD' && alias.gsdId) { + _resolvedAliases.push($common.resolveSourceVulnInfo('GSD', alias.gsdId)); + } + if (vulnSource !== 'VULNDB' && alias.vulnDbId) { + _resolvedAliases.push( + $common.resolveSourceVulnInfo('VULNDB', alias.vulnDbId), + ); + } + return _resolvedAliases; + }); // Deduplicate by vulnerability ID, so we're not showing the same ID more than once. - resolvedAliases = [...new Map(resolvedAliases.map(alias => [alias.vulnId, alias])).values()]; + resolvedAliases = [ + ...new Map(resolvedAliases.map((alias) => [alias.vulnId, alias])).values(), + ]; // Sort aliases by vulnerability ID to achieve consistent output. - return resolvedAliases - .sort((a, b) => { - if (a.vulnId < b.vulnId) { - return -1; - } - if (a.vulnId > b.vulnId) { - return 1; - } - return 0; - }); -} + return resolvedAliases.sort((a, b) => { + if (a.vulnId < b.vulnId) { + return -1; + } + if (a.vulnId > b.vulnId) { + return 1; + } + return 0; + }); +}; /** * @@ -268,11 +307,11 @@ $common.makeAnalysisStateLabelFormatter = (i18n) => { case 'FALSE_POSITIVE': case 'NOT_AFFECTED': case 'RESOLVED': - return i18n.$t(`message.${value.toLowerCase()}`) + return i18n.$t(`message.${value.toLowerCase()}`); default: return null; } - } + }; }; /** @@ -295,11 +334,11 @@ $common.makeAnalysisJustificationLabelFormatter = (i18n) => { case 'PROTECTED_AT_RUNTIME': case 'PROTECTED_AT_PERIMETER': case 'PROTECTED_BY_MITIGATING_CONTROL': - return i18n.$t(`message.${value.toLowerCase()}`) + return i18n.$t(`message.${value.toLowerCase()}`); default: return null; } - } + }; }; /** @@ -318,11 +357,11 @@ $common.makeAnalysisResponseLabelFormatter = (i18n) => { case 'UPDATE': case 'ROLLBACK': case 'WORKAROUND_AVAILABLE': - return i18n.$t(`message.${value.toLowerCase()}`) + return i18n.$t(`message.${value.toLowerCase()}`); default: return null; } - } + }; }; /** @@ -343,11 +382,11 @@ $common.componentClassifierLabelFormatter = (i18n) => { case 'DEVICE': case 'FIRMWARE': case 'FILE': - return i18n.$t(`message.component_${value.toLowerCase()}`) + return i18n.$t(`message.component_${value.toLowerCase()}`); default: return null; } - } + }; }; /** @@ -359,7 +398,7 @@ $common.componentClassifierLabelFormatter = (i18n) => { */ $common.componentClassifierLabelProjectUrlFormatter = (i18n) => { return function (value) { - let url = "../projects/?classifier=" + value; + let url = '../projects/?classifier=' + value; switch (value) { case 'APPLICATION': case 'FRAMEWORK': @@ -369,11 +408,11 @@ $common.componentClassifierLabelProjectUrlFormatter = (i18n) => { case 'DEVICE': case 'FIRMWARE': case 'FILE': - return `${i18n.$t(`message.component_${value.toLowerCase()}`)}` + return `${i18n.$t(`message.component_${value.toLowerCase()}`)}`; default: return null; } - } + }; }; /** @@ -382,24 +421,61 @@ $common.componentClassifierLabelProjectUrlFormatter = (i18n) => { */ $common.formatTimestamp = function formatTimestamp(timestamp, includeTime) { let date = new Date(timestamp); - let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; - function pad(num) { return num < 10 ? "0" + num : num; } + let months = [ + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + ]; + function pad(num) { + return num < 10 ? '0' + num : num; + } if (includeTime) { - return date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear() + " at " + pad(date.getHours()) + ":" + pad(date.getMinutes()) + ":" + pad(date.getSeconds()); + return ( + date.getDate() + + ' ' + + months[date.getMonth()] + + ' ' + + date.getFullYear() + + ' at ' + + pad(date.getHours()) + + ':' + + pad(date.getMinutes()) + + ':' + + pad(date.getSeconds()) + ); } else { - return date.getDate() + " " + months[date.getMonth()] + " " + date.getFullYear(); + return ( + date.getDate() + ' ' + months[date.getMonth()] + ' ' + date.getFullYear() + ); } }; /* * Concatenates the group, name, and version of a component. */ -$common.concatenateComponentName = function concatenateComponentName(group, name, version) { +$common.concatenateComponentName = function concatenateComponentName( + group, + name, + version, +) { let g = $common.trimToNull(group); let n = $common.trimToNull(name); let v = $common.trimToNull(version); - return (g != null? g + " " : "") + (n != null? n : "") + (v != null? " " + v: ""); -} + return ( + (g != null ? g + ' ' : '') + + (n != null ? n : '') + + (v != null ? ' ' + v : '') + ); +}; /** * Helper function that returns the variable if it is not null, undefined, NaN, @@ -445,51 +521,59 @@ $common.sleep = function sleep(milliseconds) { /** * Converts a string representation of common boolean values and returns a boolean value. */ -$common.toBoolean = function(string) { +$common.toBoolean = function (string) { if (!string) { return false; } - if (typeof string == "boolean") { + if (typeof string == 'boolean') { return string; } - switch(string.toLowerCase().trim()) { - case "true": case "yes": case "1": return true; - case "false": case "no": case "0": case null: return false; - default: return Boolean(string); + switch (string.toLowerCase().trim()) { + case 'true': + case 'yes': + case '1': + return true; + case 'false': + case 'no': + case '0': + case null: + return false; + default: + return Boolean(string); } }; -$common.trimToNull = function(value) { +$common.trimToNull = function (value) { if (typeof value === 'undefined') { return null; - } else if (typeof value === 'string' && value.trim() === "") { + } else if (typeof value === 'string' && value.trim() === '') { return null; } return value; }; $common.OWASP_RR_LIKELIHOOD_TO_IMPACT_SEVERITY_MATRIX = { - "LOW" : { - "LOW": "INFO", - "MEDIUM": "LOW", - "HIGH": "MEDIUM" + LOW: { + LOW: 'INFO', + MEDIUM: 'LOW', + HIGH: 'MEDIUM', }, - "MEDIUM" : { - "LOW": "LOW", - "MEDIUM": "MEDIUM", - "HIGH": "HIGH" + MEDIUM: { + LOW: 'LOW', + MEDIUM: 'MEDIUM', + HIGH: 'HIGH', }, - "HIGH" : { - "LOW": "MEDIUM", - "MEDIUM": "HIGH", - "HIGH": "CRITICAL" + HIGH: { + LOW: 'MEDIUM', + MEDIUM: 'HIGH', + HIGH: 'CRITICAL', }, - "UNASSIGNED": { - "LOW": "UNASSIGNED", - "MEDIUM": "UNASSIGNED", - "HIGH": "UNASSIGNED" - } -} + UNASSIGNED: { + LOW: 'UNASSIGNED', + MEDIUM: 'UNASSIGNED', + HIGH: 'UNASSIGNED', + }, +}; export default { formatSourceLabel: $common.formatSourceLabel, @@ -504,9 +588,11 @@ export default { resolveSourceVulnInfo: $common.resolveSourceVulnInfo, resolveVulnAliases: $common.resolveVulnAliases, makeAnalysisStateLabelFormatter: $common.makeAnalysisStateLabelFormatter, - makeAnalysisJustificationLabelFormatter: $common.makeAnalysisJustificationLabelFormatter, + makeAnalysisJustificationLabelFormatter: + $common.makeAnalysisJustificationLabelFormatter, componentClassifierLabelFormatter: $common.componentClassifierLabelFormatter, - componentClassifierLabelProjectUrlFormatter: $common.componentClassifierLabelProjectUrlFormatter, + componentClassifierLabelProjectUrlFormatter: + $common.componentClassifierLabelProjectUrlFormatter, formatTimestamp: $common.formatTimestamp, concatenateComponentName: $common.concatenateComponentName, valueWithDefault: $common.valueWithDefault, @@ -514,5 +600,6 @@ export default { sleep: $common.sleep, toBoolean: $common.toBoolean, trimToNull: $common.trimToNull, - OWASP_RR_LIKELIHOOD_TO_IMPACT_SEVERITY_MATRIX: $common.OWASP_RR_LIKELIHOOD_TO_IMPACT_SEVERITY_MATRIX + OWASP_RR_LIKELIHOOD_TO_IMPACT_SEVERITY_MATRIX: + $common.OWASP_RR_LIKELIHOOD_TO_IMPACT_SEVERITY_MATRIX, }; diff --git a/src/shared/oidc.json b/src/shared/oidc.json index 90bfd8930..16d6f4c04 100644 --- a/src/shared/oidc.json +++ b/src/shared/oidc.json @@ -1,7 +1,7 @@ { - "ISSUER": "", - "CLIENT_ID": "", - "SCOPE": "", - "FLOW": "", - "LOGIN_BUTTON_TEXT": "" + "ISSUER": "", + "CLIENT_ID": "", + "SCOPE": "", + "FLOW": "", + "LOGIN_BUTTON_TEXT": "" } diff --git a/src/shared/permissions.js b/src/shared/permissions.js index 54aeeccd4..14016e65f 100644 --- a/src/shared/permissions.js +++ b/src/shared/permissions.js @@ -1,15 +1,15 @@ // API Permissions -export const BOM_UPLOAD = "BOM_UPLOAD"; -export const VIEW_PORTFOLIO = "VIEW_PORTFOLIO"; -export const PORTFOLIO_MANAGEMENT = "PORTFOLIO_MANAGEMENT"; -export const ACCESS_MANAGEMENT = "ACCESS_MANAGEMENT"; -export const VIEW_VULNERABILITY = "VIEW_VULNERABILITY"; -export const VULNERABILITY_ANALYSIS = "VULNERABILITY_ANALYSIS"; -export const VIEW_POLICY_VIOLATION = "VIEW_POLICY_VIOLATION"; -export const VULNERABILITY_MANAGEMENT = "VULNERABILITY_MANAGEMENT"; -export const POLICY_VIOLATION_ANALYSIS = "POLICY_VIOLATION_ANALYSIS"; -export const SYSTEM_CONFIGURATION = "SYSTEM_CONFIGURATION"; -export const POLICY_MANAGEMENT = "POLICY_MANAGEMENT"; +export const BOM_UPLOAD = 'BOM_UPLOAD'; +export const VIEW_PORTFOLIO = 'VIEW_PORTFOLIO'; +export const PORTFOLIO_MANAGEMENT = 'PORTFOLIO_MANAGEMENT'; +export const ACCESS_MANAGEMENT = 'ACCESS_MANAGEMENT'; +export const VIEW_VULNERABILITY = 'VIEW_VULNERABILITY'; +export const VULNERABILITY_ANALYSIS = 'VULNERABILITY_ANALYSIS'; +export const VIEW_POLICY_VIOLATION = 'VIEW_POLICY_VIOLATION'; +export const VULNERABILITY_MANAGEMENT = 'VULNERABILITY_MANAGEMENT'; +export const POLICY_VIOLATION_ANALYSIS = 'POLICY_VIOLATION_ANALYSIS'; +export const SYSTEM_CONFIGURATION = 'SYSTEM_CONFIGURATION'; +export const POLICY_MANAGEMENT = 'POLICY_MANAGEMENT'; /** * Determines if the current logged in user has a specific permission. @@ -35,5 +35,5 @@ export const decodeToken = function decodeToken(token) { * Retrieves the token from session storage. */ export const getToken = function getToken() { - return sessionStorage.getItem("token"); + return sessionStorage.getItem('token'); }; diff --git a/src/shared/toggle-classes.js b/src/shared/toggle-classes.js index 7ee250dd4..51d3caa66 100644 --- a/src/shared/toggle-classes.js +++ b/src/shared/toggle-classes.js @@ -1,4 +1,4 @@ -export default function toggleClasses (toggleClass, classList, force) { +export default function toggleClasses(toggleClass, classList, force) { const level = classList.indexOf(toggleClass); const removeClassList = classList.slice(0, level); removeClassList.map((className) => document.body.classList.remove(className)); diff --git a/src/shared/utils.js b/src/shared/utils.js index e87e0472d..f5c30de06 100644 --- a/src/shared/utils.js +++ b/src/shared/utils.js @@ -1,7 +1,7 @@ -import common from "@/shared/common"; -import flexVerCompare from "flexver/dist/module"; +import common from '@/shared/common'; +import flexVerCompare from 'flexver/dist/module'; -export function random (min, max) { +export function random(min, max) { return Math.floor(Math.random() * (max - min + 1) + min); } @@ -23,7 +23,7 @@ export const shuffleArray = (array) => { * Provides a function to extract a param from the querystring. */ export function getUrlVar(name) { - return (new URLSearchParams(window.location.search)).get(name); + return new URLSearchParams(window.location.search).get(name); } /** @@ -32,13 +32,29 @@ export function getUrlVar(name) { * @returns {string} redirect to url if it save for redirection */ export function getRedirectUrl(router) { - return router.currentRoute.query.redirect && isUrlSaveForRedirect(router.currentRoute.query.redirect) ? router.currentRoute.query.redirect : undefined; + return router.currentRoute.query.redirect && + isUrlSaveForRedirect(router.currentRoute.query.redirect) + ? router.currentRoute.query.redirect + : undefined; } // An array of acceptable root context paths defined in the UI. const acceptableRootContextPaths = [ - '/dashboard', '/projects', '/components', '/services', '/vulnerabilities', '/licenses', '/policy', '/admin', - '/project', '/component', '/vulnerability', '/license', '/vulnerabilityAudit', '/login', '/change-password' + '/dashboard', + '/projects', + '/components', + '/services', + '/vulnerabilities', + '/licenses', + '/policy', + '/admin', + '/project', + '/component', + '/vulnerability', + '/license', + '/vulnerabilityAudit', + '/login', + '/change-password', ]; /** @@ -50,10 +66,14 @@ export function isUrlSaveForRedirect(redirectUrl) { const contextRoot = getContextPath(); try { const resultingUrl = new URL(redirectUrl, window.location.origin); - return resultingUrl.origin === window.location.origin // catches redirectUrls like //foo.bar - && /^https?:$/.test(resultingUrl.protocol) // catches file and blob protocol because for "blob:https://mozilla.org" origin will be returned as "https://mozilla.org". - && acceptableRootContextPaths.map(r => contextRoot + r).some(p => redirectUrl.startsWith(p)); - } catch(invalidUrl) { + return ( + resultingUrl.origin === window.location.origin && // catches redirectUrls like //foo.bar + /^https?:$/.test(resultingUrl.protocol) && // catches file and blob protocol because for "blob:https://mozilla.org" origin will be returned as "https://mozilla.org". + acceptableRootContextPaths + .map((r) => contextRoot + r) + .some((p) => redirectUrl.startsWith(p)) + ); + } catch (invalidUrl) { return false; } } @@ -62,27 +82,41 @@ export function isUrlSaveForRedirect(redirectUrl) { * Returns the context from which the webapp is running. */ export function getContextPath() { - if (acceptableRootContextPaths.some(p => window.location.pathname.startsWith(p))) { + if ( + acceptableRootContextPaths.some((p) => + window.location.pathname.startsWith(p), + ) + ) { // App is deployed in the root context. Return an empty string. - return ""; + return ''; } else { // App is deployed in a non-root context. Return the context. - return window.location.pathname.substring(0, window.location.pathname.indexOf("/",2)); + return window.location.pathname.substring( + 0, + window.location.pathname.indexOf('/', 2), + ); } } export function loadUserPreferencesForBootstrapTable(_this, id, columns) { const table = _this.$refs.table; if (!table) { - console.error("No table defined in the calling component; Can't apply user preferences"); + console.error( + "No table defined in the calling component; Can't apply user preferences", + ); return; } columns.forEach((column) => { const isVisible = column.visible; - const shouldShow = (localStorage && localStorage.getItem(id + "Show" + common.capitalize(column.field)) !== null) - ? (localStorage.getItem(id + "Show" + common.capitalize(column.field)) === "true") - : isVisible; + const shouldShow = + localStorage && + localStorage.getItem(id + 'Show' + common.capitalize(column.field)) !== + null + ? localStorage.getItem( + id + 'Show' + common.capitalize(column.field), + ) === 'true' + : isVisible; if (isVisible !== shouldShow) { if (shouldShow) { table.showColumn(column.field); @@ -90,7 +124,7 @@ export function loadUserPreferencesForBootstrapTable(_this, id, columns) { table.hideColumn(column.field); } } - }) + }); } export function compareVersions(v1, v2) { @@ -108,22 +142,22 @@ export function compareVersions(v1, v2) { } let v1parts = v1.split(':'); let v2parts = v2.split(':'); - if ((v1parts.length > 1) || (v2parts.length > 1)) { + if (v1parts.length > 1 || v2parts.length > 1) { return compareEpochVersions(v1parts, v2parts); } return flexVerCompare(v1, v2); } function compareEpochVersions(v1parts, v2parts) { - // compare epoch - let v1epoch = v1parts.length > 1 ? v1parts[0] : "0"; - let v1version = v1parts.length > 1 ? v1parts[1] : v1parts[0]; - let v2epoch = v2parts.length > 1 ? v2parts[0] : "0"; - let v2version = v2parts.length > 1 ? v2parts[1] : v2parts[0]; - let epochCompare=flexVerCompare(v1epoch, v2epoch); - if (epochCompare == 0) { - return flexVerCompare(v1version, v2version); - } else { - return epochCompare; - } + // compare epoch + let v1epoch = v1parts.length > 1 ? v1parts[0] : '0'; + let v1version = v1parts.length > 1 ? v1parts[1] : v1parts[0]; + let v2epoch = v2parts.length > 1 ? v2parts[0] : '0'; + let v2version = v2parts.length > 1 ? v2parts[1] : v2parts[0]; + let epochCompare = flexVerCompare(v1epoch, v2epoch); + if (epochCompare == 0) { + return flexVerCompare(v1version, v2version); + } else { + return epochCompare; + } } diff --git a/src/validation/index.js b/src/validation/index.js index e389636e2..b4387faa1 100644 --- a/src/validation/index.js +++ b/src/validation/index.js @@ -1,11 +1,16 @@ -import { extend, configure } from 'vee-validate' -import { required, confirmed, min_value, max_value } from 'vee-validate/dist/rules' +import { extend, configure } from 'vee-validate'; +import { + required, + confirmed, + min_value, + max_value, +} from 'vee-validate/dist/rules'; -import i18n from '../i18n' +import i18n from '../i18n'; // Get rule localization based on the rule name configure({ - defaultMessage: (_, values) => i18n.t(`validation.${values._rule_}`, values) + defaultMessage: (_, values) => i18n.t(`validation.${values._rule_}`, values), }); extend('required', required); diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index b1bec51e0..c0f3bedcb 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -4,41 +4,80 @@ -

{{ $t('message.portfolio_vulnerabilities') }}

+

+ {{ $t('message.portfolio_vulnerabilities') }} +

- {{$t('message.last_measurement')}}: {{lastMeasurement}} + {{ $t('message.last_measurement') }}: {{ lastMeasurement + }}
- - +
- +
{{ $t('severity.critical') }}
- {{critical}} ({{criticalPercent}}%) - + {{ critical }} ({{ criticalPercent }}%) +
{{ $t('severity.high') }}
- {{high}} ({{highPercent}}%) - + {{ high }} ({{ highPercent }}%) +
{{ $t('severity.medium') }}
- {{medium}} ({{mediumPercent}}%) - + {{ medium }} ({{ mediumPercent }}%) +
{{ $t('severity.low') }}
- {{low}} ({{lowPercent}}%) - + {{ low }} ({{ lowPercent }}%) +
{{ $t('severity.unassigned') }}
- {{unassigned}} ({{unassignedPercent}}%) - + {{ unassigned }} ({{ unassignedPercent }}%) +
@@ -49,28 +88,59 @@ -

{{ $t('message.policy_violations') }}

-
{{$t('message.policy_violations_by_state')}}
-
- +

+ {{ $t('message.policy_violations') }} +

+
+ {{ $t('message.policy_violations_by_state') }} +
+
-
+ +
-
{{ $t("policy_violation.fails") }}
- {{ failViolations }} ({{ failViolationsPercent }}%) - +
{{ $t('policy_violation.fails') }}
+ {{ failViolations }} ({{ failViolationsPercent }}%) +
-
{{ $t("policy_violation.warns") }}
- {{ warnViolations }} ({{ warnViolationsPercent }}%) - +
{{ $t('policy_violation.warns') }}
+ {{ warnViolations }} ({{ warnViolationsPercent }}%) +
-
{{ $t("policy_violation.infos") }}
- {{ infoViolations }} ({{ infoViolationsPercent }}%) - +
{{ $t('policy_violation.infos') }}
+ {{ infoViolations }} ({{ infoViolationsPercent }}%) +
@@ -80,28 +150,74 @@ -

{{ $t('message.policy_violations') }}

-
{{$t('message.policy_violations_by_classification')}}
- +

+ {{ $t('message.policy_violations') }} +

+
+ {{ $t('message.policy_violations_by_classification') }} +
+
- +
-
{{ $t("policy_violation.security") }}
- {{ securityViolations }} ({{ securityViolationsPercent }}%) - +
+ {{ $t('policy_violation.security') }} +
+ {{ securityViolations }} ({{ + securityViolationsPercent + }}%) +
-
{{ $t("policy_violation.operational") }}
- {{ operationalViolations }} ({{ operationalViolationsPercent }}%) - +
+ {{ $t('policy_violation.operational') }} +
+ {{ operationalViolations }} ({{ + operationalViolationsPercent + }}%) +
-
{{ $t("policy_violation.license") }}
- {{ licenseViolations }} ({{ licenseViolationsPercent }}%) - +
+ {{ $t('policy_violation.license') }} +
+ {{ licenseViolations }} ({{ + licenseViolationsPercent + }}%) +
@@ -114,24 +230,51 @@ -

{{ $t('message.auditing_progress') }}

-
{{ $t('message.findings') }}
-
- +

+ {{ $t('message.auditing_progress') }} +

+
{{ $t('message.findings') }}
+
- +
-
{{ $t("message.findings_unaudited") }}
- {{ unauditedFindings }} ({{ unauditedFindingsPercent }}%) - +
+ {{ $t('message.findings_unaudited') }} +
+ {{ unauditedFindings }} ({{ + unauditedFindingsPercent + }}%) +
-
{{ $t("message.findings_audited") }}
- {{ auditedFindings }} ({{ auditedFindingsPercent }}%) - +
+ {{ $t('message.findings_audited') }} +
+ {{ auditedFindings }} ({{ auditedFindingsPercent }}%) +
@@ -141,24 +284,58 @@ -

{{ $t('message.auditing_progress') }}

-
{{$t('message.policy_violations')}}
-
- +

+ {{ $t('message.auditing_progress') }} +

+
+ {{ $t('message.policy_violations') }} +
+
- +
-
{{ $t('message.violations_unaudited') }}
- {{unauditedViolations}} ({{unauditedViolationsPercent}}%) - +
+ {{ $t('message.violations_unaudited') }} +
+ {{ unauditedViolations }} ({{ + unauditedViolationsPercent + }}%) +
-
{{ $t('message.violations_audited') }}
- {{auditedViolations}} ({{auditedViolationsPercent}}%) - +
+ {{ $t('message.violations_audited') }} +
+ {{ auditedViolations }} ({{ + auditedViolationsPercent + }}%) +
@@ -171,23 +348,48 @@ -

{{ $t('message.projects') }}

-
- +

+ {{ $t('message.projects') }} +

+
- +
-
{{ $t("message.non_vulnerable") }}
- {{ nonVulnerableProjects }} ({{ nonVulnerableProjectsPercent }}%) - +
{{ $t('message.non_vulnerable') }}
+ {{ nonVulnerableProjects }} ({{ + nonVulnerableProjectsPercent + }}%) +
-
{{ $t("message.vulnerable") }}
- {{ vulnerableProjects }} ({{ vulnerableProjectsPercent }}%) - +
{{ $t('message.vulnerable') }}
+ {{ vulnerableProjects }} ({{ + vulnerableProjectsPercent + }}%) +
@@ -197,23 +399,48 @@ -

{{ $t('message.components') }}

-
- +

+ {{ $t('message.components') }} +

+
- +
-
{{ $t("message.non_vulnerable") }}
- {{ nonVulnerableComponents }} ({{ nonVulnerableComponentsPercent }}%) - +
{{ $t('message.non_vulnerable') }}
+ {{ nonVulnerableComponents }} ({{ + nonVulnerableComponentsPercent + }}%) +
-
{{ $t("message.vulnerable") }}
- {{ vulnerableComponents }} ({{ vulnerableComponentsPercent }}%) - +
{{ $t('message.vulnerable') }}
+ {{ vulnerableComponents }} ({{ + vulnerableComponentsPercent + }}%) +
@@ -229,14 +456,20 @@ - {{ $t('message.projects') }}
- {{totalProjects}} + {{ + $t('message.projects') + }}
+ {{ totalProjects }}
- {{ $t('message.vulnerable_projects') }}
- {{vulnerableProjects}} + {{ + $t('message.vulnerable_projects') + }}
+ {{ vulnerableProjects }}
@@ -245,14 +478,20 @@ - {{ $t('message.components') }}
- {{totalComponents}} + {{ + $t('message.components') + }}
+ {{ totalComponents }}
- {{ $t('message.vulnerable_components') }}
- {{vulnerableComponents}} + {{ + $t('message.vulnerable_components') + }}
+ {{ vulnerableComponents }}
@@ -261,14 +500,20 @@ - {{ $t('message.portfolio_vulnerabilities') }}
- {{vulnerabilities}} + {{ + $t('message.portfolio_vulnerabilities') + }}
+ {{ vulnerabilities }}
- {{ $t('message.suppressed') }}
- {{suppressed}} + {{ + $t('message.suppressed') + }}
+ {{ suppressed }}
@@ -279,14 +524,20 @@ - {{ $t('message.policy_violations') }}
- {{totalViolations}} + {{ + $t('message.policy_violations') + }}
+ {{ totalViolations }}
- {{ $t('policy_violation.license') }}
- {{licenseViolations}} + {{ + $t('policy_violation.license') + }}
+ {{ licenseViolations }}
@@ -295,14 +546,20 @@ - {{ $t('policy_violation.operational') }}
- {{operationalViolations}} + {{ + $t('policy_violation.operational') + }}
+ {{ operationalViolations }}
- {{ $t('policy_violation.security') }}
- {{securityViolations}} + {{ + $t('policy_violation.security') + }}
+ {{ securityViolations }}
@@ -311,176 +568,276 @@
-
diff --git a/src/views/administration/AdminMenu.vue b/src/views/administration/AdminMenu.vue index 6984c03b6..3afaca14b 100644 --- a/src/views/administration/AdminMenu.vue +++ b/src/views/administration/AdminMenu.vue @@ -1,307 +1,334 @@ diff --git a/src/views/administration/Administration.vue b/src/views/administration/Administration.vue index 203765c83..73ac0f626 100644 --- a/src/views/administration/Administration.vue +++ b/src/views/administration/Administration.vue @@ -15,66 +15,97 @@ diff --git a/src/views/administration/repositories/Cargo.vue b/src/views/administration/repositories/Cargo.vue index 51dfb0b44..8e79c13bd 100644 --- a/src/views/administration/repositories/Cargo.vue +++ b/src/views/administration/repositories/Cargo.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Composer.vue b/src/views/administration/repositories/Composer.vue index 930fdae95..8ea3e75ba 100644 --- a/src/views/administration/repositories/Composer.vue +++ b/src/views/administration/repositories/Composer.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Cpan.vue b/src/views/administration/repositories/Cpan.vue index 585b715fb..22a1da8a8 100644 --- a/src/views/administration/repositories/Cpan.vue +++ b/src/views/administration/repositories/Cpan.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Gem.vue b/src/views/administration/repositories/Gem.vue index a1b7a11b3..3715a41c8 100644 --- a/src/views/administration/repositories/Gem.vue +++ b/src/views/administration/repositories/Gem.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/GitHub.vue b/src/views/administration/repositories/GitHub.vue index 1e2f1c35c..8585f9e9a 100644 --- a/src/views/administration/repositories/GitHub.vue +++ b/src/views/administration/repositories/GitHub.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/GoModules.vue b/src/views/administration/repositories/GoModules.vue index f30f2a30b..36cdb9cb6 100644 --- a/src/views/administration/repositories/GoModules.vue +++ b/src/views/administration/repositories/GoModules.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Hex.vue b/src/views/administration/repositories/Hex.vue index 91d0082e0..4fb46c088 100644 --- a/src/views/administration/repositories/Hex.vue +++ b/src/views/administration/repositories/Hex.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Maven.vue b/src/views/administration/repositories/Maven.vue index 024b79aeb..05baa22c4 100644 --- a/src/views/administration/repositories/Maven.vue +++ b/src/views/administration/repositories/Maven.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Npm.vue b/src/views/administration/repositories/Npm.vue index c2b39540c..e65b263d1 100644 --- a/src/views/administration/repositories/Npm.vue +++ b/src/views/administration/repositories/Npm.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Nuget.vue b/src/views/administration/repositories/Nuget.vue index 44d98d13c..e3512976b 100644 --- a/src/views/administration/repositories/Nuget.vue +++ b/src/views/administration/repositories/Nuget.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Python.vue b/src/views/administration/repositories/Python.vue index 4cd7bf4be..2cac02a05 100644 --- a/src/views/administration/repositories/Python.vue +++ b/src/views/administration/repositories/Python.vue @@ -3,13 +3,13 @@ diff --git a/src/views/administration/repositories/Repositories.vue b/src/views/administration/repositories/Repositories.vue index 94e8dc030..7ea296d9f 100644 --- a/src/views/administration/repositories/Repositories.vue +++ b/src/views/administration/repositories/Repositories.vue @@ -2,7 +2,11 @@
- + {{ $t('admin.create_repository') }}
@@ -10,125 +14,129 @@ ref="table" :columns="columns" :data="data" - :options="options"> + :options="options" + >
- +
diff --git a/src/views/administration/repositories/RepositoryCreateRepositoryModal.vue b/src/views/administration/repositories/RepositoryCreateRepositoryModal.vue index e202f26be..23a759e5d 100644 --- a/src/views/administration/repositories/RepositoryCreateRepositoryModal.vue +++ b/src/views/administration/repositories/RepositoryCreateRepositoryModal.vue @@ -1,5 +1,12 @@ diff --git a/src/views/administration/vuln-sources/EcosystemModal.vue b/src/views/administration/vuln-sources/EcosystemModal.vue index 33abc4a81..4d514e928 100644 --- a/src/views/administration/vuln-sources/EcosystemModal.vue +++ b/src/views/administration/vuln-sources/EcosystemModal.vue @@ -1,68 +1,82 @@ \ No newline at end of file + }, + ], + data: [], + options: { + search: true, + showColumns: true, + showRefresh: true, + pagination: true, + silentSort: false, + sidePagination: 'client', + queryParamsType: 'pageSize', + pageList: '[10, 25, 50, 100]', + pageSize: 10, + icons: { + refresh: 'fa-refresh', + }, + responseHandler: function (res, xhr) { + res.total = xhr.getResponseHeader('X-Total-Count'); + return res.map((ecosystem) => ({ + name: ecosystem, + })); + }, + url: `${this.$api.BASE_URL}/${this.$api.URL_OSV_ECOSYSTEM}/inactive`, + }, + }; + }, +}; + diff --git a/src/views/administration/vuln-sources/VulnSourceGitHubAdvisories.vue b/src/views/administration/vuln-sources/VulnSourceGitHubAdvisories.vue index 3c3fa2cb7..852307b68 100644 --- a/src/views/administration/vuln-sources/VulnSourceGitHubAdvisories.vue +++ b/src/views/administration/vuln-sources/VulnSourceGitHubAdvisories.vue @@ -1,8 +1,8 @@ diff --git a/src/views/components/PolicyViolationProgressBar.vue b/src/views/components/PolicyViolationProgressBar.vue index be13a8916..a766fd6e3 100644 --- a/src/views/components/PolicyViolationProgressBar.vue +++ b/src/views/components/PolicyViolationProgressBar.vue @@ -6,29 +6,52 @@ - - - - + + + + - -
-
{{$t('message.type')}}
-

- {{$t('policy_violation.license')}}: {{ metrics.policyViolationsLicenseTotal }}
- {{$t('policy_violation.operational')}}: {{ metrics.policyViolationsOperationalTotal }}
- {{$t('policy_violation.security')}}: {{ metrics.policyViolationsSecurityTotal }}
-

-
{{ $t('message.violation_state') }}
-

- {{$t('policy_violation.infos')}}: {{ metrics.policyViolationsInfo }}
- {{$t('policy_violation.warns')}}: {{ metrics.policyViolationsWarn }}
- {{$t('policy_violation.fails')}}: {{ metrics.policyViolationsFail }}
-

- {{$t('message.total')}}: {{ metrics.policyViolationsTotal }} -
-
+ +
+
{{ $t('message.type') }}
+

+ {{ $t('policy_violation.license') }}: + {{ metrics.policyViolationsLicenseTotal }}
+ {{ $t('policy_violation.operational') }}: + {{ metrics.policyViolationsOperationalTotal }}
+ {{ $t('policy_violation.security') }}: + {{ metrics.policyViolationsSecurityTotal }}
+

+
{{ $t('message.violation_state') }}
+

+ {{ $t('policy_violation.infos') }}: {{ metrics.policyViolationsInfo + }}
+ {{ $t('policy_violation.warns') }}: {{ metrics.policyViolationsWarn + }}
+ {{ $t('policy_violation.fails') }}: {{ metrics.policyViolationsFail + }}
+

+ {{ $t('message.total') }}: {{ metrics.policyViolationsTotal }} +
+
@@ -44,5 +67,5 @@ export default { hoverId: Math.random().toString(36), }; }, -} +}; diff --git a/src/views/components/ProfileEditModal.vue b/src/views/components/ProfileEditModal.vue index 95f63d1a6..088922b0c 100644 --- a/src/views/components/ProfileEditModal.vue +++ b/src/views/components/ProfileEditModal.vue @@ -1,66 +1,96 @@ diff --git a/src/views/components/SeverityProgressBar.vue b/src/views/components/SeverityProgressBar.vue index a2b9af7d3..a991131a5 100644 --- a/src/views/components/SeverityProgressBar.vue +++ b/src/views/components/SeverityProgressBar.vue @@ -7,45 +7,58 @@ - + - + - + - -
-
{{$t('message.severity')}}
+ +
+
{{ $t('message.severity') }}

- {{$t('severity.critical')}}: {{ critical }}
- {{$t('severity.high')}}: {{ high }}
- {{$t('severity.medium')}}: {{ medium }}
- {{$t('severity.low')}}: {{ low }}
- {{$t('severity.unassigned')}}: {{ unassigned }}
+ {{ $t('severity.critical') }}: {{ critical }}
+ {{ $t('severity.high') }}: {{ high }}
+ {{ $t('severity.medium') }}: {{ medium }}
+ {{ $t('severity.low') }}: {{ low }}
+ {{ $t('severity.unassigned') }}: {{ unassigned }}

- {{$t('message.total')}}: {{ vulnerabilities }} + {{ $t('message.total') }}: {{ vulnerabilities }}
diff --git a/src/views/components/Showdown.vue b/src/views/components/Showdown.vue index 7e3ab3cea..7bbf8abb9 100644 --- a/src/views/components/Showdown.vue +++ b/src/views/components/Showdown.vue @@ -3,22 +3,22 @@ diff --git a/src/views/components/SnapshotModal.vue b/src/views/components/SnapshotModal.vue index 02003cc89..3d9c757d2 100644 --- a/src/views/components/SnapshotModal.vue +++ b/src/views/components/SnapshotModal.vue @@ -1,16 +1,22 @@ diff --git a/src/views/dashboard/ChartAuditingFindingsProgress.vue b/src/views/dashboard/ChartAuditingFindingsProgress.vue index d0e17a2cd..969a71dc4 100644 --- a/src/views/dashboard/ChartAuditingFindingsProgress.vue +++ b/src/views/dashboard/ChartAuditingFindingsProgress.vue @@ -1,36 +1,37 @@ diff --git a/src/views/dashboard/ChartAuditingViolationsProgress.vue b/src/views/dashboard/ChartAuditingViolationsProgress.vue index 3f9a1eaf0..b66169ae2 100644 --- a/src/views/dashboard/ChartAuditingViolationsProgress.vue +++ b/src/views/dashboard/ChartAuditingViolationsProgress.vue @@ -1,36 +1,37 @@ diff --git a/src/views/dashboard/ChartComponentVulnerabilities.vue b/src/views/dashboard/ChartComponentVulnerabilities.vue index fbe6a4b99..932b9849c 100644 --- a/src/views/dashboard/ChartComponentVulnerabilities.vue +++ b/src/views/dashboard/ChartComponentVulnerabilities.vue @@ -1,40 +1,45 @@ diff --git a/src/views/dashboard/ChartEpssVsCvss.vue b/src/views/dashboard/ChartEpssVsCvss.vue index 69316cfe8..30e22553c 100644 --- a/src/views/dashboard/ChartEpssVsCvss.vue +++ b/src/views/dashboard/ChartEpssVsCvss.vue @@ -1,108 +1,122 @@ diff --git a/src/views/dashboard/ChartPolicyViolationBreakdown.vue b/src/views/dashboard/ChartPolicyViolationBreakdown.vue index 56579fa9a..0364d28be 100644 --- a/src/views/dashboard/ChartPolicyViolationBreakdown.vue +++ b/src/views/dashboard/ChartPolicyViolationBreakdown.vue @@ -4,40 +4,65 @@
{{ $t('message.security_risk') }} - {{ securityCount }} ({{ securityPercent }}%) + {{ securityCount }} + ({{ securityPercent }}%)
- +
{{ $t('message.license_risk') }} - {{ licenseCount }} ({{ licensePercent }}%) + {{ licenseCount }} + ({{ licensePercent }}%)
- +
{{ $t('message.operational_risk') }} - {{ operationalCount }} ({{ operationalPercent }}%) + {{ operationalCount }} + ({{ operationalPercent }}%)
- +
diff --git a/src/views/dashboard/ChartPolicyViolationsClassification.vue b/src/views/dashboard/ChartPolicyViolationsClassification.vue index 3ccc0f4a2..e56931f99 100644 --- a/src/views/dashboard/ChartPolicyViolationsClassification.vue +++ b/src/views/dashboard/ChartPolicyViolationsClassification.vue @@ -1,15 +1,15 @@ diff --git a/src/views/dashboard/ChartPolicyViolationsState.vue b/src/views/dashboard/ChartPolicyViolationsState.vue index 27c3641e1..20e187028 100644 --- a/src/views/dashboard/ChartPolicyViolationsState.vue +++ b/src/views/dashboard/ChartPolicyViolationsState.vue @@ -1,16 +1,16 @@ diff --git a/src/views/dashboard/ChartPortfolioVulnerabilities.vue b/src/views/dashboard/ChartPortfolioVulnerabilities.vue index c0c9f1e66..1da1ebea0 100644 --- a/src/views/dashboard/ChartPortfolioVulnerabilities.vue +++ b/src/views/dashboard/ChartPortfolioVulnerabilities.vue @@ -1,48 +1,49 @@ diff --git a/src/views/dashboard/ChartProjectVulnerabilities.vue b/src/views/dashboard/ChartProjectVulnerabilities.vue index dffc4d938..ceb4dc118 100644 --- a/src/views/dashboard/ChartProjectVulnerabilities.vue +++ b/src/views/dashboard/ChartProjectVulnerabilities.vue @@ -1,40 +1,45 @@ diff --git a/src/views/dashboard/PortfolioWidgetRow.vue b/src/views/dashboard/PortfolioWidgetRow.vue index cea73e117..96444e4cc 100644 --- a/src/views/dashboard/PortfolioWidgetRow.vue +++ b/src/views/dashboard/PortfolioWidgetRow.vue @@ -6,7 +6,13 @@

{{ portfolioVulnerabilities }}

{{ $t('message.portfolio_vulnerabilities') }}

- + @@ -15,7 +21,13 @@

{{ vulnerableProjects }}

{{ $t('message.projects_at_risk') }}

- +
@@ -24,7 +36,13 @@

{{ vulnerableComponents }}

{{ $t('message.vulnerable_components') }}

- +
@@ -33,60 +51,68 @@

{{ inheritedRiskScore }}

{{ $t('message.inherited_risk_score') }}

- +
diff --git a/src/views/dashboard/SeverityBarChart.vue b/src/views/dashboard/SeverityBarChart.vue index 1fd105814..b7d8e4fe9 100644 --- a/src/views/dashboard/SeverityBarChart.vue +++ b/src/views/dashboard/SeverityBarChart.vue @@ -1,63 +1,73 @@ diff --git a/src/views/dashboard/WidgetInheritedRiskScore.vue b/src/views/dashboard/WidgetInheritedRiskScore.vue index 43ffedba2..1ec938bb3 100644 --- a/src/views/dashboard/WidgetInheritedRiskScore.vue +++ b/src/views/dashboard/WidgetInheritedRiskScore.vue @@ -1,14 +1,14 @@ diff --git a/src/views/dashboard/WidgetPortfolioVulnerabilities.vue b/src/views/dashboard/WidgetPortfolioVulnerabilities.vue index 8ef1a31a9..fb6041369 100644 --- a/src/views/dashboard/WidgetPortfolioVulnerabilities.vue +++ b/src/views/dashboard/WidgetPortfolioVulnerabilities.vue @@ -1,17 +1,17 @@ diff --git a/src/views/dashboard/WidgetProjectsAtRisk.vue b/src/views/dashboard/WidgetProjectsAtRisk.vue index 5bf4f218c..463556a3b 100644 --- a/src/views/dashboard/WidgetProjectsAtRisk.vue +++ b/src/views/dashboard/WidgetProjectsAtRisk.vue @@ -1,14 +1,14 @@ diff --git a/src/views/dashboard/WidgetVulnerableComponents.vue b/src/views/dashboard/WidgetVulnerableComponents.vue index 2fb75c7f8..24a79f6e5 100644 --- a/src/views/dashboard/WidgetVulnerableComponents.vue +++ b/src/views/dashboard/WidgetVulnerableComponents.vue @@ -1,14 +1,14 @@ diff --git a/src/views/globalAudit/VulnerabilityAudit.vue b/src/views/globalAudit/VulnerabilityAudit.vue index e34c2e1d4..8de10af22 100644 --- a/src/views/globalAudit/VulnerabilityAudit.vue +++ b/src/views/globalAudit/VulnerabilityAudit.vue @@ -1,12 +1,37 @@ diff --git a/src/views/globalAudit/VulnerabilityAuditByOccurrence.vue b/src/views/globalAudit/VulnerabilityAuditByOccurrence.vue index e30cb3c45..806e1f351 100644 --- a/src/views/globalAudit/VulnerabilityAuditByOccurrence.vue +++ b/src/views/globalAudit/VulnerabilityAuditByOccurrence.vue @@ -3,79 +3,195 @@
-

{{ this.$t('message.filters') }}

- {{ this.$t('message.clear_all') }} -

- +

{{ this.$t('message.filters') }}

+ + {{ this.$t('message.clear_all') }} +

+ + unchecked-value="false" + > {{ this.$t('message.show_inactive_projects') }} - + + unchecked-value="false" + > {{ this.$t('message.show_suppressed_findings') }} - + + stacked + > - + + stacked + > - + + stacked + > - - - + + + - - - + + + - - + + Search in: + stacked + > - + - - + + - + - - + +
@@ -86,7 +202,8 @@ :columns="columns" :data="data" :options="options" - @on-load-success="onLoadSuccess"> + @on-load-success="onLoadSuccess" + >
@@ -94,404 +211,534 @@ diff --git a/src/views/globalAudit/VulnerabilityAuditGroupedByVulnerability.vue b/src/views/globalAudit/VulnerabilityAuditGroupedByVulnerability.vue index 26edf5897..893045c8e 100644 --- a/src/views/globalAudit/VulnerabilityAuditGroupedByVulnerability.vue +++ b/src/views/globalAudit/VulnerabilityAuditGroupedByVulnerability.vue @@ -2,56 +2,173 @@
-

{{ this.$t('message.filters') }}

- {{ this.$t('message.clear_all') }} -

- +

{{ this.$t('message.filters') }}

+ + {{ this.$t('message.clear_all') }} +

+ + unchecked-value="false" + > {{ this.$t('message.show_inactive_projects') }} - + + stacked + > - - - + + + - - + + Search in: + stacked + > - + - - + + - + - - + + - + - - + +
@@ -61,7 +178,8 @@ :columns="columns" :data="data" :options="options" - @on-load-success="onLoadSuccess"> + @on-load-success="onLoadSuccess" + >
@@ -69,340 +187,449 @@ diff --git a/src/views/modals/InformationalModal.vue b/src/views/modals/InformationalModal.vue index ea59a7758..a91936428 100644 --- a/src/views/modals/InformationalModal.vue +++ b/src/views/modals/InformationalModal.vue @@ -3,7 +3,10 @@
-
+
@@ -12,16 +15,20 @@
diff --git a/src/views/pages/Login.vue b/src/views/pages/Login.vue index 7d013eb1c..4ed9cb25c 100644 --- a/src/views/pages/Login.vue +++ b/src/views/pages/Login.vue @@ -37,33 +37,52 @@ lazy="true" v-show="showLoginForm" /> - + {{ $t('message.login') }} + >{{ $t('message.login') }} - - {{ oidcLoginButtonText() }} - OpenID Logo + + {{ + oidcLoginButtonText() + }} + OpenID Logo {{ $t('message.login_more_options') }} + v-show="oidcAvailable && !showLoginForm" + v-on:click="showLoginForm = true" + >{{ $t('message.login_more_options') }} - +
- +
@@ -76,125 +95,133 @@ diff --git a/src/views/pages/Page404.vue b/src/views/pages/Page404.vue index fee9c2a73..5d8e9005f 100644 --- a/src/views/pages/Page404.vue +++ b/src/views/pages/Page404.vue @@ -8,7 +8,9 @@

{{ $t('404.heading') }}

{{ $t('404.message') }}

- {{ $t('404.action') }} + {{ + $t('404.action') + }}
@@ -16,7 +18,7 @@ diff --git a/src/views/pages/PasswordForceChange.vue b/src/views/pages/PasswordForceChange.vue index 3b6118fa6..f4d987cb5 100644 --- a/src/views/pages/PasswordForceChange.vue +++ b/src/views/pages/PasswordForceChange.vue @@ -9,7 +9,9 @@

{{ $t('message.password_force_change') }}

-

{{ $t('message.password_force_change_desc') }}

+

+ {{ $t('message.password_force_change_desc') }} +

- {{ $t('message.password_change') }} + {{ $t('message.password_change') }}
- +
- +
@@ -70,70 +85,76 @@
- +
diff --git a/src/views/policy/CreateLicenseGroupModal.vue b/src/views/policy/CreateLicenseGroupModal.vue index e6e82936d..c4544c1be 100644 --- a/src/views/policy/CreateLicenseGroupModal.vue +++ b/src/views/policy/CreateLicenseGroupModal.vue @@ -1,51 +1,66 @@ diff --git a/src/views/policy/CreatePolicyModal.vue b/src/views/policy/CreatePolicyModal.vue index 21bc099f2..fbc25778d 100644 --- a/src/views/policy/CreatePolicyModal.vue +++ b/src/views/policy/CreatePolicyModal.vue @@ -1,52 +1,68 @@ diff --git a/src/views/policy/LicenseGroupList.vue b/src/views/policy/LicenseGroupList.vue index 9f16b7ea0..2a26ca2c2 100644 --- a/src/views/policy/LicenseGroupList.vue +++ b/src/views/policy/LicenseGroupList.vue @@ -1,8 +1,14 @@ diff --git a/src/views/policy/PolicyCondition.vue b/src/views/policy/PolicyCondition.vue index e40f377ed..205999aae 100644 --- a/src/views/policy/PolicyCondition.vue +++ b/src/views/policy/PolicyCondition.vue @@ -1,402 +1,541 @@ diff --git a/src/views/policy/PolicyList.vue b/src/views/policy/PolicyList.vue index 2710b31c2..9b430c7b7 100644 --- a/src/views/policy/PolicyList.vue +++ b/src/views/policy/PolicyList.vue @@ -1,7 +1,12 @@ diff --git a/src/views/policy/PolicyManagement.vue b/src/views/policy/PolicyManagement.vue index bfd7c66f1..3cc1cd92b 100644 --- a/src/views/policy/PolicyManagement.vue +++ b/src/views/policy/PolicyManagement.vue @@ -1,12 +1,30 @@ diff --git a/src/views/policy/SelectLicenseModal.vue b/src/views/policy/SelectLicenseModal.vue index 12f787057..a61d9fcf7 100644 --- a/src/views/policy/SelectLicenseModal.vue +++ b/src/views/policy/SelectLicenseModal.vue @@ -1,76 +1,92 @@ diff --git a/src/views/portfolio/components/ComponentSearch.vue b/src/views/portfolio/components/ComponentSearch.vue index ef9ab9e85..984e2f946 100644 --- a/src/views/portfolio/components/ComponentSearch.vue +++ b/src/views/portfolio/components/ComponentSearch.vue @@ -3,20 +3,53 @@
- - - - - - - - - - - - - {{ $t('message.search') }} - + + + + + + + + + + + + + {{ + $t('message.search') + }} +
+ @on-pre-body="onPreBody" + > diff --git a/src/views/portfolio/licenses/License.vue b/src/views/portfolio/licenses/License.vue index 77e8a77d3..854720594 100644 --- a/src/views/portfolio/licenses/License.vue +++ b/src/views/portfolio/licenses/License.vue @@ -1,7 +1,16 @@ diff --git a/src/views/portfolio/licenses/LicenseAddLicenseModal.vue b/src/views/portfolio/licenses/LicenseAddLicenseModal.vue index a1a35866f..4dc4862d5 100644 --- a/src/views/portfolio/licenses/LicenseAddLicenseModal.vue +++ b/src/views/portfolio/licenses/LicenseAddLicenseModal.vue @@ -1,88 +1,172 @@ diff --git a/src/views/portfolio/licenses/LicenseList.vue b/src/views/portfolio/licenses/LicenseList.vue index 50cc949a6..4f2cac108 100644 --- a/src/views/portfolio/licenses/LicenseList.vue +++ b/src/views/portfolio/licenses/LicenseList.vue @@ -2,7 +2,12 @@
- + {{ $t('message.add_license') }}
@@ -11,134 +16,155 @@ :columns="columns" :data="data" :options="options" - @on-load-success="onLoadSuccess"> + @on-load-success="onLoadSuccess" + > - +
diff --git a/src/views/portfolio/projects/Component.vue b/src/views/portfolio/projects/Component.vue index 32c7ecfb5..201f247cd 100644 --- a/src/views/portfolio/projects/Component.vue +++ b/src/views/portfolio/projects/Component.vue @@ -6,70 +6,92 @@
{{ componentLabel }}
- +
- {{ currentCritical }} - {{ currentHigh }} - {{ currentMedium }} - {{ currentLow }} - {{ currentUnassigned }} + {{ currentCritical }} + {{ currentHigh }} + {{ currentMedium }} + {{ currentLow }} + {{ currentUnassigned }} @@ -77,163 +99,224 @@ - - - - + + + + - - + + - + diff --git a/src/views/portfolio/projects/ComponentDashboard.vue b/src/views/portfolio/projects/ComponentDashboard.vue index d279cfc76..f59da26df 100644 --- a/src/views/portfolio/projects/ComponentDashboard.vue +++ b/src/views/portfolio/projects/ComponentDashboard.vue @@ -1,31 +1,47 @@ diff --git a/src/views/portfolio/projects/ComponentDetailsModal.vue b/src/views/portfolio/projects/ComponentDetailsModal.vue index bad34887b..c6906db25 100644 --- a/src/views/portfolio/projects/ComponentDetailsModal.vue +++ b/src/views/portfolio/projects/ComponentDetailsModal.vue @@ -1,320 +1,542 @@ diff --git a/src/views/portfolio/projects/ComponentVulnerabilities.vue b/src/views/portfolio/projects/ComponentVulnerabilities.vue index a38a85e97..f983b5ac0 100644 --- a/src/views/portfolio/projects/ComponentVulnerabilities.vue +++ b/src/views/portfolio/projects/ComponentVulnerabilities.vue @@ -5,189 +5,221 @@ :columns="columns" :data="data" :options="options" - @on-load-success="tableLoaded"> + @on-load-success="tableLoaded" + > diff --git a/src/views/portfolio/projects/FindingAudit.vue b/src/views/portfolio/projects/FindingAudit.vue index b271d8d4d..2668c0780 100644 --- a/src/views/portfolio/projects/FindingAudit.vue +++ b/src/views/portfolio/projects/FindingAudit.vue @@ -1,247 +1,472 @@ \ No newline at end of file + addComment: function () { + if (this.comment != null) { + this.callRestEndpoint( + this.analysisState, + this.analysisJustification, + this.analysisResponse, + this.analysisDetails, + this.comment, + null, + ); + } + this.comment = null; + }, + callRestEndpoint: function ( + analysisState, + analysisJustification, + analysisResponse, + analysisDetails, + comment, + isSuppressed, + ) { + let url = `${this.$api.BASE_URL}/${this.$api.URL_ANALYSIS}`; + this.axios + .put(url, { + project: this.projectUuid, + component: this.finding.component.uuid, + vulnerability: this.finding.vulnerability.uuid, + analysisState: analysisState, + analysisJustification: analysisJustification, + analysisResponse: analysisResponse, + analysisDetails: analysisDetails, + comment: comment, + isSuppressed: isSuppressed, + }) + .then((response) => { + this.$toastr.s(this.$t('message.updated')); + this.updateAnalysisData(response.data); + }) + .catch(() => { + this.$toastr.w(this.$t('condition.unsuccessful_action')); + }); + }, + }, + beforeMount() { + this.finding && this.getAnalysis(); + }, + components: { + BootstrapToggle, + }, +}; + diff --git a/src/views/portfolio/projects/Project.vue b/src/views/portfolio/projects/Project.vue index 1511e72d7..7bceb52d5 100644 --- a/src/views/portfolio/projects/Project.vue +++ b/src/views/portfolio/projects/Project.vue @@ -4,17 +4,49 @@ - +
{{ project.name }} -
    +
      @@ -22,80 +54,104 @@ {{ project.version }} - {{ project.description }} + {{ project.description }}
- {{ tag.name }} + {{ tag.name }}
- {{ currentCritical }} - {{ currentHigh }} - {{ currentMedium }} - {{ currentLow }} - {{ currentUnassigned }} + {{ currentCritical }} + {{ currentHigh }} + {{ currentMedium }} + {{ currentLow }} + {{ currentUnassigned }}
@@ -103,56 +159,167 @@ - - - - + + + + - - + + - - + + - - + + - + - + - - - + + + - - - + + + - + @@ -160,178 +327,219 @@ diff --git a/src/views/portfolio/projects/ProjectAddComponentModal.vue b/src/views/portfolio/projects/ProjectAddComponentModal.vue index 974cc0671..1faf4fb0d 100644 --- a/src/views/portfolio/projects/ProjectAddComponentModal.vue +++ b/src/views/portfolio/projects/ProjectAddComponentModal.vue @@ -1,142 +1,311 @@ diff --git a/src/views/portfolio/projects/ProjectAddVersionModal.vue b/src/views/portfolio/projects/ProjectAddVersionModal.vue index f12d0bd71..b332e1151 100644 --- a/src/views/portfolio/projects/ProjectAddVersionModal.vue +++ b/src/views/portfolio/projects/ProjectAddVersionModal.vue @@ -1,63 +1,132 @@ diff --git a/src/views/portfolio/projects/ProjectComponents.vue b/src/views/portfolio/projects/ProjectComponents.vue index cfc64dcfd..8f14c3f3a 100644 --- a/src/views/portfolio/projects/ProjectComponents.vue +++ b/src/views/portfolio/projects/ProjectComponents.vue @@ -2,37 +2,92 @@
- + {{ $t('message.add_component') }} - + {{ $t('message.remove_component') }} - + {{ $t('message.upload_bom') }} - {{ $t('message.upload_bom_tooltip') }} - + {{ + $t('message.upload_bom_tooltip') + }} + - {{ $t('message.inventory') }} - {{ $t('message.inventory_with_vulnerabilities') }} + {{ + $t('message.inventory') + }} + {{ $t('message.inventory_with_vulnerabilities') }} - - - {{ $t('message.outdated_only') }} - {{ $t('message.only_outdated_tooltip') }} - - - {{ $t('message.direct_only') }} - {{ $t('message.only_direct_tooltip') }} + + + {{ + $t('message.outdated_only') + }} + {{ + $t('message.only_outdated_tooltip') + }} + + + {{ $t('message.direct_only') }} + {{ + $t('message.only_direct_tooltip') + }}
+ @on-load-success="tableLoaded" + > - +
diff --git a/src/views/portfolio/projects/ProjectCreateProjectModal.vue b/src/views/portfolio/projects/ProjectCreateProjectModal.vue index 9a073e7c6..bc9062ac3 100644 --- a/src/views/portfolio/projects/ProjectCreateProjectModal.vue +++ b/src/views/portfolio/projects/ProjectCreateProjectModal.vue @@ -1,64 +1,168 @@ diff --git a/src/views/portfolio/projects/ProjectCreatePropertyModal.vue b/src/views/portfolio/projects/ProjectCreatePropertyModal.vue index dbcbc6488..71780fd4b 100644 --- a/src/views/portfolio/projects/ProjectCreatePropertyModal.vue +++ b/src/views/portfolio/projects/ProjectCreatePropertyModal.vue @@ -1,100 +1,128 @@ diff --git a/src/views/portfolio/projects/ProjectDashboard.vue b/src/views/portfolio/projects/ProjectDashboard.vue index e2d4125cf..f3b25aad1 100644 --- a/src/views/portfolio/projects/ProjectDashboard.vue +++ b/src/views/portfolio/projects/ProjectDashboard.vue @@ -1,43 +1,57 @@ diff --git a/src/views/portfolio/projects/ProjectDependencyGraph.vue b/src/views/portfolio/projects/ProjectDependencyGraph.vue index 38bd87326..73553a16e 100644 --- a/src/views/portfolio/projects/ProjectDependencyGraph.vue +++ b/src/views/portfolio/projects/ProjectDependencyGraph.vue @@ -2,50 +2,93 @@
Loading, please wait...
-
- - +
+ + {{ $t('message.show_complete_graph') }} - - {{$t('message.show_update_information')}}
+ + {{ $t('message.show_update_information') }}
- {{ $t('message.not_found_in_dependency_graph') }}
+ {{ + $t('message.not_found_in_dependency_graph') + }}
diff --git a/src/views/portfolio/projects/ProjectEpss.vue b/src/views/portfolio/projects/ProjectEpss.vue index c037a1507..6c8a6a4d2 100644 --- a/src/views/portfolio/projects/ProjectEpss.vue +++ b/src/views/portfolio/projects/ProjectEpss.vue @@ -1,13 +1,28 @@ diff --git a/src/views/portfolio/projects/ProjectFindings.vue b/src/views/portfolio/projects/ProjectFindings.vue index 3b0165d99..7cabc660a 100644 --- a/src/views/portfolio/projects/ProjectFindings.vue +++ b/src/views/portfolio/projects/ProjectFindings.vue @@ -5,34 +5,67 @@ dropdown for version is changes, the table will not update. For whatever reason, adding the toolbar fixes it. -->
- + {{ $t('message.apply_vex') }} - {{ $t('message.apply_vex_tooltip') }} + {{ + $t('message.apply_vex_tooltip') + }} - + {{ $t('message.export_vex') }} - {{ $t('message.export_vex_tooltip') }} + {{ + $t('message.export_vex_tooltip') + }} - + {{ $t('message.export_vdr') }} - {{ $t('message.export_vdr_tooltip') }} + {{ + $t('message.export_vdr_tooltip') + }} - - {{ $t('message.project_reanalyze') }} + + + {{ $t('message.project_reanalyze') }} - {{ $t('message.project_reanalyze_tooltip') }} - + {{ + $t('message.project_reanalyze_tooltip') + }} - {{ $t('message.show_suppressed_findings') }} + {{ + $t('message.show_suppressed_findings') + }}
+ @on-load-success="tableLoaded" + > @@ -60,263 +103,355 @@ diff --git a/src/views/portfolio/projects/ProjectList.vue b/src/views/portfolio/projects/ProjectList.vue index 255ff29a3..9e8229fdd 100644 --- a/src/views/portfolio/projects/ProjectList.vue +++ b/src/views/portfolio/projects/ProjectList.vue @@ -2,11 +2,36 @@
- + {{ $t('message.create_project') }} - {{ $t('message.show_inactive_projects') }} - {{ $t('message.show_flat_view') }} + {{ + $t('message.show_inactive_projects') + }} + {{ $t('message.show_flat_view') }}
+ @on-post-body="onPostBody" + > - +
diff --git a/src/views/portfolio/projects/ProjectPolicyViolations.vue b/src/views/portfolio/projects/ProjectPolicyViolations.vue index 2f187385f..75295f363 100644 --- a/src/views/portfolio/projects/ProjectPolicyViolations.vue +++ b/src/views/portfolio/projects/ProjectPolicyViolations.vue @@ -5,7 +5,16 @@ dropdown for version is changes, the table will not update. For whatever reason, adding the toolbar fixes it. -->
- {{ $t('message.show_suppressed_violations') }} + {{ + $t('message.show_suppressed_violations') + }}
+ @on-load-success="tableLoaded" + >
diff --git a/src/views/portfolio/projects/ProjectPropertiesModal.vue b/src/views/portfolio/projects/ProjectPropertiesModal.vue index 5d17ee2f9..f5dbeae08 100644 --- a/src/views/portfolio/projects/ProjectPropertiesModal.vue +++ b/src/views/portfolio/projects/ProjectPropertiesModal.vue @@ -1,124 +1,144 @@ diff --git a/src/views/portfolio/projects/ProjectServices.vue b/src/views/portfolio/projects/ProjectServices.vue index 00367939b..7b9d9838f 100644 --- a/src/views/portfolio/projects/ProjectServices.vue +++ b/src/views/portfolio/projects/ProjectServices.vue @@ -5,83 +5,86 @@ :columns="columns" :data="data" :options="options" - @on-load-success="tableLoaded"> + @on-load-success="tableLoaded" + > diff --git a/src/views/portfolio/projects/ProjectUploadBomModal.vue b/src/views/portfolio/projects/ProjectUploadBomModal.vue index c1a7b8f4c..abdb1675c 100644 --- a/src/views/portfolio/projects/ProjectUploadBomModal.vue +++ b/src/views/portfolio/projects/ProjectUploadBomModal.vue @@ -1,50 +1,72 @@ diff --git a/src/views/portfolio/projects/ProjectUploadVexModal.vue b/src/views/portfolio/projects/ProjectUploadVexModal.vue index 9aa224ddd..8066d9e26 100644 --- a/src/views/portfolio/projects/ProjectUploadVexModal.vue +++ b/src/views/portfolio/projects/ProjectUploadVexModal.vue @@ -1,27 +1,47 @@ diff --git a/src/views/portfolio/projects/SelectProjectModal.vue b/src/views/portfolio/projects/SelectProjectModal.vue index 88178a8da..5aa8ae143 100644 --- a/src/views/portfolio/projects/SelectProjectModal.vue +++ b/src/views/portfolio/projects/SelectProjectModal.vue @@ -1,111 +1,125 @@ diff --git a/src/views/portfolio/projects/Service.vue b/src/views/portfolio/projects/Service.vue index 2231b0627..fe536a187 100644 --- a/src/views/portfolio/projects/Service.vue +++ b/src/views/portfolio/projects/Service.vue @@ -4,100 +4,137 @@ - +
{{ serviceLabel }}
- {{ currentCritical }} - {{ currentHigh }} - {{ currentMedium }} - {{ currentLow }} - {{ currentUnassigned }} + {{ currentCritical }} + {{ currentHigh }} + {{ currentMedium }} + {{ currentLow }} + {{ currentUnassigned }}
- - - - + + + + - + @@ -193,6 +238,6 @@ export default { padding: 0; } .badge { - margin-right: .4rem; + margin-right: 0.4rem; } diff --git a/src/views/portfolio/projects/ServiceDashboard.vue b/src/views/portfolio/projects/ServiceDashboard.vue index a71065fef..892df1e82 100644 --- a/src/views/portfolio/projects/ServiceDashboard.vue +++ b/src/views/portfolio/projects/ServiceDashboard.vue @@ -1,31 +1,47 @@ diff --git a/src/views/portfolio/projects/ServiceDetailsModal.vue b/src/views/portfolio/projects/ServiceDetailsModal.vue index 52ac30de4..48c6b538f 100644 --- a/src/views/portfolio/projects/ServiceDetailsModal.vue +++ b/src/views/portfolio/projects/ServiceDetailsModal.vue @@ -1,147 +1,234 @@ diff --git a/src/views/portfolio/tags/SelectTagModal.vue b/src/views/portfolio/tags/SelectTagModal.vue index 24409646d..586098d37 100644 --- a/src/views/portfolio/tags/SelectTagModal.vue +++ b/src/views/portfolio/tags/SelectTagModal.vue @@ -1,91 +1,105 @@ diff --git a/src/views/portfolio/vulnerabilities/AddAffectedComponentModal.vue b/src/views/portfolio/vulnerabilities/AddAffectedComponentModal.vue index 23b9823f7..e053f4900 100644 --- a/src/views/portfolio/vulnerabilities/AddAffectedComponentModal.vue +++ b/src/views/portfolio/vulnerabilities/AddAffectedComponentModal.vue @@ -1,57 +1,105 @@ diff --git a/src/views/portfolio/vulnerabilities/AffectedProjects.vue b/src/views/portfolio/vulnerabilities/AffectedProjects.vue index bc003f738..09b248226 100644 --- a/src/views/portfolio/vulnerabilities/AffectedProjects.vue +++ b/src/views/portfolio/vulnerabilities/AffectedProjects.vue @@ -1,7 +1,16 @@ diff --git a/src/views/portfolio/vulnerabilities/SelectCweModal.vue b/src/views/portfolio/vulnerabilities/SelectCweModal.vue index 2029df51d..e2cbfcaa2 100644 --- a/src/views/portfolio/vulnerabilities/SelectCweModal.vue +++ b/src/views/portfolio/vulnerabilities/SelectCweModal.vue @@ -1,22 +1,35 @@ diff --git a/src/views/portfolio/vulnerabilities/Vulnerability.vue b/src/views/portfolio/vulnerabilities/Vulnerability.vue index 2fa914b0b..c660415fc 100644 --- a/src/views/portfolio/vulnerabilities/Vulnerability.vue +++ b/src/views/portfolio/vulnerabilities/Vulnerability.vue @@ -13,14 +13,23 @@ {{ vulnerability.title }} - + -
-
- +
+
+
-
{{ severityLabel }}
+
+ {{ severityLabel }} +
@@ -28,69 +37,148 @@
- Published: - {{prettyTimestamp}} - + Published: + + {{ prettyTimestamp }} + Aliases: - {{ alias.vulnId }} + {{ alias.vulnId }}
- - - + + +
- +
-
{{ $t('message.cvss_base_score') }}
- {{cvssBaseScore}} - +
+ {{ $t('message.cvss_base_score') }} +
+ {{ cvssBaseScore }} +
-
{{ $t('message.cvss_impact_subscore') }}
- {{cvssImpactScore}} - +
+ {{ $t('message.cvss_impact_subscore') }} +
+ {{ cvssImpactScore }} +
-
{{ $t('message.cvss_exploitability_subscore') }}
- {{cvssExploitScore}} - +
+ {{ $t('message.cvss_exploitability_subscore') }} +
+ {{ cvssExploitScore }} +
-
{{ $t('message.owasp_rr_likelihood_score') }}
- {{owaspRRLikelihoodScore}} - +
+ {{ $t('message.owasp_rr_likelihood_score') }} +
+ {{ owaspRRLikelihoodScore }} +
-
{{ $t('message.owasp_rr_technical_impact_score') }}
- {{owaspRRTechnicalImpactScore}} - +
+ {{ $t('message.owasp_rr_technical_impact_score') }} +
+ {{ owaspRRTechnicalImpactScore }} +
-
{{ $t('message.owasp_rr_business_impact_score') }}
- {{owaspRRBusinessImpactScore}} - +
+ {{ $t('message.owasp_rr_business_impact_score') }} +
+ {{ owaspRRBusinessImpactScore }} +
@@ -136,222 +224,290 @@
-
- - - + + +
- +
diff --git a/src/views/portfolio/vulnerabilities/VulnerabilityCreateVulnerabilityModal.vue b/src/views/portfolio/vulnerabilities/VulnerabilityCreateVulnerabilityModal.vue index 6ec04de25..fd6411350 100644 --- a/src/views/portfolio/vulnerabilities/VulnerabilityCreateVulnerabilityModal.vue +++ b/src/views/portfolio/vulnerabilities/VulnerabilityCreateVulnerabilityModal.vue @@ -1,471 +1,922 @@