Handle network change by managing finding states
(self, old_network: Optional[str], new_network: Optional[str])
| 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""" |
no test coverage detected