diff --git a/monkey/monkey_island/cc/models/zero_trust/scoutsuite_finding.py b/monkey/monkey_island/cc/models/zero_trust/scoutsuite_finding.py deleted file mode 100644 index 174a68db7..000000000 --- a/monkey/monkey_island/cc/models/zero_trust/scoutsuite_finding.py +++ /dev/null @@ -1,20 +0,0 @@ -from __future__ import annotations - -from mongoengine import LazyReferenceField - -from monkey_island.cc.models.zero_trust.finding import Finding -from monkey_island.cc.models.zero_trust.scoutsuite_finding_details import ScoutSuiteFindingDetails - - -class ScoutSuiteFinding(Finding): - # We put additional info into a lazy reference field, because this info should be only - # pulled when explicitly needed due to performance - details = LazyReferenceField(ScoutSuiteFindingDetails, required=True) - - @staticmethod - def save_finding( - test: str, status: str, detail_ref: ScoutSuiteFindingDetails - ) -> ScoutSuiteFinding: - finding = ScoutSuiteFinding(test=test, status=status, details=detail_ref) - finding.save() - return finding diff --git a/monkey/monkey_island/cc/models/zero_trust/scoutsuite_finding_details.py b/monkey/monkey_island/cc/models/zero_trust/scoutsuite_finding_details.py deleted file mode 100644 index 9f2b24d9d..000000000 --- a/monkey/monkey_island/cc/models/zero_trust/scoutsuite_finding_details.py +++ /dev/null @@ -1,13 +0,0 @@ -from mongoengine import Document, EmbeddedDocumentListField - -from monkey_island.cc.models.zero_trust.scoutsuite_rule import ScoutSuiteRule - - -class ScoutSuiteFindingDetails(Document): - # SCHEMA - scoutsuite_rules = EmbeddedDocumentListField(document_type=ScoutSuiteRule, required=False) - - def add_rule(self, rule: ScoutSuiteRule) -> None: - if rule not in self.scoutsuite_rules: - self.scoutsuite_rules.append(rule) - self.save() diff --git a/monkey/monkey_island/cc/models/zero_trust/scoutsuite_rule.py b/monkey/monkey_island/cc/models/zero_trust/scoutsuite_rule.py deleted file mode 100644 index fcf09df9c..000000000 --- a/monkey/monkey_island/cc/models/zero_trust/scoutsuite_rule.py +++ /dev/null @@ -1,25 +0,0 @@ -from mongoengine import DynamicField, EmbeddedDocument, IntField, ListField, StringField - -from monkey_island.cc.services.zero_trust.scoutsuite.consts import rule_consts - - -class ScoutSuiteRule(EmbeddedDocument): - """ - This model represents ScoutSuite security rule check results: - how many resources break the security rule - security rule description and remediation and etc. - """ - - # SCHEMA - description = StringField(required=True) - path = StringField(required=True) - level = StringField(required=True, options=rule_consts.RULE_LEVELS) - items = ListField() - dashboard_name = StringField(required=True) - checked_items = IntField(min_value=0) - flagged_items = IntField(min_value=0) - service = StringField(required=True) - rationale = StringField(required=True) - remediation = StringField(required=False) - compliance = DynamicField(required=False) - references = ListField(required=False) diff --git a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/consts/rule_consts.py b/monkey/monkey_island/cc/services/zero_trust/scoutsuite/consts/rule_consts.py deleted file mode 100644 index 08d6600a9..000000000 --- a/monkey/monkey_island/cc/services/zero_trust/scoutsuite/consts/rule_consts.py +++ /dev/null @@ -1,4 +0,0 @@ -RULE_LEVEL_DANGER = "danger" -RULE_LEVEL_WARNING = "warning" - -RULE_LEVELS = (RULE_LEVEL_DANGER, RULE_LEVEL_WARNING) diff --git a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/finding_service.py b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/finding_service.py index cf65819df..8c70130c7 100644 --- a/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/finding_service.py +++ b/monkey/monkey_island/cc/services/zero_trust/zero_trust_report/finding_service.py @@ -7,7 +7,6 @@ from common.common_consts import zero_trust_consts from common.utils.exceptions import UnknownFindingError from monkey_island.cc.models.zero_trust.finding import Finding from monkey_island.cc.models.zero_trust.monkey_finding import MonkeyFinding -from monkey_island.cc.models.zero_trust.scoutsuite_finding import ScoutSuiteFinding from monkey_island.cc.services.zero_trust.monkey_findings.monkey_zt_details_service import ( MonkeyZTDetailsService, ) @@ -55,7 +54,5 @@ class FindingService: def _get_finding_details(finding: Finding) -> Union[dict, SON]: if type(finding) == MonkeyFinding: return MonkeyZTDetailsService.fetch_details_for_display(finding.details.id) - elif type(finding) == ScoutSuiteFinding: - return finding.details.fetch().to_mongo() else: raise UnknownFindingError(f"Unknown finding type {str(type(finding))}")