Repository navigation
fix(runtime): cap inhibition sources and warn about unbounded long correlation windows - #616
Merged
Merged
Conversation
mostafa
force-pushed
the
fix/inhibit-source-cap
branch
from
October 18, 2026 18:22
ed40fd3 to
bf69d1e
Compare
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.
Stacked on #615; merge that first.
Fixes #588.
Inhibit source cap
InhibitStorewas the only alert-pipeline store without a count cap. Sources were pruned bydurationonly, soequalselectors over attacker-influenced values (source IPs, usernames) could grow it without bound within the window.max_inhibit_sourceskey (default 100000) caps tracked sources across allinhibit_rules. It sits next tomax_silencesrather than inside a rule, because the store is shared.rsigma_inhibit_sources_refused_total{rule}. Already-tracked sources keep refreshing. This matches how the sibling stores refuse new entries instead of evicting.CapTrimpath, keeping the most recently seen sources, and the eviction warning includesinhibit_sources.AlertPipelineFile::max_inhibit_sources,CapTrim::inhibit_sources, andMetricsHook::on_inhibit_source_refused(a default no-op).Long correlation windows
max_group_entriesstays unbounded by default, because a finite default would silently stopevent_countrules whose threshold exceeds it. Instead,CorrelationEngine::add_correlationlogs a warning when a correlation'stimespanis longer than one hour and neitherrsigma.max_group_entriesnor the engine config caps its groups. For example:Tests
new_sources_past_the_cap_are_refused: a refused source neither inhibits nor counts toward the cap, and a tracked source still refreshes at the cap.enforce_cap_keeps_the_most_recently_seen.test_long_window_without_group_cap_is_flagged: covers a 2h window, a 1h window, an engine-level cap, and the per-rule attribute.