From 16516139b822658e7c4d95772275b2b8a006d840 Mon Sep 17 00:00:00 2001 From: "Jonas Brand (8R0WNI3)" Date: Thu, 12 Dec 2024 08:51:54 +0100 Subject: [PATCH] Revert crypto PoC --- .../dependencies/ComplianceCells.js | 9 --- .../dependencies/ComplianceChips.js | 57 ------------------- src/components/dependencies/Component.js | 2 - src/consts.js | 10 ---- src/ocm/model.js | 34 +---------- 5 files changed, 1 insertion(+), 111 deletions(-) diff --git a/src/components/dependencies/ComplianceCells.js b/src/components/dependencies/ComplianceCells.js index abfe260..ab6a51c 100644 --- a/src/components/dependencies/ComplianceCells.js +++ b/src/components/dependencies/ComplianceCells.js @@ -30,7 +30,6 @@ import UnfoldMoreIcon from '@mui/icons-material/UnfoldMore' import { evaluateResourceBranch, GolangChip, - CryptoAssetsChip, IssueChip, } from './ComplianceChips' import { @@ -339,11 +338,9 @@ const ComplianceCell = ({ const structureInfos = complianceFiltered?.filter((d) => d.meta.type === artefactMetadataTypes.STRUCTURE_INFO) const osData = complianceFiltered?.find((d) => d.meta.type === artefactMetadataTypes.OS_IDS) const codecheckData = complianceFiltered?.find((d) => d.meta.type === artefactMetadataTypes.CODECHECKS_AGGREGATED) - const cryptoAssets = complianceFiltered?.filter((d) => d.meta.type === artefactMetadataTypes.CRYPTO_ASSET) const lastBdbaScan = findLastScan(complianceFiltered, datasources.BDBA) const lastMalwareScan = findLastScan(complianceFiltered, datasources.CLAMAV) - const lastCryptoScan = findLastScan(complianceFiltered, datasources.CRYPTO) return @@ -373,12 +370,6 @@ const ComplianceCell = ({ timestamp={lastScanTimestampStr(lastBdbaScan)} /> } - { - artefact.kind === ARTEFACT_KIND.RESOURCE && - } { artefact.kind === ARTEFACT_KIND.RESOURCE && { - if (!cryptoAssets?.length > 0) return null - - const cryptoLibraries = cryptoAssets.filter((cryptoAsset) => { - return cryptoAsset.data.asset_type === CRYPTO_ASSET_TYPES.LIBRARY - }).map((cryptoAsset) => cryptoAsset.data.properties).sort((left, right) => { - return left.name === right.name - ? left.version.localeCompare(right.version) - : left.name.localeCompare(right.name) - }) - - return - - { - cryptoLibraries.map((cryptoLibrary) => `${cryptoLibrary.name}:${cryptoLibrary.version}\n`) - } - - - - { - timestamp - } - - - } - > - - - - -} -CryptoAssetsChip.displayName = 'CryptoAssetsChip' -CryptoAssetsChip.propTypes = { - cryptoAssets: PropTypes.arrayOf(PropTypes.object), - timestamp: PropTypes.string, -} - - const IssueChip = ({ ocmNodes, component, @@ -440,7 +384,6 @@ IssueChip.propTypes = { export { ComponentChip, GolangChip, - CryptoAssetsChip, IssueChip, evaluateResourceBranch, } diff --git a/src/components/dependencies/Component.js b/src/components/dependencies/Component.js index d2188c9..31b804d 100644 --- a/src/components/dependencies/Component.js +++ b/src/components/dependencies/Component.js @@ -678,14 +678,12 @@ const Artefacts = ({ artefactMetadataTypes.CODECHECKS_AGGREGATED, artefactMetadataTypes.OS_IDS, artefactMetadataTypes.STRUCTURE_INFO, - artefactMetadataTypes.CRYPTO_ASSET, ] }, [ artefactMetadataTypes.ARTEFACT_SCAN_INFO, artefactMetadataTypes.CODECHECKS_AGGREGATED, artefactMetadataTypes.OS_IDS, artefactMetadataTypes.STRUCTURE_INFO, - artefactMetadataTypes.CRYPTO_ASSET, ]) const params = React.useMemo(() => { diff --git a/src/consts.js b/src/consts.js index 5a8ae37..7491f6c 100644 --- a/src/consts.js +++ b/src/consts.js @@ -234,16 +234,6 @@ export const PACKAGES = { Object.freeze(PACKAGES) -export const CRYPTO_ASSET_TYPES = { - ALGORITHM: 'algorithm', - CERTIFICATE: 'certificate', - LIBRARY: 'library', - PROTOCOL: 'protocol', - RELATED_CRYPTO_MATERIAL: 'related-crypto-material', -} -Object.freeze(CRYPTO_ASSET_TYPES) - - export const USER_IDENTITIES = { EMAIL_ADDRESS: 'emailAddress', GITHUB_USER: 'githubUser', diff --git a/src/ocm/model.js b/src/ocm/model.js index 15fe3d1..f4bb5a5 100644 --- a/src/ocm/model.js +++ b/src/ocm/model.js @@ -33,7 +33,7 @@ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined' import ReportProblemIcon from '@mui/icons-material/ReportProblem' import ReportProblemOutlinedIcon from '@mui/icons-material/ReportProblemOutlined' -import { CRYPTO_ASSET_TYPES, SEVERITIES } from '../consts' +import { SEVERITIES } from '../consts' import { artefactMetadataSeverityComparator, artefactMetadatumSeverity, @@ -74,7 +74,6 @@ const artefactMetadataTypes = { FINDING_MALWARE: 'finding/malware', OS_IDS: 'os_ids', CODECHECKS_AGGREGATED: 'codechecks/aggregated', - CRYPTO_ASSET: 'crypto_asset', RESCORINGS: 'rescorings', } Object.freeze(artefactMetadataTypes) @@ -84,7 +83,6 @@ const datasources = { BDBA: 'bdba', CLAMAV: 'clamav', CC_UTILS: 'cc-utils', - CRYPTO: 'crypto', } Object.freeze(datasources) @@ -122,30 +120,6 @@ const dataKey = ({type, data}) => { if (type === artefactMetadataTypes.FINDING_MALWARE) return asKey({ props: [data.finding.content_digest, data.finding.filename, data.finding.malware], }) - - if (type === CRYPTO_ASSET_TYPES.ALGORITHM) return asKey({ - props: [data.primitive, data.parameter_set_identifier, data.curve, data.padding], - }) - - if (type === CRYPTO_ASSET_TYPES.CERTIFICATE) return asKey({ - props: [data.subject_algorithm_ref, data.subject_public_key_ref], - }) - - if (type === CRYPTO_ASSET_TYPES.LIBRARY) return asKey({ - props: [data.name, data.version], - }) - - if (type === CRYPTO_ASSET_TYPES.PROTOCOL) return asKey({ - props: [data.type, data.version], - }) - - if (type === CRYPTO_ASSET_TYPES.RELATED_CRYPTO_MATERIAL) return asKey({ - props: [data.type, data.algorithm_ref, data.size?.toString()], - }) - - if (type === artefactMetadataTypes.CRYPTO_ASSET) return asKey({ - props: [data.asset_type, dataKey({type: data.asset_type, data: data.properties})], - }) } @@ -355,12 +329,6 @@ const knownMetadataTypes = [ SpecificTypeHandler: MultilineTextViewer, Icon: CoronavirusIcon }, - { - name: 'crypto_asset', - friendlyName: 'Crypto Asset', - SpecificTypeHandler: MultilineTextViewer, - Icon: ArticleIcon, - }, ]