From cfd1ca33fe3101fa65d72f3a7537a6ad5d9fdde4 Mon Sep 17 00:00:00 2001 From: san-zrl Date: Mon, 2 Sep 2024 15:04:00 +0200 Subject: [PATCH] feat: render CBOM 1.6 data Signed-off-by: san-zrl update: Ikev2Types rendering --- package-lock.json | 2 +- package.json | 2 +- src/containers/DefaultContainer.vue | 6 + src/forms/BInputGroupFormInputNumber.vue | 132 ++++ src/forms/BInputGroupFormSelectMultiple.vue | 116 +++ src/i18n/locales/en.json | 101 +++ src/router/index.js | 22 + src/shared/api.json | 1 + src/shared/common.js | 2 + src/views/dashboard/CryptoAssetWidgetRow.vue | 117 +++ src/views/dashboard/WidgetCryptoAssets.vue | 87 +++ .../dashboard/WidgetMostUsedAlgorithm.vue | 87 +++ src/views/dashboard/WidgetNumberOfKeys.vue | 87 +++ .../portfolio/cryptoassets/CryptoAssets.vue | 271 +++++++ .../projects/ComponentDetailsModal.vue | 714 ++++++++++++++++++ src/views/portfolio/projects/CryptoAsset.vue | 80 ++ .../projects/ProjectAddComponentModal.vue | 4 +- .../projects/ProjectCreateProjectModal.vue | 4 +- .../projects/ProjectCryptoAssets.vue | 229 ++++++ 19 files changed, 2058 insertions(+), 6 deletions(-) create mode 100644 src/forms/BInputGroupFormInputNumber.vue create mode 100644 src/forms/BInputGroupFormSelectMultiple.vue create mode 100644 src/views/dashboard/CryptoAssetWidgetRow.vue create mode 100644 src/views/dashboard/WidgetCryptoAssets.vue create mode 100644 src/views/dashboard/WidgetMostUsedAlgorithm.vue create mode 100644 src/views/dashboard/WidgetNumberOfKeys.vue create mode 100644 src/views/portfolio/cryptoassets/CryptoAssets.vue create mode 100644 src/views/portfolio/projects/CryptoAsset.vue create mode 100644 src/views/portfolio/projects/ProjectCryptoAssets.vue diff --git a/package-lock.json b/package-lock.json index 8c210514..39b9fe88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,7 +63,7 @@ "@vue/cli-service": "3.12.1", "@vue/runtime-dom": "3.4.21", "copy-webpack-plugin": "5.1.2", - "cross-env": "7.0.3", + "cross-env": "^7.0.3", "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.1.3", diff --git a/package.json b/package.json index 68af4a08..540a6af2 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "@vue/cli-service": "3.12.1", "@vue/runtime-dom": "3.4.21", "copy-webpack-plugin": "5.1.2", - "cross-env": "7.0.3", + "cross-env": "^7.0.3", "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-plugin-prettier": "5.1.3", diff --git a/src/containers/DefaultContainer.vue b/src/containers/DefaultContainer.vue index 9190536d..5a8bb170 100644 --- a/src/containers/DefaultContainer.vue +++ b/src/containers/DefaultContainer.vue @@ -90,6 +90,12 @@ export default { icon: 'fa fa-cubes', permission: permissions.VIEW_PORTFOLIO, }, + { + name: this.$t('message.crypto_assets'), + url: '/cryptoassets', + icon: 'fa fa-lock', + permission: permissions.VIEW_PORTFOLIO, + }, { name: this.$t('message.vulnerabilities'), url: '/vulnerabilities', diff --git a/src/forms/BInputGroupFormInputNumber.vue b/src/forms/BInputGroupFormInputNumber.vue new file mode 100644 index 00000000..2b7d8fe6 --- /dev/null +++ b/src/forms/BInputGroupFormInputNumber.vue @@ -0,0 +1,132 @@ + + + diff --git a/src/forms/BInputGroupFormSelectMultiple.vue b/src/forms/BInputGroupFormSelectMultiple.vue new file mode 100644 index 00000000..da5f75eb --- /dev/null +++ b/src/forms/BInputGroupFormSelectMultiple.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 94327b2d..07728cd0 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -392,6 +392,8 @@ "component_classification_desc": "Classifies whether a component is considered internal or external to an organization", "component_classifier_desc": "Specifies the type of component: Assets (applications, operating systems, and hardware) and non-assets (libraries, frameworks, and files)", "component_container": "Container", + "component_cryptographic_asset": "Cryptographic Asset", + "component_cryptographic_properties": "Cryptographic Properties", "component_cpe_desc": "The CPE v2.2 or v2.3 URI as provided by MITRE or NIST. All assets (applications, operating systems, and hardware) should have a CPE specified", "component_created": "Component created", "component_deleted": "Component deleted", @@ -442,6 +444,104 @@ "create_vulnerability": "Create Vulnerability", "created": "Created", "credits": "Credits", + "crypto_assets": "Crypto Assets", + "crypto_asset": "Crypto Asset", + "crypto_assetType": "Asset Type", + "crypto_assetType_desc": "The type of the crypto asset as provided by the supplier", + "crypto_algo_primitive": "Primitive", + "crypto_algo_primitive_desc": "The primitive of the crytographic algorithm", + "crypto_algo_curve": "Curve", + "crypto_algo_curve_desc": "The underlying Elliptic Curve of the crytographic algorithm", + "crypto_algo_parameterSetId": "Parameter Set Identifier", + "crypto_algo_parameterSetId_desc": "Parameter Set Identifier", + "crypto_algo_execEnv": "Execution Environment", + "crypto_algo_execEnv_desc": "The Execution Environment of the crytographic algorithm", + "crypto_algo_implPlfm": "Implementation Platform", + "crypto_algo_implPlfm_desc": "The Implementation Platform of the crytographic algorithm", + "crypto_algo_certLvl": "Certification Level", + "crypto_algo_certLvl_desc": "The Certification Level of the crytographic algorithm", + "crypto_algo_mode": "Mode", + "crypto_algo_mode_desc": "The mode of operation of the crytographic algorithm", + "crypto_algo_padding": "Padding", + "crypto_algo_padding_desc": "The padding scheme of the crytographic algorithm", + "crypto_algo_cryptoFunctions": "Cryptographic Functions", + "crypto_algo_cryptoFunctions_desc": "The crypto functions implemented by the crytographic algorithm", + "crypto_algo_classicalSL": "Classical Security Level", + "crypto_algo_classicalSL_desc": "The classicial security level of the crytographic algorithm", + "crypto_algo_nistQSL": "NIST Quantum Security Level", + "crypto_algo_nistQSL_desc": "The NIST Quantum Security Level of the crytographic algorithm", + "crypto_cert_subject": "Subject Name", + "crypto_cert_subject_desc": "The subject name for the certificate", + "crypto_cert_issuer": "Issuer Name", + "crypto_cert_issuer_desc": "The issuer name for the certificate", + "crypto_cert_notValidBefore": "Not Valid Before", + "crypto_cert_notValidBefore_desc": "ISO8601 date and time from which the certificate is valid", + "crypto_cert_notValidAfter": "Not Valid After", + "crypto_cert_notValidAfter_desc": "ISO8601 date and time after which the certificate is not valid", + "crypto_cert_signAlgoRef": "Signature Algorithm Reference", + "crypto_cert_signAlgoRef_desc": "The bom-ref to signature algorithm used by the certificate", + "crypto_cert_subjPubKeyRef": "Subject Public Key Reference", + "crypto_cert_subjPubKeyRef_desc": "The bom-ref to the public key of the subject", + "crypto_cert_format": "Certificate Format", + "crypto_cert_format_desc": "The format of the certificate", + "crypto_cert_ext": "Certificate Format", + "crypto_cert_ext_desc": "The file extension of the certificate", + "crypto_rcm_type": "Type", + "crypto_rcm_type_desc": "The type for the related cryptographic material", + "crypto_rcm_id": "Id", + "crypto_rcm_id_desc": "The optional unique identifier for the related cryptographic material.", + "crypto_rcm_state": "State", + "crypto_rcm_state_desc": "The key state as defined by NIST SP 800-57", + "crypto_rcm_algoRef": "Algorithm Reference", + "crypto_rcm_algoRef_desc": "The bom-ref to the algorithm used to generate the related cryptographic material", + "crypto_rcm_cdate": "Creation Date", + "crypto_rcm_cdate_desc": "ISO8601 date and time when related cryptographic materia was created", + "crypto_rcm_adate": "Activation Date", + "crypto_rcm_adate_desc": "ISO8601 date and time when related cryptographic materia was activated", + "crypto_rcm_udate": "Update Date", + "crypto_rcm_udate_desc": "ISO8601 date and time when related cryptographic materia was updated", + "crypto_rcm_edate": "Expiration Date", + "crypto_rcm_edate_desc": "ISO8601 date and time when related cryptographic material expires", + "crypto_rcm_value": "Value", + "crypto_rcm_value_desc": "The associated value of the cryptographic material", + "crypto_rcm_size": "Size", + "crypto_rcm_size_desc": "The size of the cryptographic asset in bits", + "crypto_rcm_format": "Format", + "crypto_rcm_format_desc": "The format of the related cryptographic material", + "crypto_rcm_secByMech": "Secured by Mechansim", + "crypto_rcm_secByMech_desc": "The mechanism the cryptographic asset is secured by", + "crypto_rcm_secByAlgoRef": "Secured by Algorith Reference", + "crypto_rcm_secByAlgoRef_desc": "The bom-ref to the algorithm the cryptographic asset is secured by", + "crypto_prot_type": "Protocol Type", + "crypto_prot_type_desc": "The protocol type", + "crypto_prot_version": "Protocol Version", + "crypto_prot_version_desc": "The protocol version", + "crypto_prot_cipherSuites": "Cipher Suites", + "crypto_prot_cipherSuites_desc": "A comma-separated list of cipher suites", + "crypto_prot_ikev2Encr": "IKEv2 Transform Type 1: Encryption Algorithms", + "crypto_prot_ikev2Encr_desc": "Internet Key Exchange v2 Transform Type 1: encryption algorithms", + "crypto_prot_ikev2Prf": "IKEv2 Transform Type 2: Pseudorandom Functions", + "crypto_prot_ikev2Prf_desc": "Internet Key Exchange v2 Transform Type 2: integrity algorithms", + "crypto_prot_ikev2Integ": "IKEv2 Transform Type 3: Encryption Algorithms", + "crypto_prot_ikev2Integ_desc": "Internet Key Exchange v2 Transform Type 3: integrity algorithms", + "crypto_prot_ikev2Ke": "IKEv2 Transform Type 4: Key Exchange Method", + "crypto_prot_ikev2Ke_desc": "Internet Key Exchange v2 Transform Type 4: Key Exchange Method (KE) per RFC9370, formerly called Diffie-Hellman Group (D-H)", + "crypto_prot_ikev2Esn": "IKEv2 Transform Type: Extended Sequence Number", + "crypto_prot_ikev2Esn_desc": "Internet Key Exchange v2 extended sequence number ", + "crypto_prot_ikev2Auth": "IKEv2 Transform Type: Authentication Method", + "crypto_prot_ikev2Auth_desc": "Internet Key Exchange v2 authentication method", + "crypto_prot_cryptoRefs": "Cryptographic Reference Array", + "crypto_prot_cryptoRefs_desc": "A comma-separated list of bom-refs to protocol-related cryptographic assets", + "crypto_oid": "OID", + "crypto_oid_desc": "The Object Identifier of the cryptographic asset", + "add_cryptoAsset": "Add Crypto Asset", + "remove_cryptoAsset": "Remove Crypto Asset", + "upload_cbom": "Upload CBOM", + "download_cbom": "Download CBOM", + "cryptoAsset_deleted": "Crypto Asset deleted", + "numberOfCryptoAssets": "Number of cryptographic assets", + "mostUsedAlgorithm": "Most used cryptographic algorithm", + "numberOfKeys": "Number of cryptographic keys", "custom_license": "Custom License", "custom_license_deleted": "Custom License Deleted", "cvss": "CVSS", @@ -775,6 +875,7 @@ "required_component_identifier": "A component identifier is required", "required_component_name": "The component name is required", "required_component_version": "The component version is required", + "required_crypto_assetType": "The type of the crypto asset is required", "required_license_id": "The license ID is required", "required_license_name": "The license name is required", "required_project_name": "The project name is required", diff --git a/src/router/index.js b/src/router/index.js index 1153d028..58d96239 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,6 +4,8 @@ import i18n from '../i18n'; import EventBus from '../shared/eventbus'; import { getToken, hasPermission } from '../shared/permissions'; import { getContextPath } from '../shared/utils'; +import CryptoAsset from "../views/portfolio/projects/CryptoAsset"; +import CryptoAssets from "../views/portfolio/cryptoassets/CryptoAssets"; // Containers const DefaultContainer = () => import('@/containers/DefaultContainer'); @@ -242,6 +244,26 @@ function configRoutes() { permissions: ['VIEW_PORTFOLIO'], }, }, + { + path: 'cryptoassets', + name: 'CryptoAssets', + component: CryptoAssets, + meta: { + title: i18n.t('message.component_search'), + i18n: 'message.crypto_assets', + sectionPath: '/cryptoassets', + }, + }, + { + path: '/cryptoassets/:uuid', + name: 'CryptoAsset', + props: (route) => ( { uuid: route.params.uuid } ), + component: CryptoAsset, + meta: { + i18n: 'message.projects', + sectionPath: '/projects', + }, + }, { path: 'vulnerabilities', name: 'Vulnerabilities', diff --git a/src/shared/api.json b/src/shared/api.json index a38230cb..db304da0 100644 --- a/src/shared/api.json +++ b/src/shared/api.json @@ -19,6 +19,7 @@ "URL_CALCULATOR_OWASP": "api/v1/calculator/owasp", "URL_COMPONENT": "api/v1/component", "URL_CONFIG_PROPERTY": "api/v1/configProperty", + "URL_CRYPTO_ASSET": "api/v1/crypto", "URL_CWE": "api/v1/cwe", "URL_DEPENDENCY_GRAPH": "api/v1/dependencyGraph", "URL_FINDING": "api/v1/finding", diff --git a/src/shared/common.js b/src/shared/common.js index 86f1cc07..dc389645 100644 --- a/src/shared/common.js +++ b/src/shared/common.js @@ -418,6 +418,7 @@ $common.componentClassifierLabelFormatter = (i18n) => { case 'DEVICE': case 'FIRMWARE': case 'FILE': + case 'CRYPTOGRAPHIC_ASSET': return i18n.$t(`message.component_${value.toLowerCase()}`); default: return null; @@ -444,6 +445,7 @@ $common.componentClassifierLabelProjectUrlFormatter = (i18n) => { case 'DEVICE': case 'FIRMWARE': case 'FILE': + case 'CRYPTOGRAPHIC_ASSET': return `${i18n.$t( `message.component_${value.toLowerCase()}`, )}`; diff --git a/src/views/dashboard/CryptoAssetWidgetRow.vue b/src/views/dashboard/CryptoAssetWidgetRow.vue new file mode 100644 index 00000000..d4a16bab --- /dev/null +++ b/src/views/dashboard/CryptoAssetWidgetRow.vue @@ -0,0 +1,117 @@ + + + diff --git a/src/views/dashboard/WidgetCryptoAssets.vue b/src/views/dashboard/WidgetCryptoAssets.vue new file mode 100644 index 00000000..49b1fb79 --- /dev/null +++ b/src/views/dashboard/WidgetCryptoAssets.vue @@ -0,0 +1,87 @@ + diff --git a/src/views/dashboard/WidgetMostUsedAlgorithm.vue b/src/views/dashboard/WidgetMostUsedAlgorithm.vue new file mode 100644 index 00000000..cd6cf821 --- /dev/null +++ b/src/views/dashboard/WidgetMostUsedAlgorithm.vue @@ -0,0 +1,87 @@ + diff --git a/src/views/dashboard/WidgetNumberOfKeys.vue b/src/views/dashboard/WidgetNumberOfKeys.vue new file mode 100644 index 00000000..b9687b49 --- /dev/null +++ b/src/views/dashboard/WidgetNumberOfKeys.vue @@ -0,0 +1,87 @@ + diff --git a/src/views/portfolio/cryptoassets/CryptoAssets.vue b/src/views/portfolio/cryptoassets/CryptoAssets.vue new file mode 100644 index 00000000..af242325 --- /dev/null +++ b/src/views/portfolio/cryptoassets/CryptoAssets.vue @@ -0,0 +1,271 @@ + + + + + diff --git a/src/views/portfolio/projects/ComponentDetailsModal.vue b/src/views/portfolio/projects/ComponentDetailsModal.vue index 74adc391..a3adc475 100644 --- a/src/views/portfolio/projects/ComponentDetailsModal.vue +++ b/src/views/portfolio/projects/ComponentDetailsModal.vue @@ -204,6 +204,548 @@ +
+ + + + + +
+ + + + + + + + + + + +
+
+ + + + + + + + +
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + +
+
+
+