AnalysisType: rule
Filename: crowdstrike_detection_passthrough.py
RuleID: "Crowdstrike.Detection.passthrough"
DisplayName: "Crowdstrike Detection Passthrough"
Enabled: true
Severity: Medium
LogTypes:
- Crowdstrike.DetectionSummary
- Crowdstrike.FDREvent
Tags:
- Crowdstrike
Description: Crowdstrike Falcon has detected malicious activity on a host.
Runbook: Follow the Falcon console link and follow the IR process as needed.
Reference: https://www.crowdstrike.com/blog/tech-center/hunt-threat-activity-falcon-endpoint-protection/
DedupPeriodMinutes: 60
SummaryAttributes:
- p_any_ip_addresses
Tests:
- Name: Low Severity Finding
ExpectedResult: true
Log:
{
"cid": "00000000006e49842267fc5837c4e2fc",
"Technique": "PUP",
"ProcessId": 377077835340488700,
"AgentIdString": "00000000000000000000000000000000",
"Name": "NGAV",
"Hostname": "macbook",
"ProcessStartTime": "2021-09-18 20:38:51Z",
"GrandParentCommandLine": "/sbin/launchd",
"MACAddress": "aa-bb-cc-dd-5a-d2",
"CommandLine": "/Applications/app.app/Contents/MacOS/pup app",
"Objective": "Falcon Detection Method",
"Nonce": 1,
"SHA256String": "00000000009d4244ff0eff80712145e92dfbdc1990483402aca903f70c020e60",
"ExternalApiType": "Event_EppDetectionSummaryEvent",
"PatternDispositionValue": 2176,
"CompositeId": "00000000000000000000000000000000:ind:00000000006e49842267fc5837c4e2fc:222222222222222222-33333-444444",
"Severity": 2,
"PatternDispositionDescription": "Prevention/Quarantine, process was blocked from execution and quarantine was attempted.",
"SeverityName": "Low",
"MD5String": "000000000034829cb7cd82035c444f38",
"EventUUID": "000000000034829cb7cd82035c444f38",
"UserName": "bobert",
"FilePath": "/Applications/app.app/Contents/MacOS/",
"timestamp": "2021-09-18 20:38:52Z",
"ParentCommandLine": "/usr/libexec/runningboardd",
"Description": "This file is classified as Adware/PUP based on its SHA256 hash.",
"LocalIP": "1.1.1.1",
"ProcessEndTime": "1970-01-01 00:00:00Z",
"SHA1String": "0000000000000000000000000000000000000000",
"OriginSourceIpAddress": "",
"GrandParentImageFileName": "/sbin/launchd",
"MachineDomain": "",
"ParentImageFileName": "/usr/libexec/runningboardd",
"FalconHostLink": "https://falcon.us-2.crowdstrike.com/activity/detections/detail/00000000000000000000000000000000/222222222222222222?",
"UTCTimestamp": "2021-09-18 20:38:52Z",
"FileName": "pup app",
"ParentProcessId": 376330001421757630,
"EventType": "Event_ExternalApiEvent",
"CustomerIdString": "00000000006e49842267fc5837c4e2fc",
"Tactic": "Malware",
"SensorId": "00000000000000000000000000000000",
"eid": 118,
"PatternDispositionFlags": "{\n \"BlockingUnsupportedOrDisabled\": false,\n \"BootupSafeguardEnabled\": false,\n \"CriticalProcessDisabled\": false,\n \"Detect\": false,\n \"FsOperationBlocked\": false,\n \"HandleOperationDowngraded\": false,\n \"InddetMask\": false,\n \"Indicator\": false,\n \"KillActionFailed\": false,\n \"KillParent\": false,\n \"KillProcess\": false,\n \"KillSubProcess\": false,\n \"OperationBlocked\": false,\n \"PolicyDisabled\": false,\n \"ProcessBlocked\": true,\n \"QuarantineFile\": true,\n \"QuarantineMachine\": false,\n \"RegistryOperationBlocked\": false,\n \"Rooting\": false,\n \"SensorOnly\": false,\n \"SuspendParent\": false,\n \"SuspendProcess\": false\n}",
}
- Name: Low Severity Finding (FDREvent)
ExpectedResult: true
Log:
{
"aid": "0000000000bcd276ea01d5871c6603b6",
"cid": "0000000000aaf227cb4789ed8a75b3bb",
"Hostname": "hostname.lan",
"event":
{
"AgentIdString": "0000000000bcd276ea01d5871c6603b6",
"CommandLine": "/bin/echo CROWDSTRIKE_SAMPLE_DETECTION",
"Hostname": "hostname.lan",
"CustomerIdString": "0000000000aaf227cb4789ed8a75b3bb",
"Description": "Non-malicious sample detection generated for evaluation purposes.",
"CompositeId": "00000000000000000000000000000000:ind:00000000006e49842267fc5837c4e2fc:222222222222222222-33333-444444",
"Name": "Suspicious Activity",
"EventType": "Event_ExternalApiEvent",
"ExternalApiType": "Event_EppDetectionSummaryEvent",
"FalconHostLink": "https://falcon.us-2.crowdstrike.com/activity/detections/detail/00000000000000000000000000000000/222222222222222222?",
"FileName": "echo",
"FilePath": "/bin/",
"GrandParentCommandLine": "-bash",
"GrandParentImageFileName": "/bin/bash",
"LocalIP": "1.2.3.4",
"MACAddress": "aa-bb-cc-dd-78-81",
"MD5String": "00000000003571b8552527c4a06394be",
"MachineDomain": "",
"Nonce": 1,
"Objective": "N/A",
"OriginSourceIpAddress": "",
"ParentCommandLine": "bash",
"ParentImageFileName": "/bin/bash",
"ParentProcessId": 346017374056168100,
"PatternDispositionDescription": "Detection, standard detection.",
"PatternDispositionFlags":
{
"BootupSafeguardEnabled": false,
"CriticalProcessDisabled": false,
"Detect": false,
"FsOperationBlocked": false,
"InddetMask": false,
"Indicator": false,
"KillParent": false,
"KillProcess": false,
"KillSubProcess": false,
"OperationBlocked": false,
"PolicyDisabled": false,
"ProcessBlocked": false,
"QuarantineFile": false,
"QuarantineMachine": false,
"RegistryOperationBlocked": false,
"Rooting": false,
"SensorOnly": false,
},
"PatternDispositionValue": 0,
"ProcessEndTime": 1616609989,
"ProcessId": 346037607908199600,
"ProcessStartTime": 1616609989,
"SHA1String": "0000000000000000000000000000000000000000",
"SHA256String": "0000000000e347e45c095f5fbc2595afff4b651b500b3a8964c86b56d4bd6b0c",
"SensorId": "0000000000bcd276ea01d5871c6603b6",
"Severity": 2,
"SeverityName": "Low",
"Tactic": "N/A",
"Technique": "N/A",
"UTCTimestamp": 1616609989000,
"UserName": "username",
"cid": "0000000000aaf227cb4789ed8a75b3bb",
"eid": 118,
"timestamp": "2021-03-24T18:19:49Z",
},
"fdr_event_type": "Event_EppDetectionSummaryEvent",
"p_any_domain_names": ["hostname.lan"],
"p_any_md5_hashes":
[
"00000000003571b8552527c4a06394be",
"0000000000aaf227cb4789ed8a75b3bb",
"0000000000bcd276ea01d5871c6603b6",
],
"p_any_sha1_hashes": ["0000000000000000000000000000000000000000"],
"p_any_sha256_hashes":
["0000000000e347e45c095f5fbc2595afff4b651b500b3a8964c86b56d4bd6b0c"],
"p_any_trace_ids":
[
"0000000000aaf227cb4789ed8a75b3bb",
"0000000000bcd276ea01d5871c6603b6",
],
"p_any_usernames": ["russ"],
"p_event_time": "2021-03-24 18:19:49",
"p_log_type": "Crowdstrike.FDREvent",
"p_parse_time": "2023-01-25 13:56:51.82",
"p_row_id": "be33cdd7f1bfdba6f483df811601",
"p_schema_version": 0,
"timestamp": "2021-03-24 18:19:49",
}
- Name: Non-match (FDREvent)
ExpectedResult: false
Log:
{
"cid": "11111111111111111111111111111111",
"CommandLine": "/Applications/app.app/Contents/MacOS/pup app",
"Objective": "Falcon Detection Method",
"Nonce": 1,
"SHA256String": "3333333333333333333333333333333333333333333333333333333333333333",
"event": { "ExternalApiType": "something else" },
"fdr_event_type": "something else",
"PatternDispositionValue": 2176,
"Severity": 2,
"PatternDispositionDescription": "Prevention/Quarantine, process was blocked from execution and quarantine was attempted.",
"SeverityName": "Low",
"MD5String": "33333333333333333333333333333333",
"eid": 118,
}
# ------ paired body: crowdstrike_detection_passthrough.py ------
import uuid
from panther_crowdstrike_fdr_helpers import (
crowdstrike_detection_alert_context,
get_crowdstrike_field,
)
def rule(event):
return (
get_crowdstrike_field(event, "ExternalApiType", default="none")
== "Event_EppDetectionSummaryEvent"
)
def title(event):
return (
f"Crowdstrike Alert ({get_crowdstrike_field(event, 'Technique')}) - "
+ f"{get_crowdstrike_field(event, 'Hostname')}"
+ f"({get_crowdstrike_field(event, 'UserName')})"
)
def alert_context(event):
return crowdstrike_detection_alert_context(event)
def severity(event):
# First, try returning the severity based on the SeverityName
sevname = get_crowdstrike_field(event, "SeverityName").upper()
allowed_values = ("INFO", "LOW", "MEDIUM", "HIGH", "CRITICAL")
if sevname == "INFORMATIONAL":
sevname = "INFO"
if sevname in allowed_values:
return sevname
# Else, fallback on the numerical value, falling back on MEDIUM if we still don't have a value
sevval = get_crowdstrike_field(event, "Severity")
return {1: "INFO", 2: "LOW", 3: "MEDIUM", 4: "HIGH", 5: "CRITICAL", 6: "CRITICAL"}.get(
sevval, "DEFAULT"
)
def dedup(event):
# CompositeId is unique per detection indicator and present in both
# DetectionSummary and FDREvent formats. EventUUID is null in FDREvent,
# which previously caused all detections to share the dedup key "None ".
composite_id = get_crowdstrike_field(event, "CompositeId")
if composite_id:
return composite_id
# Fallback: generate a unique ID so detections never silently merge
return str(uuid.uuid4())