MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / handle_network_change

Method handle_network_change

network_intelligence.py:199–217  ·  view source on GitHub ↗

Handle network change by managing finding states

(self, old_network: Optional[str], new_network: Optional[str])

Source from the content-addressed store, hash-verified

197 self.logger.error(f"Error updating network context: {e}")
198
199 def handle_network_change(self, old_network: Optional[str], new_network: Optional[str]):
200 """Handle network change by managing finding states"""
201 try:
202 if old_network and new_network and old_network != new_network:
203 # Mark findings from old network as potentially resolved
204 self.schedule_resolution_check(old_network)
205
206 # Log network transition
207 self.logger.info(f"Scheduled resolution check for network: {old_network}")
208
209 # Initialize new network if needed
210 if new_network:
211 if new_network not in self.active_vulnerabilities:
212 self.active_vulnerabilities[new_network] = {}
213 if new_network not in self.active_credentials:
214 self.active_credentials[new_network] = {}
215
216 except Exception as e:
217 self.logger.error(f"Error handling network change: {e}")
218
219 def schedule_resolution_check(self, network_id: str):
220 """Schedule findings for resolution check"""

Callers 1

Calls 3

infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected