Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions mpsiemlib/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ def __init__(self, creds, settings: Settings):
self.__auth = MPSIEMAuth(self.creds, self.settings)
sessions = {}
if self.creds.core_hostname:
sessions['core'] = self.__auth.connect(MPComponents.CORE)
sessions['ms'] = self.__auth.connect(MPComponents.MS)
sessions['kb'] = self.__auth.connect(MPComponents.KB)
target_components = [('core', MPComponents.CORE), ('ms', MPComponents.MS), ('kb', MPComponents.KB)]
for name, component in target_components:
try:
session = self.__auth.connect(component)
if session:
sessions[name] = session
else:
self.log.warning(f"Connection to {name} returned empty session. Skipping...")
except Exception as e:
self.log.warning(f"Failed to connect to component {name}: {e}. Skipping this component.")
# if self.creds.siem_hostname:
# sessions['siem'] = self.__auth.connect(MPComponents.SIEM)
# if self.creds.storage_hostname:
Expand Down