fix(socradar): overlap fetch windows to avoid missing late-visible OPEN alarms - #110
Open
Radargoger wants to merge 2 commits into
Open
fix(socradar): overlap fetch windows to avoid missing late-visible OPEN alarms#110Radargoger wants to merge 2 commits into
Radargoger wants to merge 2 commits into
Conversation
…EN alarms - Add configurable `fetch_overlap_seconds` (default 900 / 15 minutes) so each steady-state wodle run re-queries `min(last_run, now - overlap) -> now`, covering SOCRadar API lag after the cursor advances. - Keep inbound dedup on `seen_alarm_ids` (Wazuh does not dedupe by `alarm_id`). - Skip outbound auto-tag / comment when `wazuh-ingested` is already present on the alert payload tags. - Wire the new default into `socradar.conf.template`, `install.sh`, and README (wodle v1.0.3, integration v1.0.2).
Radargoger
force-pushed
the
socradar-fetch-overlap
branch
from
August 20, 2026 19:24
c44ac10 to
26c5abc
Compare
CONTRIBUTING.md requires community-contributed integrations to document original source, adapting party, tested versions, maintainer and support boundary. Replace the single-line Author section with a table covering all five fields.
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.
Description
Update to the existing
integrations/socradarintegration. No new files, no directory changes — 5 modified files, +72/−29.1. Inbound: configurable fetch overlap window (
wodles/socradar.py, 1.0.2 → 1.0.3)The wodle previously used
last_run_epoch → nowas its query window. SOCRadar's API can make an alarm visible slightly after its own creation timestamp, so an alarm created just beforelast_runadvanced could fall outside every subsequent window and never be ingested.Steady-state runs now re-query a trailing window controlled by the new
fetch_overlap_secondskey (default900, range0–86400,0disables), i.e.min(last_run, now - overlap) → now. Duplicates are not re-emitted: the existingseen_alarm_idsstate is consulted on the emit path, so the overlap only recovers alarms that were never seen. First runs are unaffected and still useinitial_lookback_hours.2. Outbound: idempotent tag and comment (
integration/custom-socradar.py, 1.0.1 → 1.0.2)auto_tagandpost_wazuh_contextfired on every alert, so an alarm that re-alerted in Wazuh received duplicatewazuh-ingestedtags and repeated context comments. The integration now checks the alert payload'stagsforwazuh-ingestedand skips both actions when it is already present, logging the skip. Combined with the overlap window above, re-queried alarms no longer generate outbound noise. The docstring version header (which had drifted to1.0.0) is corrected to matchVERSION.3. Configuration and documentation consistency
install.sh: writesfetch_overlap_seconds: 900into the generated/var/ossec/etc/socradar.conf.socradar.conf.template: defaults aligned with the code —fetch_limit50→100(DEFAULT_PAGE_SIZE),max_pages10→null(unlimited, asget_max_pagesalready treated it),max_retry_pages200→25(the code default). Removedauto_comment_on_fetch, which is no longer read anywhere in the integration.README.md: documentsfetch_overlap_secondsand corrects the configuration reference table where it did not match code behaviour (fetch_statusis an optional filter rather than a default,min_severitymaps to the APIseveritiesparam rather than a numeric minimum,lookback_page_sleep_secondsdefaults topage_sleep_seconds,max_retry_pagesalso accepts the legacymax_retry_windowskey).README.md: adds a Provenance and Maintenance section per CONTRIBUTING.md — original source, adapting party, tested versions, maintainer and support boundary — replacing the previous single-line Author section.Checks performed on this change
python3 -m py_compileclean onwodles/socradar.pyandintegration/custom-socradar.py.bash -n install.shclean.socradar.conf.templateparses as valid JSON.Target platform remains Wazuh Manager 4.x (integration previously validated on 4.14.3) with Python 3.6+ and no external packages.
Maintenance
Vendor-maintained by the SOCRadar Integration Team (integrations@socradar.io); see the Provenance and Maintenance section of
integrations/socradar/README.md.