fix(plugins/rule-flood-guard): scope flood threshold per rule and data source on v11#2370
Open
yllada wants to merge 4 commits into
Open
fix(plugins/rule-flood-guard): scope flood threshold per rule and data source on v11#2370yllada wants to merge 4 commits into
yllada wants to merge 4 commits into
Conversation
🛑 AI review — Blocking issuesOne or more high/critical issues can break things and must be fixed before merging. Details below.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Changes how
rule-flood-guardcounts alerts before deciding to auto-disable a rule: the threshold now applies per (rule, data source) pair instead of per rule globally. Also raises the notification message length limit and adds a couple of small reliability/usability improvements found while implementing this.Why
The original counting logic grouped alerts only by rule name. This meant a rule firing legitimately once each across many different data sources/assets (e.g. the same detection catching a real, spreading incident on many endpoints) could cross the threshold and get auto-disabled — exactly the wrong moment to lose that detection. Grouping by rule and data source correctly distinguishes "the same signal repeating without dedup on one source" (real fatigue) from "the same rule legitimately firing across many distinct sources" (not fatigue).
Changes
fix(backend/notification)NotificationDTO.message's length limit from 280 to 500 characters (DB column isTEXT, unbounded — verified safe) so the notification can name both the rule and the data source without truncation.feat(plugins/rule-flood-guard)— thresholddataSource.keywordsub-aggregation inside the existing rule-name aggregation; the threshold now applies per (rule, data source) pair. The notification message now names the specific data source that tripped it. Also fixes a bug where a rule that WAS successfully disabled could silently lose its notification if another rule failed in the same name-collision batch.feat(plugins/rule-flood-guard)— configsystem_plugins_rule-flood-guard.yamlwith default values on first run if it doesn't exist (never overwrites an existing file).chore(deps)plugins/aws,plugins/gcp,plugins/modules-config(unrelated to this feature, bundled since they were already pending).