Common: remove unused cloud environment names, CloudInstance class property and getter for all cloud instances

This commit is contained in:
VakarisZ 2021-11-16 12:15:01 +02:00
parent 90a063c47c
commit 5b96f172b4
5 changed files with 0 additions and 33 deletions

View File

@ -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

View File

@ -2,14 +2,4 @@ from enum import Enum
class Environment(Enum):
UNKNOWN = "Unknown"
ON_PREMISE = "On Premise"
AZURE = "Azure"
AWS = "AWS"
GCP = "GCP"
ALIBABA = "Alibaba Cloud"
IBM = "IBM Cloud"
DigitalOcean = "Digital Ocean"
ALL_ENVIRONMENTS_NAMES = [x.value for x in Environment]

View File

@ -1,6 +1,3 @@
from common.cloud.environment_names import Environment
class CloudInstance(object):
"""
This is an abstract class which represents a cloud instance.
@ -10,6 +7,3 @@ class CloudInstance(object):
def is_instance(self) -> bool:
raise NotImplementedError()
def get_cloud_provider_name(self) -> Environment:
raise NotImplementedError()

View File

@ -3,7 +3,3 @@ from enum import Enum
class CloudProviders(Enum):
AWS = "aws"
AZURE = "azure"
GCP = "gcp"
ALIBABA = "aliyun"
ORACLE = "oci"

View File

@ -14,7 +14,6 @@ from mongoengine import (
StringField,
)
from common.cloud import environment_names
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.server_utils.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS