diff --git a/netsec_scan/__main__.py b/netsec_scan/__main__.py index 46a9fd8..d930732 100644 --- a/netsec_scan/__main__.py +++ b/netsec_scan/__main__.py @@ -616,6 +616,23 @@ def main(argv: Optional[List[str]] = None) -> int: st, (http_end - http_window, http_end), args, args.verbose) findings.extend(http_findings) + held = 0 + if seeding and findings: + # A current-state tripwire is real, but a seed tick's contract is + # "stdout empty, one summary line" — printing here is what made a + # cold start indistinguishable from an alert storm. Record the + # fingerprints (nothing is forgotten) but leave a state rule *due*: + # no cooldown clock, so the first warm tick reports it instead of a + # 24 h STATE_COOLDOWN eating it. A seed spanning several ticks + # defers them by at most that many intervals. + for finding in findings: + fresh = absorb(st, finding.kind, finding.entity, finding.rule, + finding.severity) + if fresh and finding.kind == "state": + st["seen"][finding.fingerprint]["last_alert"] = "" + held = len(findings) + findings = [] + if baseline["archive"]: # Not a fault, and not news either: these tuples are inside the # window the next alert would quote. Say so once, loudly enough to