feat(harfanglab): split image_name into the process path and the threat name (v1.4.1)
image_name was left unmapped because HarfangLab prefixes it with the matched threat name — "[PUADlManager:Win32/OfferCore] C:\Windows\ explorer.exe" — and the clean path was available from the event data. That reasoning only held for event-log alerts. On the yara, binary and ioc subtypes there is neither a `process` object nor an `eventlog` block, so those alerts reached the incident with no process at all. Both halves are now pulled out, each guarded on the bracket actually being there: $substringBefore and $substringAfter return the whole string when the pattern is absent, so without the guard an unprefixed path would land verbatim in malware.name. The three entries lead the process block so the more specific sources below — the matched process object, then the event log's own fields — still overwrite them when present. malware.name consequently surfaces on every subtype instead of only where Defender is the source. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
id: harfanglab
|
id: harfanglab
|
||||||
name: HarfangLab EDR
|
name: HarfangLab EDR
|
||||||
version: 1.4.0
|
version: 1.4.1
|
||||||
description: "HarfangLab EDR — endpoint detection & response: alert/threat ingestion, endpoint enrichment, isolation, threat-intelligence (IOC/whitelist), telemetry hunting and forensic collection jobs."
|
description: "HarfangLab EDR — endpoint detection & response: alert/threat ingestion, endpoint enrichment, isolation, threat-intelligence (IOC/whitelist), telemetry hunting and forensic collection jobs."
|
||||||
changelog: "1.4.0 — Mapper coverage from real payloads: get_alerts now maps the Windows event-log payload sigma alerts carry (alert_subtype = eventlog), which was entirely unmapped — Defender 1116/1117 yields the malware name, classification, severity and provider, the detected file, the process that touched it and the acting user, plus the log provider and event code. Also added the agent IP, DNS domain, device type, agent version and groups, the tenant, the alert subtype and threat type, the string severity and the event time. get_threats gained the threat level (previously never reaching the OCSF document at all), the event time and the top agent's reachability. 1.3.1 — Flagged get_alerts as ingestion-ready (ingest hints: results_path/dedup/incremental on from_date) so it appears in the recommended ingestion commands when creating an instance. 1.3.0 — Response & triage expansion: kill/dump process, on-demand AV/YARA scans, file/service/scheduled-task deletion, quarantine management, threat-level isolation, job cancel/relaunch/wait; alert search (get_alerts) and full alert/threat triage (tag, comments, notes, status, level, history, details); exhaustive alert OCSF mappers; reworked get_threats mapper (fixed MITRE tactics map handling, full top-agent/user/rule and counts coverage, rule-based incident title/description). 1.2.2 — Documentation wording cleanup. 1.2.1 — Corrected the get_threats OCSF mapper to native threat fields (top_agents/top_impacted_users/top_rules/mitre_tactics) instead of enriched-only arrays; added agent.osversion to get_security_events. 1.2.0 — Added ingestion commands get_security_events (alerts) and get_threats with bundled OCSF mappers and ingest hints (results_path/dedup/incremental). 1.1.1 — Added test_connection for the instance Test button. 1.1.0 — Command names prefixed with 'harfanglab-' (e.g. harfanglab-isolate-endpoint) for easier toolbox search; command IDs unchanged. 1.0.0 — Initial release: endpoint/agent management, isolation, policy assignment, IOC & whitelist management, security-event triage, telemetry hunting (processes, network, DNS, authentications, binaries, event logs), threat hunting by hash, and forensic collection jobs (pipes, prefetch, run keys, scheduled tasks, drivers, services, processes, network, sessions, WMI, IOC scan, artifacts, RAM dump) with their result retrieval commands. Compatible with HarfangLab EDR 2.13.7+."
|
changelog: "1.4.1 — get_alerts now maps image_name, the one process path present on every alert subtype and the only one on those carrying neither a process object nor an event log (yara, binary, ioc). HarfangLab prefixes it with the matched threat name in brackets, so both halves are split out: the clean path feeds actor.process.file.path and its basename actor.process.name, and the threat name feeds malware.name — which now surfaces on every subtype rather than only on Defender event-log detections. Each half is guarded on the bracket being present so an unprefixed path is never written into malware.name. 1.4.0 — Mapper coverage from real payloads: get_alerts now maps the Windows event-log payload sigma alerts carry (alert_subtype = eventlog), which was entirely unmapped — Defender 1116/1117 yields the malware name, classification, severity and provider, the detected file, the process that touched it and the acting user, plus the log provider and event code. Also added the agent IP, DNS domain, device type, agent version and groups, the tenant, the alert subtype and threat type, the string severity and the event time. get_threats gained the threat level (previously never reaching the OCSF document at all), the event time and the top agent's reachability. 1.3.1 — Flagged get_alerts as ingestion-ready (ingest hints: results_path/dedup/incremental on from_date) so it appears in the recommended ingestion commands when creating an instance. 1.3.0 — Response & triage expansion: kill/dump process, on-demand AV/YARA scans, file/service/scheduled-task deletion, quarantine management, threat-level isolation, job cancel/relaunch/wait; alert search (get_alerts) and full alert/threat triage (tag, comments, notes, status, level, history, details); exhaustive alert OCSF mappers; reworked get_threats mapper (fixed MITRE tactics map handling, full top-agent/user/rule and counts coverage, rule-based incident title/description). 1.2.2 — Documentation wording cleanup. 1.2.1 — Corrected the get_threats OCSF mapper to native threat fields (top_agents/top_impacted_users/top_rules/mitre_tactics) instead of enriched-only arrays; added agent.osversion to get_security_events. 1.2.0 — Added ingestion commands get_security_events (alerts) and get_threats with bundled OCSF mappers and ingest hints (results_path/dedup/incremental). 1.1.1 — Added test_connection for the instance Test button. 1.1.0 — Command names prefixed with 'harfanglab-' (e.g. harfanglab-isolate-endpoint) for easier toolbox search; command IDs unchanged. 1.0.0 — Initial release: endpoint/agent management, isolation, policy assignment, IOC & whitelist management, security-event triage, telemetry hunting (processes, network, DNS, authentications, binaries, event logs), threat hunting by hash, and forensic collection jobs (pipes, prefetch, run keys, scheduled tasks, drivers, services, processes, network, sessions, WMI, IOC scan, artifacts, RAM dump) with their result retrieval commands. Compatible with HarfangLab EDR 2.13.7+."
|
||||||
category: endpoint
|
category: endpoint
|
||||||
|
|
||||||
# Per-instance configuration. Scripts use <url> as the API base and call /api/... paths.
|
# Per-instance configuration. Scripts use <url> as the API base and call /api/... paths.
|
||||||
|
|||||||
@@ -51,6 +51,18 @@ ocsf:
|
|||||||
- { source_path: "tags", ocsf_field: "metadata.labels" }
|
- { source_path: "tags", ocsf_field: "metadata.labels" }
|
||||||
- { source_path: "log_type", ocsf_field: "metadata.log_name" }
|
- { source_path: "log_type", ocsf_field: "metadata.log_name" }
|
||||||
# ── Matched process — the actor ───────────────────────────────────
|
# ── Matched process — the actor ───────────────────────────────────
|
||||||
|
# image_name is the one process path present on EVERY alert subtype, and the
|
||||||
|
# only one on those carrying neither a `process` object nor an event log. When
|
||||||
|
# a threat matched, HarfangLab prefixes it with the threat name in brackets —
|
||||||
|
# "[PUADlManager:Win32/OfferCore] C:\Windows\explorer.exe" — so both halves are
|
||||||
|
# pulled out, each guarded on the bracket actually being there: without the
|
||||||
|
# $contains guard, $substringBefore/$substringAfter fall through on an
|
||||||
|
# unprefixed path and write the whole path into malware.name.
|
||||||
|
# These come first in the block so the more specific sources below (the matched
|
||||||
|
# process object, then the event log's own fields) overwrite them when present.
|
||||||
|
- { source_path: "$contains(image_name, '] ') ? $substringAfter(image_name, '] ') : image_name", ocsf_field: "actor.process.file.path" }
|
||||||
|
- { source_path: "$split($contains(image_name, '] ') ? $substringAfter(image_name, '] ') : image_name, '\\\\')[-1]", ocsf_field: "actor.process.name" }
|
||||||
|
- { source_path: "$contains(image_name, '[') ? $substringBefore($substringAfter(image_name, '['), ']')", ocsf_field: "malware.name" }
|
||||||
- { source_path: "process.process_name", ocsf_field: "actor.process.name" }
|
- { source_path: "process.process_name", ocsf_field: "actor.process.name" }
|
||||||
- { source_path: "process.image_name", ocsf_field: "actor.process.file.path" }
|
- { source_path: "process.image_name", ocsf_field: "actor.process.file.path" }
|
||||||
- { source_path: "process.commandline", ocsf_field: "actor.process.cmd_line" }
|
- { source_path: "process.commandline", ocsf_field: "actor.process.cmd_line" }
|
||||||
@@ -113,8 +125,8 @@ ocsf:
|
|||||||
- { source_path: "eventlog.event_data.`Security intelligence Version`", ocsf_field: "unmapped.defender.signature_version" }
|
- { source_path: "eventlog.event_data.`Security intelligence Version`", ocsf_field: "unmapped.defender.signature_version" }
|
||||||
# Alert fields deliberately left unmapped: `username` (actor.user.name is taken by the
|
# Alert fields deliberately left unmapped: `username` (actor.user.name is taken by the
|
||||||
# more specific process.username), remaining details_* sub-objects (no clean OCSF home),
|
# more specific process.username), remaining details_* sub-objects (no clean OCSF home),
|
||||||
# `image_name` and eventlog.threat_process_name (both prefixed with the threat name —
|
# eventlog.threat_process_name (the same prefixed string as image_name, already split
|
||||||
# the clean path comes from the event data), `eventlog.user` (the account that WROTE the
|
# above), `eventlog.user` (the account that WROTE the
|
||||||
# record, usually SYSTEM — indexing it would create a junk user entity),
|
# record, usually SYSTEM — indexing it would create a junk user entity),
|
||||||
# `eventlog.computer_name` (the FQDN of the host already carried by agent.hostname; two
|
# `eventlog.computer_name` (the FQDN of the host already carried by agent.hostname; two
|
||||||
# spellings of one machine split correlation), `level_int` / `quarantine` / `execution`
|
# spellings of one machine split correlation), `level_int` / `quarantine` / `execution`
|
||||||
|
|||||||
Reference in New Issue
Block a user