Closed (fixed)
Project:
CrowdSec
Version:
1.2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Apr 2026 at 13:26 UTC
Updated:
23 Apr 2026 at 09:10 UTC
Jump to comment: Most recent
The Signal scenarios are meant to determine which signals from Ban plugins will be signaled upstream. Since we moved the signal determination into a plugin framework, we haven't actively verified, that the list of available "Signal scenarios" is actually dynamic according to the list of available and enabled plugins.
Also, what may not have been tested yet, if only the checked scenarios will be signaled upstream.
Review the code to verify that all this works as intended.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jurgenhaasReviewed the code to verify that Signal scenarios work as intended. Here are the findings:
1. The list of available Signal scenarios IS dynamic.
Signals::signalScenarios()insrc/Signals.phpiterates over all discoveredCrowdsecScenarioplugin definitions via the plugin manager. Any module can provide additional scenario plugins, and they will automatically appear in the Signal scenarios checkboxes on the settings form. Additionally, theSIGNAL_SCENARIO_LIST_BUILDevent allows other modules to add or modify scenarios without implementing a full plugin.If a module providing a scenario plugin is uninstalled, the scenario disappears from the list.
2. Only checked scenarios are signaled upstream.
Buffer::addSignal()insrc/Buffer.php(line 158) performs a strictin_array()check against thesignal_scenariosconfig value (which stores only the user's checked selections). Unchecked scenarios are logged as ignored and discarded before they reach the buffer or the upstream API.3. Minor gap: no
enablecheck for non-buffered plugins.For buffered plugins (Whisper),
Buffer::bufferSignal()checks the per-pluginenablesetting before entering the leaky-bucket algorithm. However, for non-buffered plugins (Flood, Ban), the code path inScenarioPluginBase::addSignal()goes directly toBuffer::addSignal()without checkingenable. The signal is still filtered by thesignal_scenarioscheck, so no incorrect signals are sent upstream, but unnecessary processing occurs for disabled non-buffered plugins.Conclusion
The core behavior is correct. The only improvement would be adding the
enablecheck for non-buffered plugins inScenarioPluginBase::addSignal()to avoid unnecessary work.Comment #4
jurgenhaas