diff --git a/monkey/infection_monkey/i_puppet/credential_collection/credential_type.py b/monkey/common/common_consts/credentials_type.py similarity index 79% rename from monkey/infection_monkey/i_puppet/credential_collection/credential_type.py rename to monkey/common/common_consts/credentials_type.py index ef00f3732..e818b1e5c 100644 --- a/monkey/infection_monkey/i_puppet/credential_collection/credential_type.py +++ b/monkey/common/common_consts/credentials_type.py @@ -1,7 +1,7 @@ from enum import Enum -class CredentialType(Enum): +class CredentialsType(Enum): USERNAME = 1 PASSWORD = 2 NT_HASH = 3 diff --git a/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py b/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py index 7706540a3..a7be177a8 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/lm_hash.py @@ -1,9 +1,10 @@ from dataclasses import dataclass, field -from infection_monkey.i_puppet import CredentialType, ICredentialComponent +from common.common_consts.credentials_type import CredentialsType +from infection_monkey.i_puppet import ICredentialComponent @dataclass(frozen=True) class LMHash(ICredentialComponent): - credential_type: CredentialType = field(default=CredentialType.LM_HASH, init=False) + credential_type: CredentialsType = field(default=CredentialsType.LM_HASH, init=False) lm_hash: str diff --git a/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py b/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py index e6932c4c5..d23f42a1d 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/nt_hash.py @@ -1,9 +1,10 @@ from dataclasses import dataclass, field -from infection_monkey.i_puppet import CredentialType, ICredentialComponent +from common.common_consts.credentials_type import CredentialsType +from infection_monkey.i_puppet import ICredentialComponent @dataclass(frozen=True) class NTHash(ICredentialComponent): - credential_type: CredentialType = field(default=CredentialType.NT_HASH, init=False) + credential_type: CredentialsType = field(default=CredentialsType.NT_HASH, init=False) nt_hash: str diff --git a/monkey/infection_monkey/credential_collectors/credential_components/password.py b/monkey/infection_monkey/credential_collectors/credential_components/password.py index 701c9fcde..19477ab18 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/password.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/password.py @@ -1,9 +1,10 @@ from dataclasses import dataclass, field -from infection_monkey.i_puppet import CredentialType, ICredentialComponent +from common.common_consts.credentials_type import CredentialsType +from infection_monkey.i_puppet import ICredentialComponent @dataclass(frozen=True) class Password(ICredentialComponent): - credential_type: CredentialType = field(default=CredentialType.PASSWORD, init=False) + credential_type: CredentialsType = field(default=CredentialsType.PASSWORD, init=False) password: str diff --git a/monkey/infection_monkey/credential_collectors/credential_components/ssh_keypair.py b/monkey/infection_monkey/credential_collectors/credential_components/ssh_keypair.py index c5f377c44..6d54dafe4 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/ssh_keypair.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/ssh_keypair.py @@ -1,10 +1,11 @@ from dataclasses import dataclass, field -from infection_monkey.i_puppet import CredentialType, ICredentialComponent +from common.common_consts.credentials_type import CredentialsType +from infection_monkey.i_puppet import ICredentialComponent @dataclass(frozen=True) class SSHKeypair(ICredentialComponent): - credential_type: CredentialType = field(default=CredentialType.SSH_KEYPAIR, init=False) + credential_type: CredentialsType = field(default=CredentialsType.SSH_KEYPAIR, init=False) private_key: str public_key: str diff --git a/monkey/infection_monkey/credential_collectors/credential_components/username.py b/monkey/infection_monkey/credential_collectors/credential_components/username.py index 208849061..f1587955f 100644 --- a/monkey/infection_monkey/credential_collectors/credential_components/username.py +++ b/monkey/infection_monkey/credential_collectors/credential_components/username.py @@ -1,9 +1,10 @@ from dataclasses import dataclass, field -from infection_monkey.i_puppet import CredentialType, ICredentialComponent +from common.common_consts.credentials_type import CredentialsType +from infection_monkey.i_puppet import ICredentialComponent @dataclass(frozen=True) class Username(ICredentialComponent): - credential_type: CredentialType = field(default=CredentialType.USERNAME, init=False) + credential_type: CredentialsType = field(default=CredentialsType.USERNAME, init=False) username: str diff --git a/monkey/infection_monkey/i_puppet/__init__.py b/monkey/infection_monkey/i_puppet/__init__.py index 1c16f6df2..767826297 100644 --- a/monkey/infection_monkey/i_puppet/__init__.py +++ b/monkey/infection_monkey/i_puppet/__init__.py @@ -1,10 +1,4 @@ from .plugin_type import PluginType -from .credential_collection import ( - Credentials, - CredentialType, - ICredentialCollector, - ICredentialComponent, -) from .i_puppet import ( IPuppet, ExploiterResultData, @@ -16,3 +10,8 @@ from .i_puppet import ( UnknownPluginError, ) from .i_fingerprinter import IFingerprinter +from .credential_collection import ( + Credentials, + ICredentialCollector, + ICredentialComponent, +) diff --git a/monkey/infection_monkey/i_puppet/credential_collection/__init__.py b/monkey/infection_monkey/i_puppet/credential_collection/__init__.py index 8bfa68b38..a97d8373f 100644 --- a/monkey/infection_monkey/i_puppet/credential_collection/__init__.py +++ b/monkey/infection_monkey/i_puppet/credential_collection/__init__.py @@ -1,4 +1,3 @@ from .i_credential_collector import ICredentialCollector from .credentials import Credentials from .i_credential_component import ICredentialComponent -from .credential_type import CredentialType diff --git a/monkey/infection_monkey/i_puppet/credential_collection/i_credential_component.py b/monkey/infection_monkey/i_puppet/credential_collection/i_credential_component.py index d1c005886..5846c7ecf 100644 --- a/monkey/infection_monkey/i_puppet/credential_collection/i_credential_component.py +++ b/monkey/infection_monkey/i_puppet/credential_collection/i_credential_component.py @@ -1,10 +1,10 @@ from abc import ABC, abstractmethod -from .credential_type import CredentialType +from common.common_consts.credentials_type import CredentialsType class ICredentialComponent(ABC): @property @abstractmethod - def credential_type(self) -> CredentialType: + def credential_type(self) -> CredentialsType: pass diff --git a/monkey/monkey_island/cc/services/telemetry/processing/processing.py b/monkey/monkey_island/cc/services/telemetry/processing/processing.py index 44cd5c0cc..00d403937 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/processing.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/processing.py @@ -12,6 +12,7 @@ from monkey_island.cc.services.telemetry.processing.tunnel import process_tunnel logger = logging.getLogger(__name__) TELEMETRY_CATEGORY_TO_PROCESSING_FUNC = { + TelemCategoryEnum.CREDENTIALS: process_credentials_telemetry, TelemCategoryEnum.TUNNEL: process_tunnel_telemetry, TelemCategoryEnum.STATE: process_state_telemetry, TelemCategoryEnum.EXPLOIT: process_exploit_telemetry,