Check for findings that should be resolved due to timeout
(self)
| 570 | return {'vulnerabilities': {}, 'credentials': {}, 'counts': {}} |
| 571 | |
| 572 | def run_resolution_check(self): |
| 573 | """Check for findings that should be resolved due to timeout""" |
| 574 | try: |
| 575 | current_time = datetime.now() |
| 576 | resolved_count = 0 |
| 577 | |
| 578 | # Check all networks for pending resolution |
| 579 | for network_id in list(self.active_vulnerabilities.keys()): |
| 580 | for vuln_id, vuln_data in list(self.active_vulnerabilities[network_id].items()): |
| 581 | if vuln_data.get('pending_resolution'): |
| 582 | scheduled_time = datetime.fromisoformat(vuln_data.get('resolution_scheduled', current_time.isoformat())) |
| 583 | if (current_time - scheduled_time).total_seconds() > self.resolution_timeout: |
| 584 | self.resolve_finding(vuln_id, "timeout_no_confirmation") |
| 585 | resolved_count += 1 |
| 586 | |
| 587 | for network_id in list(self.active_credentials.keys()): |
| 588 | for cred_id, cred_data in list(self.active_credentials[network_id].items()): |
| 589 | if cred_data.get('pending_resolution'): |
| 590 | scheduled_time = datetime.fromisoformat(cred_data.get('resolution_scheduled', current_time.isoformat())) |
| 591 | if (current_time - scheduled_time).total_seconds() > self.resolution_timeout: |
| 592 | self.resolve_finding(cred_id, "timeout_no_confirmation") |
| 593 | resolved_count += 1 |
| 594 | |
| 595 | if resolved_count > 0: |
| 596 | self.logger.info(f"Resolved {resolved_count} findings due to timeout") |
| 597 | |
| 598 | except Exception as e: |
| 599 | self.logger.error(f"Error running resolution check: {e}") |
| 600 | |
| 601 | def get_network_summary(self) -> Dict: |
| 602 | """Get summary of all network intelligence""" |