Notify about newly discovered vulnerabilities (compares against last notified count).
(self, new_total)
| 215 | threading.Thread(target=self.send, args=(msg, "Ragnar — Device Back Online"), daemon=True).start() |
| 216 | |
| 217 | def notify_new_vulnerabilities(self, new_total): |
| 218 | """Notify about newly discovered vulnerabilities (compares against last notified count).""" |
| 219 | if not self.is_enabled(): |
| 220 | return |
| 221 | if not self.shared_data.config.get("pushover_notify_new_vulnerability", True): |
| 222 | return |
| 223 | with self._lock: |
| 224 | if new_total <= self._last_notified_vuln_count: |
| 225 | return |
| 226 | delta = new_total - self._last_notified_vuln_count |
| 227 | self._last_notified_vuln_count = new_total |
| 228 | # Suppress notification during startup grace — just absorb the baseline |
| 229 | if self._in_startup_grace(): |
| 230 | logger.debug(f"Pushover: suppressed vuln alert (delta={delta}) during startup grace") |
| 231 | return |
| 232 | msg = f"🔥 {delta} new vulnerability/vulnerabilities found! (total: {new_total})" |
| 233 | threading.Thread(target=self.send, args=(msg, "Ragnar — Vulnerability Alert", 1), daemon=True).start() |
| 234 | |
| 235 | def notify_new_credentials(self, new_count, total): |
| 236 | """Notify when new credentials are captured.""" |
no test coverage detected