From 21abdb5ceff584a3410f334457182587298c1463 Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Sat, 24 Mar 2018 21:29:50 +0300 Subject: [PATCH] Add tag to system info if on Azure and harvested creds. --- infection_monkey/system_info/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/infection_monkey/system_info/__init__.py b/infection_monkey/system_info/__init__.py index 464b1462c..0d2828d88 100644 --- a/infection_monkey/system_info/__init__.py +++ b/infection_monkey/system_info/__init__.py @@ -117,7 +117,8 @@ class InfoCollector(object): azure_collector = AzureCollector() if 'credentials' not in self.info: self.info["credentials"] = {} - for cred in azure_collector.extract_stored_credentials(): + azure_creds = azure_collector.extract_stored_credentials() + for cred in azure_creds: username = cred[0] password = cred[1] if username not in self.info["credentials"]: @@ -125,3 +126,5 @@ class InfoCollector(object): # we might be losing passwords in case of multiple reset attempts on same username # or in case another collector already filled in a password for this user self.info["credentials"][username]['Password'] = password + if len(azure_creds) != 0: + self.info["Azure"] = True