Repository navigation
Add SOCRadar native alert feeder integration - #7
Open
Radargoger wants to merge 1 commit into
Open
Radargoger wants to merge 1 commit into
Radargoger wants to merge 1 commit into
Conversation
Feeder function that turns SOCRadar Incident API v4 alarms into TheHive alerts, deduplicated on company_id:alarm_id, with severity, mitigation, main/sub type tags, typed non-IOC observables, the full alarm content (credentials redacted, long values shortened) and a link back to SOCRadar. Every field is clipped to TheHive's alert input limits. A feeder URL is static and a run reads one page, so the function stores the next request in a cursor alert and a FilteredEvent notification applies it to the feeder through the TheHive API. One feeder alternates recent passes from the newest alarm seen with an hourly 5-day lookback that catches late-approved alarms. Outdated URLs and lost hops are retried, with a daily health alert after three retries. Includes vendor metadata, logo and a setup guide.
Author
|
@nusantara-self Could you please help me to review our app? |
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.
Summary
Adds a native TheHive alert feeder integration for SOCRadar XTI. It polls the SOCRadar Incident API v4 and creates one TheHive alert per SOCRadar alarm.
integrations/vendors/SOCRadar/thehive/functions/function_Feeder_alertFromSOCRadar.js: feeder function (handle(input, context))integrations/vendors/SOCRadar/use-cases/alert-ingestion.md: setup guide (license, feeder settings, function settings, field mapping, data coverage, troubleshooting)integrations/vendors/SOCRadar/vendor.ymlandassets/logo.png.generated/is untouched and left to the sync workflow.Behavior
sourceRef=<company_id>:<alarm_id>.LOW..CRITICAL→ 1..4), alarm creation date (UTC), main/sub type tags, and anexternalLinkto the alarm in SOCRadar.{key, value}pairs) become typed observables (domain,hostname,url,ip, certificate serials asother) withioc: false. They describe affected assets, not malicious indicators. Brand keywords, DNS record changes, ports and IDs stay in the description so they don't link unrelated alerts.POST /api/v1/alertschema (title 512, sourceRef 128, tags 128, externalLink 4096, description 1 MiB). Observable values over 4096 characters are listed in the description instead. The SOCRadar API doesn't truncate anything.Design: self-paging feeder
SOCRadar alarms can become visible some time after they're created (for example, after analyst approval). They keep their original creation date, and the API returns alarms newest first, at most 100 per request. A feeder URL is static and a run reads one page, so a plain feeder can't page or move a
start_datewindow.The integration therefore pages through TheHive's own components:
limit=100&page=N&start_date=<epoch>&include_total_records=true).socradar-feeder, statusIgnored).FilteredEventnotification on that cursor alert sends the URL toPUT /api/v1/connector/alert-feeder/{name}through an HttpRequest notifier. Updating a feeder runs it immediately, so the next page follows within seconds.One feeder alternates recent passes (alarms since the newest one seen, page after page) with a lookback pass over the last 5 days every 60 minutes. When nothing changes, the URL stays the same, the notification doesn't fire, and the feeder waits for its 5-minute interval.
Other safeguards:
_inquery per 250 alarms instead of onealert.findper alarm (1,000 lookups: 0.45 s instead of 18 s).Testing
Local (Node, mocked
context), 33/33 passing: mapping, dates, deduplication, error handling, field clipping, content truncation, the{key, value}related items, and the paging state machine (initial lookback, pass switching, burst paging, rest without hops, 150 alarms sharing one second,total_pages, outdated URL detection, lost-hop retries and the health alert).Live, TheHive 5.8.0 (Docker, Platinum trial) with a mock SOCRadar API reproducing its sorting, paging and filters, 1-minute feeder and 3-minute lookback interval. After every scenario the chain must reach rest and keep the same cursor for two feeder intervals.
Live, TheHive 5.8.0 with the production SOCRadar API (one company, 287 approved alarms in the last 5 days):
API-Keyheader preserved by the notification templatehostname,url,domain,ipandother, none flagged as IOCscripts/validate-vendor-metadata.py --strictpasses forSOCRadar.generate-catalogs.pyandgenerate-docs.pypick up the vendor, use case and function.Catalog listing request
We'd like SOCRadar to be listed in the TheHive integrations catalog with this use case. Please let us know if you need anything else for the listing, such as a different logo format, screenshots, or a vendor contact.