forked from p15670423/monkey
Common: remove unused cloud environment names, CloudInstance class property and getter for all cloud instances
This commit is contained in:
parent
90a063c47c
commit
5b96f172b4
|
@ -1,12 +0,0 @@
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from common.cloud.aws.aws_instance import AwsInstance
|
|
||||||
from common.cloud.azure.azure_instance import AzureInstance
|
|
||||||
from common.cloud.gcp.gcp_instance import GcpInstance
|
|
||||||
from common.cloud.instance import CloudInstance
|
|
||||||
|
|
||||||
all_cloud_instances = [AwsInstance(), AzureInstance(), GcpInstance()]
|
|
||||||
|
|
||||||
|
|
||||||
def get_all_cloud_instances() -> List[CloudInstance]:
|
|
||||||
return all_cloud_instances
|
|
|
@ -2,14 +2,4 @@ from enum import Enum
|
||||||
|
|
||||||
|
|
||||||
class Environment(Enum):
|
class Environment(Enum):
|
||||||
UNKNOWN = "Unknown"
|
|
||||||
ON_PREMISE = "On Premise"
|
|
||||||
AZURE = "Azure"
|
|
||||||
AWS = "AWS"
|
AWS = "AWS"
|
||||||
GCP = "GCP"
|
|
||||||
ALIBABA = "Alibaba Cloud"
|
|
||||||
IBM = "IBM Cloud"
|
|
||||||
DigitalOcean = "Digital Ocean"
|
|
||||||
|
|
||||||
|
|
||||||
ALL_ENVIRONMENTS_NAMES = [x.value for x in Environment]
|
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
from common.cloud.environment_names import Environment
|
|
||||||
|
|
||||||
|
|
||||||
class CloudInstance(object):
|
class CloudInstance(object):
|
||||||
"""
|
"""
|
||||||
This is an abstract class which represents a cloud instance.
|
This is an abstract class which represents a cloud instance.
|
||||||
|
@ -10,6 +7,3 @@ class CloudInstance(object):
|
||||||
|
|
||||||
def is_instance(self) -> bool:
|
def is_instance(self) -> bool:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
def get_cloud_provider_name(self) -> Environment:
|
|
||||||
raise NotImplementedError()
|
|
||||||
|
|
|
@ -3,7 +3,3 @@ from enum import Enum
|
||||||
|
|
||||||
class CloudProviders(Enum):
|
class CloudProviders(Enum):
|
||||||
AWS = "aws"
|
AWS = "aws"
|
||||||
AZURE = "azure"
|
|
||||||
GCP = "gcp"
|
|
||||||
ALIBABA = "aliyun"
|
|
||||||
ORACLE = "oci"
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ from mongoengine import (
|
||||||
StringField,
|
StringField,
|
||||||
)
|
)
|
||||||
|
|
||||||
from common.cloud import environment_names
|
|
||||||
from monkey_island.cc.models.command_control_channel import CommandControlChannel
|
from monkey_island.cc.models.command_control_channel import CommandControlChannel
|
||||||
from monkey_island.cc.models.monkey_ttl import MonkeyTtl, create_monkey_ttl_document
|
from monkey_island.cc.models.monkey_ttl import MonkeyTtl, create_monkey_ttl_document
|
||||||
from monkey_island.cc.server_utils.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS
|
from monkey_island.cc.server_utils.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS
|
||||||
|
|
Loading…
Reference in New Issue