Island: Flatten directory structure for "encryption" package

This commit is contained in:
Mike Salvatore 2021-10-05 12:37:05 -04:00
parent bf082d36ef
commit 0eafc6613a
15 changed files with 15 additions and 21 deletions

View File

@ -1,12 +1,12 @@
from monkey_island.cc.server_utils.encryption.encryptors.i_encryptor import IEncryptor
from monkey_island.cc.server_utils.encryption.encryptors.key_based_encryptor import (
from .i_encryptor import IEncryptor
from .key_based_encryptor import (
KeyBasedEncryptor,
)
from monkey_island.cc.server_utils.encryption.encryptors.password_based_string_encryptor import (
from .password_based_string_encryptor import (
PasswordBasedStringEncryptor,
is_encrypted,
)
from monkey_island.cc.server_utils.encryption.encryptors.password_based_bytes_encryptor import (
from .password_based_bytes_encryptor import (
PasswordBasedBytesEncryptor,
InvalidCredentialsError,
InvalidCiphertextError,
@ -16,11 +16,12 @@ from .data_store_encryptor import (
get_datastore_encryptor,
remove_old_datastore_key,
)
from .dict_encryption.dict_encryptor import (
from .dict_encryptor import (
SensitiveField,
encrypt_dict,
decrypt_dict,
FieldNotFoundError,
)
from .dict_encryption.field_encryptors.mimikatz_results_encryptor import MimikatzResultsEncryptor
from .dict_encryption.field_encryptors.string_list_encryptor import StringListEncryptor
from .field_encryptors.i_field_encryptor import IFieldEncryptor
from .field_encryptors.mimikatz_results_encryptor import MimikatzResultsEncryptor
from .field_encryptors.string_list_encryptor import StringListEncryptor

View File

@ -5,7 +5,9 @@ from Crypto import Random # noqa: DUO133 # nosec: B413
from monkey_island.cc.server_utils.file_utils import open_new_securely_permissioned_file
from .encryptors import IEncryptor, KeyBasedEncryptor, PasswordBasedBytesEncryptor
from .i_encryptor import IEncryptor
from .key_based_encryptor import KeyBasedEncryptor
from .password_based_bytes_encryptor import PasswordBasedBytesEncryptor
_KEY_FILENAME = "mongo_key.bin"
_BLOCK_SIZE = 32

View File

@ -1,4 +0,0 @@
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

View File

@ -1,6 +1,6 @@
import logging
from ... import get_datastore_encryptor
from ..data_store_encryptor import get_datastore_encryptor
from . import IFieldEncryptor
logger = logging.getLogger(__name__)

View File

@ -1,6 +1,6 @@
from typing import List
from ... import get_datastore_encryptor
from ..data_store_encryptor import get_datastore_encryptor
from . import IFieldEncryptor

View File

@ -5,10 +5,7 @@ import pytest
from monkey_island.cc.models import Report
from monkey_island.cc.models.report import get_report, save_report
from monkey_island.cc.server_utils.encryption import SensitiveField
from monkey_island.cc.server_utils.encryption.dict_encryption.field_encryptors import (
IFieldEncryptor,
)
from monkey_island.cc.server_utils.encryption import IFieldEncryptor, SensitiveField
MOCK_SENSITIVE_FIELD_CONTENTS = ["the_string", "the_string2"]
MOCK_REPORT_DICT = {

View File

@ -1,8 +1,6 @@
import pytest
from monkey_island.cc.server_utils.encryption.dict_encryption.field_encryptors import (
StringListEncryptor,
)
from monkey_island.cc.server_utils.encryption import StringListEncryptor
MOCK_STRING_LIST = ["test_1", "test_2"]
EMPTY_LIST = []