diff --git a/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials.py b/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials.py index 858f8e744..70d13b594 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials.py @@ -8,7 +8,12 @@ from typing import Sequence class Credentials: identities: Sequence[dict] secrets: Sequence[dict] + monkey_guid: str @staticmethod - def from_dict(cred_dict: dict) -> Credentials: - return Credentials(identities=cred_dict["identities"], secrets=cred_dict["secrets"]) + def from_dict(cred_dict: dict, monkey_guid: str) -> Credentials: + return Credentials( + identities=cred_dict["identities"], + secrets=cred_dict["secrets"], + monkey_guid=monkey_guid, + ) diff --git a/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py b/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py index d595300fb..13c912910 100644 --- a/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py +++ b/monkey/monkey_island/cc/services/telemetry/processing/credentials/credentials_parser.py @@ -24,10 +24,10 @@ IDENTITY_PROCESSORS = { } -def parse_credentials(credentials_dict: Mapping): +def parse_credentials(telemetry_dict: Mapping): credentials = [ - Credentials(credential["identities"], credential["secrets"]) - for credential in credentials_dict["data"] + Credentials.from_dict(credential, telemetry_dict["monkey_guid"]) + for credential in telemetry_dict["data"] ] for credential in credentials: