diff --git a/dso/model.py b/dso/model.py index 2fae5ec6a..0ea2a9e08 100644 --- a/dso/model.py +++ b/dso/model.py @@ -36,7 +36,6 @@ class Datasource: CHECKMARX = 'checkmarx' CLAMAV = 'clamav' CC_UTILS = 'cc-utils' - CRYPTO = 'crypto' DELIVERY_DASHBOARD = 'delivery-dashboard' DIKI = 'diki' @@ -63,11 +62,6 @@ def datasource_to_datatypes(datasource: str) -> tuple[str]: Datasource.CC_UTILS: ( Datatype.OS_IDS, ), - Datasource.CRYPTO: ( - Datatype.ARTEFACT_SCAN_INFO, - Datatype.CRYPTO_ASSET, - Datatype.FIPS_FINDING, - ), Datasource.DELIVERY_DASHBOARD: ( Datatype.RESCORING, ), @@ -220,8 +214,6 @@ class Datatype: RESCORING = 'rescorings' COMPLIANCE_SNAPSHOTS = 'compliance/snapshots' ARTEFACT_SCAN_INFO = 'meta/artefact_scan_info' - CRYPTO_ASSET = 'crypto_asset' - FIPS_FINDING = 'finding/fips' @staticmethod def datatype_to_datasource(datatype: str) -> str: @@ -232,8 +224,6 @@ def datatype_to_datasource(datatype: str) -> str: Datatype.CODECHECKS_AGGREGATED: Datasource.CHECKMARX, Datatype.MALWARE_FINDING: Datasource.CLAMAV, Datatype.DIKI_FINDING: Datasource.DIKI, - Datatype.CRYPTO_ASSET: Datasource.CRYPTO, - Datatype.FIPS_FINDING: Datasource.CRYPTO, }[datatype] @@ -399,103 +389,6 @@ def key(self) -> str: return _as_key(self.provider_id, f'{self.ruleset_id}:{self.ruleset_version}', self.rule_id) -class AssetTypes(enum.StrEnum): - ALGORITHM = 'algorithm' - CERTIFICATE = 'certificate' - LIBRARY = 'library' - PROTOCOL = 'protocol' - RELATED_CRYPTO_MATERIAL = 'related-crypto-material' - - -@dataclasses.dataclass -class AlgorithmProperties: - name: str - primitive: str | None = None - parameter_set_identifier: str | None = None - curve: str | None = None - padding: str | None = None - - @property - def key(self) -> str: - return _as_key( - self.name, - self.primitive, - self.parameter_set_identifier, - self.curve, - self.padding, - ) - - -@dataclasses.dataclass -class CertificateProperties: - signature_algorithm_ref: str | None = None - subject_public_key_ref: str | None = None - - @property - def key(self) -> str: - return _as_key(self.signature_algorithm_ref, self.subject_public_key_ref) - - -@dataclasses.dataclass -class LibraryProperties: - name: str - version: str | None = None - - @property - def key(self) -> str: - return _as_key(self.name, self.version) - - -@dataclasses.dataclass -class ProtocolProperties: - type: str | None = None - version: str | None = None - - @property - def key(self) -> str: - return _as_key(self.type, self.version) - - -@dataclasses.dataclass -class RelatedCryptoMaterialProperties: - type: str | None = None - algorithm_ref: str | None = None - size: int | None = None - - @property - def key(self) -> str: - return _as_key(self.type, self.algorithm_ref, str(self.size)) - - -@dataclasses.dataclass -class CryptoAsset: - names: list[str] - locations: list[str] - asset_type: AssetTypes - properties: ( - AlgorithmProperties - | CertificateProperties - | LibraryProperties - | RelatedCryptoMaterialProperties - | ProtocolProperties - ) - count: int = 1 - - @property - def key(self) -> str: - return _as_key(self.asset_type, self.properties.key) - - -@dataclasses.dataclass(frozen=True) -class FipsFinding(Finding): - asset: CryptoAsset - summary: str | None = None - - @property - def key(self) -> str: - return self.asset.key - - @dataclasses.dataclass(frozen=True) class User: username: str @@ -532,7 +425,6 @@ class CustomRescoring: RescoringVulnerabilityFinding | RescoringLicenseFinding | MalwareFindingDetails - | CryptoAsset ) referenced_type: str severity: str @@ -631,8 +523,6 @@ class ArtefactMetadata: | OsID | CustomRescoring | ComplianceSnapshot - | CryptoAsset - | FipsFinding | dict # fallback, there should be a type ) discovery_date: datetime.date | None = None # required for finding specific SLA tracking @@ -651,9 +541,7 @@ def from_dict(raw: dict): ArtefactKind, ComplianceSnapshotStatuses, MetaRescoringRules, - AssetTypes, ], - strict=True, ), )