diff --git a/monkey/common/common_consts/zero_trust_consts.py b/monkey/common/common_consts/zero_trust_consts.py index c257c627c..e6a6b29c5 100644 --- a/monkey/common/common_consts/zero_trust_consts.py +++ b/monkey/common/common_consts/zero_trust_consts.py @@ -174,7 +174,7 @@ TESTS_MAP = { STATUS_PASSED: "Monkey didn't find open PostgreSQL servers. If you have such servers, look for alerts that " "indicate attempts to access them. " }, - PRINCIPLE_KEY: PRINCIPLE_DATA_TRANSIT, + PRINCIPLE_KEY: PRINCIPLE_DATA_CONFIDENTIALITY, PILLARS_KEY: [DATA], POSSIBLE_STATUSES_KEY: [STATUS_UNEXECUTED, STATUS_FAILED, STATUS_PASSED] }, diff --git a/monkey/infection_monkey/network/postgresql_finger.py b/monkey/infection_monkey/network/postgresql_finger.py index 477342806..031765dd8 100644 --- a/monkey/infection_monkey/network/postgresql_finger.py +++ b/monkey/infection_monkey/network/postgresql_finger.py @@ -52,7 +52,7 @@ class PostgreSQLFinger(HostFinger): host.services, self._SCANNED_SERVICE, self.POSTGRESQL_DEFAULT_PORT ) host.services[self._SCANNED_SERVICE]["communication_encryption_details"] = ( - f"The PostgreSQL server was unexpectedly accessible with the credentials - " + "The PostgreSQL server was unexpectedly accessible with the credentials - " + f"user: '{self.CREDS['username']}' and password: '{self.CREDS['password']}'. Is this a honeypot?" ) return True diff --git a/monkey/infection_monkey/network/test_postgresql_finger.py b/monkey/infection_monkey/network/test_postgresql_finger.py index 4cbf7d94f..6eb01fecd 100644 --- a/monkey/infection_monkey/network/test_postgresql_finger.py +++ b/monkey/infection_monkey/network/test_postgresql_finger.py @@ -119,7 +119,7 @@ def test_exception_ssl_not_configured_all_non_ssl_allowed(mock_PostgreSQLFinger, exception = _RELEVANT_EXCEPTION_STRINGS["pwd_auth_failed"] assert mock_PostgreSQLFinger._is_relevant_exception(exception) is True - result = mock_PostgreSQLFinger.analyze_operational_error(host, exception) + mock_PostgreSQLFinger.analyze_operational_error(host, exception) assert host.services[mock_PostgreSQLFinger._SCANNED_SERVICE][ "communication_encryption_details" ] == "".join(RELEVANT_EXCEPTIONS_WITH_EXPECTED_RESULTS[exception]) @@ -131,7 +131,7 @@ def test_exception_ssl_not_configured_selected_non_ssl_allowed( exception = _RELEVANT_EXCEPTION_STRINGS["ssl_off_entry_not_found"] assert mock_PostgreSQLFinger._is_relevant_exception(exception) is True - result = mock_PostgreSQLFinger.analyze_operational_error(host, exception) + mock_PostgreSQLFinger.analyze_operational_error(host, exception) assert host.services[mock_PostgreSQLFinger._SCANNED_SERVICE][ "communication_encryption_details" ] == "".join(RELEVANT_EXCEPTIONS_WITH_EXPECTED_RESULTS[exception]) @@ -141,7 +141,7 @@ def test_exception_all_ssl_allowed_all_non_ssl_allowed(mock_PostgreSQLFinger, ho exception = _RELEVANT_EXCEPTION_STRINGS["pwd_auth_failed_pwd_auth_failed"] assert mock_PostgreSQLFinger._is_relevant_exception(exception) is True - result = mock_PostgreSQLFinger.analyze_operational_error(host, exception) + mock_PostgreSQLFinger.analyze_operational_error(host, exception) assert host.services[mock_PostgreSQLFinger._SCANNED_SERVICE][ "communication_encryption_details" ] == "".join(RELEVANT_EXCEPTIONS_WITH_EXPECTED_RESULTS[exception]) @@ -153,7 +153,7 @@ def test_exception_all_ssl_allowed_selected_non_ssl_allowed( exception = _RELEVANT_EXCEPTION_STRINGS["pwd_auth_failed_ssl_off_entry_not_found"] assert mock_PostgreSQLFinger._is_relevant_exception(exception) is True - result = mock_PostgreSQLFinger.analyze_operational_error(host, exception) + mock_PostgreSQLFinger.analyze_operational_error(host, exception) assert host.services[mock_PostgreSQLFinger._SCANNED_SERVICE][ "communication_encryption_details" ] == "".join(RELEVANT_EXCEPTIONS_WITH_EXPECTED_RESULTS[exception]) @@ -165,7 +165,7 @@ def test_exception_selected_ssl_allowed_all_non_ssl_allowed( exception = _RELEVANT_EXCEPTION_STRINGS["ssl_on_entry_not_found_pwd_auth_failed"] assert mock_PostgreSQLFinger._is_relevant_exception(exception) is True - result = mock_PostgreSQLFinger.analyze_operational_error(host, exception) + mock_PostgreSQLFinger.analyze_operational_error(host, exception) assert host.services[mock_PostgreSQLFinger._SCANNED_SERVICE][ "communication_encryption_details" ] == "".join(RELEVANT_EXCEPTIONS_WITH_EXPECTED_RESULTS[exception]) @@ -179,7 +179,7 @@ def test_exception_selected_ssl_allowed_selected_non_ssl_allowed( ] assert mock_PostgreSQLFinger._is_relevant_exception(exception) is True - result = mock_PostgreSQLFinger.analyze_operational_error(host, exception) + mock_PostgreSQLFinger.analyze_operational_error(host, exception) assert host.services[mock_PostgreSQLFinger._SCANNED_SERVICE][ "communication_encryption_details" ] == "".join(RELEVANT_EXCEPTIONS_WITH_EXPECTED_RESULTS[exception])