Island: Remove ScoutSuite rule path creators

This commit is contained in:
Mike Salvatore 2022-02-01 15:18:32 -05:00 committed by Shreya Malviya
parent 2728404a15
commit 75f23b6032
18 changed files with 0 additions and 282 deletions

View File

@ -1,31 +0,0 @@
from enum import Enum
SERVICES = "services"
FINDINGS = "findings"
class SERVICE_TYPES(Enum):
ACM = "acm"
AWSLAMBDA = "awslambda"
CLOUDFORMATION = "cloudformation"
CLOUDTRAIL = "cloudtrail"
CLOUDWATCH = "cloudwatch"
CONFIG = "config"
DIRECTCONNECT = "directconnect"
EC2 = "ec2"
EFS = "efs"
ELASTICACHE = "elasticache"
ELB = "elb"
ELB_V2 = "elbv2"
EMR = "emr"
IAM = "iam"
KMS = "kms"
RDS = "rds"
REDSHIFT = "redshift"
ROUTE53 = "route53"
S3 = "s3"
SES = "ses"
SNS = "sns"
SQS = "sqs"
VPC = "vpc"
SECRETSMANAGER = "secretsmanager"

View File

@ -1,28 +0,0 @@
from abc import ABC, abstractmethod
from enum import Enum
from typing import List, Type
from monkey_island.cc.services.zero_trust.scoutsuite.consts.rule_names.rule_name_enum import (
RuleNameEnum,
)
from monkey_island.cc.services.zero_trust.scoutsuite.consts.service_consts import (
FINDINGS,
SERVICE_TYPES,
)
class AbstractRulePathCreator(ABC):
@property
@abstractmethod
def service_type(self) -> SERVICE_TYPES:
pass
@property
@abstractmethod
def supported_rules(self) -> Type[RuleNameEnum]:
pass
@classmethod
def build_rule_path(cls, rule_name: Enum) -> List[str]:
assert rule_name in cls.supported_rules
return [cls.service_type.value, FINDINGS, rule_name.value]

View File

@ -1,12 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class CloudformationRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.CLOUDFORMATION
supported_rules = CloudformationRules

View File

@ -1,12 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class CloudTrailRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.CLOUDTRAIL
supported_rules = CloudTrailRules

View File

@ -1,12 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class CloudWatchRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.CLOUDWATCH
supported_rules = CloudWatchRules

View File

@ -1,12 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class ConfigRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.CONFIG
supported_rules = ConfigRules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class EC2RulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.EC2
supported_rules = EC2Rules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class ELBRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.ELB
supported_rules = ELBRules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class ELBv2RulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.ELB_V2
supported_rules = ELBv2Rules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class IAMRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.IAM
supported_rules = IAMRules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class RDSRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.RDS
supported_rules = RDSRules

View File

@ -1,12 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class RedshiftRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.REDSHIFT
supported_rules = RedshiftRules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class S3RulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.S3
supported_rules = S3Rules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class SESRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.SES
supported_rules = SESRules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class SNSRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.SNS
supported_rules = SNSRules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class SQSRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.SQS
supported_rules = SQSRules

View File

@ -1,10 +0,0 @@
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 ( # noqa: E501
AbstractRulePathCreator,
)
class VPCRulePathCreator(AbstractRulePathCreator):
service_type = SERVICE_TYPES.VPC
supported_rules = VPCRules

View File

@ -1,63 +0,0 @@
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.cloudformation_rule_path_creator import ( # noqa: E501
CloudformationRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.cloudtrail_rule_path_creator import ( # noqa: E501
CloudTrailRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.cloudwatch_rule_path_creator import ( # noqa: E501
CloudWatchRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.config_rule_path_creator import ( # noqa: E501
ConfigRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.ec2_rule_path_creator import ( # noqa: E501
EC2RulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.elb_rule_path_creator import ( # noqa: E501
ELBRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.elbv2_rule_path_creator import ( # noqa: E501
ELBv2RulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.iam_rule_path_creator import ( # noqa: E501
IAMRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.rds_rule_path_creator import ( # noqa: E501
RDSRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.redshift_rule_path_creator import ( # noqa: E501
RedshiftRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.s3_rule_path_creator import ( # noqa: E501
S3RulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.ses_rule_path_creator import ( # noqa: E501
SESRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.sns_rule_path_creator import ( # noqa: E501
SNSRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.sqs_rule_path_creator import ( # noqa: E501
SQSRulePathCreator,
)
from monkey_island.cc.services.zero_trust.scoutsuite.data_parsing.rule_path_building.rule_path_creators.vpc_rule_path_creator import ( # noqa: E501
VPCRulePathCreator,
)
RULE_PATH_CREATORS_LIST = [
EC2RulePathCreator,
ELBv2RulePathCreator,
RDSRulePathCreator,
RedshiftRulePathCreator,
S3RulePathCreator,
IAMRulePathCreator,
CloudTrailRulePathCreator,
ELBRulePathCreator,
VPCRulePathCreator,
CloudWatchRulePathCreator,
SQSRulePathCreator,
SNSRulePathCreator,
SESRulePathCreator,
ConfigRulePathCreator,
CloudformationRulePathCreator,
]