netsec-scan: hold current-state tripwires on a seed tick instead of printing them
A seed tick's contract is 'stdout empty + one summary line'. PromQL rules run before the seed block and their findings were still printed, so a cold start on a cluster with an active drop-spike (or four new-port lines) was NOT silent and its cron delivery outcome was 'delivered', not 'suppressed' — i.e. the seed tick still looked like the alert storm it exists to prevent. Observed live at 07:17Z: drop-spike + 4x new-port were firing. They are now absorbed with no cooldown clock (last_alert='') so the first warm tick reports them: the silence costs one interval, never a 24 h STATE_COOLDOWN.
This commit is contained in:
parent
63bac6e06f
commit
5e45aa0713
1 changed files with 17 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue