Reverted relative paths in zero trust code back to absolute

This commit is contained in:
VakarisZ 2021-02-09 15:51:34 +02:00
parent 6f16ba431c
commit baadb241e8
21 changed files with 89 additions and 75 deletions

View File

@ -2,10 +2,10 @@ import json
from monkey_island.cc.database import mongo
from monkey_island.cc.models.zero_trust.scoutsuite_data_json import ScoutSuiteRawDataJson
from ...zero_trust.scoutsuite.consts.scoutsuite_findings_list import SCOUTSUITE_FINDINGS
from ...zero_trust.scoutsuite.data_parsing.rule_parser import RuleParser
from ...zero_trust.scoutsuite.scoutsuite_zt_finding_service import ScoutSuiteZTFindingService
from ...zero_trust.scoutsuite.scoutsuite_rule_service import ScoutSuiteRuleService
from monkey_island.cc.services.zero_trust.scoutsuite.consts.scoutsuite_findings_list import SCOUTSUITE_FINDINGS
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_parser import RuleParser
from monkey_island.cc.services.zero_trust.scoutsuite.scoutsuite_rule_service import ScoutSuiteRuleService
from monkey_island.cc.services.zero_trust.scoutsuite.scoutsuite_zt_finding_service import ScoutSuiteZTFindingService
def process_scoutsuite_telemetry(telemetry_json):

View File

@ -2,10 +2,11 @@ import logging
import typing
from common.common_consts.system_info_collectors_names import (AWS_COLLECTOR, ENVIRONMENT_COLLECTOR, HOSTNAME_COLLECTOR,
PROCESS_LIST_COLLECTOR, SCOUTSUITE_COLLECTOR)
from .aws import process_aws_telemetry
from .environment import process_environment_telemetry
from .hostname import process_hostname_telemetry
PROCESS_LIST_COLLECTOR)
from monkey_island.cc.services.telemetry.processing.system_info_collectors.aws import process_aws_telemetry
from monkey_island.cc.services.telemetry.processing.system_info_collectors.environment import \
process_environment_telemetry
from monkey_island.cc.services.telemetry.processing.system_info_collectors.hostname import process_hostname_telemetry
from monkey_island.cc.services.telemetry.zero_trust_checks.antivirus_existence import check_antivirus_existence
logger = logging.getLogger(__name__)

View File

@ -2,21 +2,21 @@ from abc import ABC, abstractmethod
from typing import List
from common.common_consts import zero_trust_consts
from .rule_names.cloudformation_rules import CloudformationRules
from .rule_names.cloudtrail_rules import CloudTrailRules
from .rule_names.cloudwatch_rules import CloudWatchRules
from .rule_names.config_rules import ConfigRules
from .rule_names.ec2_rules import EC2Rules
from .rule_names.elb_rules import ELBRules
from .rule_names.elbv2_rules import ELBv2Rules
from .rule_names.iam_rules import IAMRules
from .rule_names.rds_rules import RDSRules
from .rule_names.redshift_rules import RedshiftRules
from .rule_names.s3_rules import S3Rules
from .rule_names.ses_rules import SESRules
from .rule_names.sns_rules import SNSRules
from .rule_names.sqs_rules import SQSRules
from .rule_names.vpc_rules import VPCRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.cloudformation_rules import CloudformationRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.cloudtrail_rules import CloudTrailRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.cloudwatch_rules import CloudWatchRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.config_rules import ConfigRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.ec2_rules import EC2Rules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.elb_rules import ELBRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.elbv2_rules import ELBv2Rules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.iam_rules import IAMRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.rds_rules import RDSRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.redshift_rules import RedshiftRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.s3_rules import S3Rules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.ses_rules import SESRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.sns_rules import SNSRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.sqs_rules import SQSRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.vpc_rules import VPCRules
# Class which links ZT tests and rules to ScoutSuite finding

View File

@ -1,8 +1,5 @@
from .scoutsuite_finding_maps import (DataLossPrevention, Logging,
PermissiveFirewallRules,
RestrictivePolicies,
SecureAuthentication, ServiceSecurity,
UnencryptedData)
from monkey_island.cc.services.zero_trust.scoutsuite.consts.scoutsuite_finding_maps import RestrictivePolicies, \
SecureAuthentication, DataLossPrevention, UnencryptedData, PermissiveFirewallRules, ServiceSecurity, Logging
SCOUTSUITE_FINDINGS = [PermissiveFirewallRules, UnencryptedData, DataLossPrevention, SecureAuthentication,
RestrictivePolicies, Logging, ServiceSecurity]

View File

@ -2,7 +2,7 @@ from abc import ABC, abstractmethod
from enum import Enum
from typing import List
from ...consts.service_consts import FINDINGS, SERVICE_TYPES, SERVICES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import FINDINGS, SERVICES, SERVICE_TYPES
class AbstractRulePathCreator(ABC):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.cloudformation_rules import CloudformationRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.cloudformation_rules import CloudformationRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class CloudformationRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.cloudtrail_rules import CloudTrailRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.cloudtrail_rules import CloudTrailRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class CloudTrailRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.cloudwatch_rules import CloudWatchRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.cloudwatch_rules import CloudWatchRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class CloudWatchRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.config_rules import ConfigRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.config_rules import ConfigRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class ConfigRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.ec2_rules import EC2Rules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.ec2_rules import EC2Rules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class EC2RulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.elb_rules import ELBRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.elb_rules import ELBRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class ELBRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.elbv2_rules import ELBv2Rules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.elbv2_rules import ELBv2Rules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class ELBv2RulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.iam_rules import IAMRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.iam_rules import IAMRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class IAMRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.rds_rules import RDSRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.rds_rules import RDSRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class RDSRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.redshift_rules import RedshiftRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.redshift_rules import RedshiftRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class RedshiftRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.s3_rules import S3Rules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.s3_rules import S3Rules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class S3RulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.ses_rules import SESRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.ses_rules import SESRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class SESRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.sns_rules import SNSRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.sns_rules import SNSRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class SNSRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.sqs_rules import SQSRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.sqs_rules import SQSRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class SQSRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from ..abstract_rule_path_creator import AbstractRulePathCreator
from ....consts.rule_names.vpc_rules import VPCRules
from ....consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.vpc_rules import VPCRules
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import SERVICE_TYPES
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.abstract_rule_path_creator import \
AbstractRulePathCreator
class VPCRulePathCreator(AbstractRulePathCreator):

View File

@ -1,6 +1,7 @@
from monkey_island.cc.models.zero_trust.scoutsuite_finding_details import ScoutSuiteFindingDetails
from monkey_island.cc.models.zero_trust.scoutsuite_rule import ScoutSuiteRule
from ..scoutsuite.consts.scoutsuite_finding_maps import PermissiveFirewallRules, UnencryptedData
from monkey_island.cc.services.zero_trust.scoutsuite.consts.scoutsuite_finding_maps import PermissiveFirewallRules, \
UnencryptedData
SCOUTSUITE_FINDINGS = [
PermissiveFirewallRules,