From 8e6a2d8e7dbdc072e5f77c0ea0c5b88834230982 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 26 Oct 2021 15:23:07 +0300 Subject: [PATCH 1/2] UI: bugfix the need to double click on the import when importing an encrypted configuration When back-end sends the schema for ui to validate that no unsafe options are selected, UI didn't automatically send a response back in case there were no unsafe options selected --- .../components/configuration-components/ImportConfigModal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx b/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx index 9456e7dd8..8a600ab28 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ImportConfigModal.tsx @@ -37,7 +37,7 @@ const ConfigImportModal = (props: Props) => { if (configContents !== null) { sendConfigToServer(); } - }, [configContents]) + }, [configContents, unsafeOptionsVerified]) function sendConfigToServer() { @@ -67,6 +67,7 @@ const ConfigImportModal = (props: Props) => { } else if (res['import_status'] === 'unsafe_options_verification_required') { setUploadStatus(UploadStatuses.success); setErrorMessage(''); + if (isUnsafeOptionSelected(res['config_schema'], JSON.parse(res['config']))) { setShowUnsafeOptionsConfirmation(true); setCandidateConfig(res['config']); From aa6f202a8fdd449c78d14e4ec0e29c21ed744a92 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 26 Oct 2021 15:47:33 +0300 Subject: [PATCH 2/2] Island: change the log message level of wrong password in password_based_bytes_encryptor.py to debug Wrong password is in some cases expected behavior, not an error of an application --- .../server_utils/encryption/password_based_bytes_encryptor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/server_utils/encryption/password_based_bytes_encryptor.py b/monkey/monkey_island/cc/server_utils/encryption/password_based_bytes_encryptor.py index b50e77e87..dd9ea329f 100644 --- a/monkey/monkey_island/cc/server_utils/encryption/password_based_bytes_encryptor.py +++ b/monkey/monkey_island/cc/server_utils/encryption/password_based_bytes_encryptor.py @@ -47,7 +47,7 @@ class PasswordBasedBytesEncryptor(IEncryptor): ) except ValueError as ex: if str(ex).startswith("Wrong password"): - logger.error("Wrong password provided for decryption.") + logger.debug("Wrong password provided for decryption.") raise InvalidCredentialsError else: logger.error("The provided ciphertext was corrupt.")