diff --git a/monkey/monkey_island/cc/server_utils/encryption/data_store_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/data_store_encryptor.py index f7add80f3..3e8028944 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/data_store_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/data_store_encryptor.py @@ -3,13 +3,10 @@ from typing import Union from Crypto import Random # noqa: DUO133 # nosec: B413 -from monkey_island.cc.server_utils.encryption import ( - IEncryptor, - KeyBasedEncryptor, - PasswordBasedBytesEncryptor, -) from monkey_island.cc.server_utils.file_utils import open_new_securely_permissioned_file +from .encryptors import IEncryptor, KeyBasedEncryptor, PasswordBasedBytesEncryptor + _KEY_FILENAME = "mongo_key.bin" _BLOCK_SIZE = 32 diff --git a/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/dict_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/dict_encryptor.py index a95a761e0..4dc4662d6 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/dict_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/dict_encryptor.py @@ -3,9 +3,7 @@ from typing import Callable, List, Type import dpath.util -from monkey_island.cc.server_utils.encryption.dict_encryption.field_encryptors import ( - IFieldEncryptor, -) +from .field_encryptors import IFieldEncryptor class FieldNotFoundError(Exception): diff --git a/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/mimikatz_results_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/mimikatz_results_encryptor.py index ff2ee314e..163bee8fd 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/mimikatz_results_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/mimikatz_results_encryptor.py @@ -1,9 +1,7 @@ import logging -from monkey_island.cc.server_utils.encryption import get_datastore_encryptor -from monkey_island.cc.server_utils.encryption.dict_encryption.field_encryptors import ( - IFieldEncryptor, -) +from ... import get_datastore_encryptor +from . import IFieldEncryptor logger = logging.getLogger(__name__) diff --git a/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/string_list_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/string_list_encryptor.py index 04374c462..6a0dd58d2 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/string_list_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/dict_encryption/field_encryptors/string_list_encryptor.py @@ -1,9 +1,7 @@ from typing import List -from monkey_island.cc.server_utils.encryption import get_datastore_encryptor -from monkey_island.cc.server_utils.encryption.dict_encryption.field_encryptors import ( - IFieldEncryptor, -) +from ... import get_datastore_encryptor +from . import IFieldEncryptor class StringListEncryptor(IFieldEncryptor): diff --git a/monkey/monkey_island/cc/server_utils/encryption/encryptors/__init__.py b/monkey/monkey_island/cc/server_utils/encryption/encryptors/__init__.py index e69de29bb..11386f798 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/encryptors/__init__.py +++ b/monkey/monkey_island/cc/server_utils/encryption/encryptors/__init__.py @@ -0,0 +1,4 @@ +from .i_encryptor import IEncryptor +from .key_based_encryptor import KeyBasedEncryptor +from .password_based_string_encryptor import PasswordBasedStringEncryptor +from .password_based_bytes_encryptor import PasswordBasedBytesEncryptor diff --git a/monkey/monkey_island/cc/server_utils/encryption/encryptors/key_based_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/encryptors/key_based_encryptor.py index 551014be1..41c8b0db2 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/encryptors/key_based_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/encryptors/key_based_encryptor.py @@ -7,7 +7,7 @@ from Crypto import Random # noqa: DUO133 # nosec: B413 from Crypto.Cipher import AES # noqa: DUO133 # nosec: B413 from Crypto.Util import Padding # noqa: DUO133 -from monkey_island.cc.server_utils.encryption import IEncryptor +from .i_encryptor import IEncryptor logger = logging.getLogger(__name__) diff --git a/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_bytes_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_bytes_encryptor.py index 2e7c05819..ca46f5646 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_bytes_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_bytes_encryptor.py @@ -3,7 +3,7 @@ import logging import pyAesCrypt -from monkey_island.cc.server_utils.encryption import IEncryptor +from .i_encryptor import IEncryptor logger = logging.getLogger(__name__) diff --git a/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_string_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_string_encryptor.py index be8b6d6d6..dac7276e9 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_string_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/encryptors/password_based_string_encryptor.py @@ -3,10 +3,8 @@ import logging import pyAesCrypt -from monkey_island.cc.server_utils.encryption import IEncryptor -from monkey_island.cc.server_utils.encryption.encryptors.password_based_bytes_encryptor import ( - PasswordBasedBytesEncryptor, -) +from .i_encryptor import IEncryptor +from .password_based_bytes_encryptor import PasswordBasedBytesEncryptor logger = logging.getLogger(__name__)