Complete report from an autonomous security loop run.
| 66 | @dataclass |
| 67 | class LoopReport: |
| 68 | """Complete report from an autonomous security loop run.""" |
| 69 | target: str |
| 70 | mode: str |
| 71 | operator: str |
| 72 | engagement_id: str |
| 73 | session_id: str |
| 74 | started_at: str |
| 75 | completed_at: str = "" |
| 76 | scan_summary: dict = field(default_factory=dict) |
| 77 | risk_score: int = 0 |
| 78 | risk_color: str = "UNKNOWN" |
| 79 | total_hosts: int = 0 |
| 80 | total_services: int = 0 |
| 81 | total_cves: int = 0 |
| 82 | confirmed_exploitable: int = 0 |
| 83 | already_exploited: int = 0 |
| 84 | remediations_generated: int = 0 |
| 85 | remediations_applied: int = 0 |
| 86 | verified_closed: int = 0 |
| 87 | findings: list[LoopFinding] = field(default_factory=list) |
| 88 | audit_log: list[dict] = field(default_factory=list) |
| 89 | errors: list[str] = field(default_factory=list) |
| 90 | |
| 91 | def to_dict(self) -> dict: |
| 92 | return { |
| 93 | "target": self.target, |
| 94 | "mode": self.mode, |
| 95 | "operator": self.operator, |
| 96 | "engagement_id": self.engagement_id, |
| 97 | "session_id": self.session_id, |
| 98 | "started_at": self.started_at, |
| 99 | "completed_at": self.completed_at, |
| 100 | "risk_score": self.risk_score, |
| 101 | "risk_color": self.risk_color, |
| 102 | "summary": { |
| 103 | "hosts": self.total_hosts, |
| 104 | "services": self.total_services, |
| 105 | "cves": self.total_cves, |
| 106 | "confirmed_exploitable": self.confirmed_exploitable, |
| 107 | "already_exploited": self.already_exploited, |
| 108 | "remediations_generated": self.remediations_generated, |
| 109 | "remediations_applied": self.remediations_applied, |
| 110 | "verified_closed": self.verified_closed, |
| 111 | }, |
| 112 | "findings": [ |
| 113 | { |
| 114 | "ip": f.ip, |
| 115 | "port": f.port, |
| 116 | "service": f.service, |
| 117 | "version": f.version, |
| 118 | "cve_id": f.cve_id, |
| 119 | "cvss_score": f.cvss_score, |
| 120 | "exploit_status": f.exploit_status, |
| 121 | "attack_tags": f.attack_tags, |
| 122 | "already_exploited": f.already_exploited, |
| 123 | "hunt_evidence": f.hunt_evidence, |
| 124 | "remediation_safe": f.remediation.safe if f.remediation else None, |
| 125 | "remediation_explanation": f.remediation.explanation if f.remediation else None, |