Skip to content

Commit 1dd9d9f

Browse files
tweak
1 parent 59b324f commit 1dd9d9f

File tree

2 files changed

+34
-42
lines changed

2 files changed

+34
-42
lines changed

patterns.sed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ s|%hostname%|{event_data.host.name}|g
99
s|%Image%|{event_data.process.executable}|g
1010
s|%ImageLoaded%|{dll.name}|g
1111
s|%ParentImage%|{event_data.process.parent.executable}|g
12+
s|%TargetFilename%|{event_data.file.name}|g
1213
s|%ParentProcessGuid%|{event_data.process.parent.entity_id}|g
1314
s|%private_ip%|{network.private_ip}|g
1415
s|%ProcessGuid%|{event_data.process.entity_id}|g

playbook/dev/sigma/category/file_event.yaml

Lines changed: 33 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Sigma - Category - file_event
22
id: f1e2a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a6b
33
description: |
4-
Generic investigation playbook for file creation, modification, and deletion events.
4+
Baseline Playbook for process creation events, OS agnostic.
55
File events can indicate persistence mechanisms, data staging, malware drops, or legitimate software operations.
66
type: detection
77
detection_id: ''
@@ -13,9 +13,9 @@ date: 2025-05-29
1313

1414
questions:
1515

16-
- question: What was the exact process execution & file creation that triggered the alert?
16+
- question: What file creation event triggered this alert?
1717
context: |
18-
Understanding the process and command line provides crucial context.
18+
Review the filename, location, and extension to help confirm the legitimacy of the file creation.
1919
answer_sources:
2020
- alert
2121
query: |
@@ -26,17 +26,36 @@ questions:
2626
selection:
2727
document_id|expand: '%document_id%'
2828
condition: selection
29+
fields:
30+
- hostname
31+
- User
32+
- TargetFilename
33+
34+
- question: What process created this file?
35+
context: |
36+
Reviewing the process and command line provides additional context. Pivoting off the ProcessGuid
37+
will show the full process chain leading to the file creation.
38+
answer_sources:
39+
- process_creation
40+
query: |
41+
aggregation: false
42+
logsource:
43+
category: process_creation
44+
detection:
45+
selection:
46+
ProcessGuid|expand: '%ProcessGuid%'
47+
condition: selection
2948
fields:
3049
- hostname
3150
- User
3251
- Image
3352
- CommandLine
34-
- TargetFilename
3553
3654
- question: Is the file location and type expected for the executable?
3755
context: |
38-
Certain executables should only write to specific directories. Unusual locations can indicate malicious activity.
39-
range: -7d
56+
Certain executables should only write to specific directories. Unusual locations can indicate malicious activity. This query
57+
shows the historical pattern of file creation by this executable on this system.
58+
range: -30d
4059
answer_sources:
4160
- file_event
4261
query: |
@@ -108,7 +127,7 @@ questions:
108127
109128
- question: Were any processes spawned from the created file location?
110129
context: |
111-
Execution from newly created files often indicates malware drops or persistence mechanisms.
130+
Execution from newly created files can indicate malware drops or persistence mechanisms.
112131
range: +15m
113132
answer_sources:
114133
- process_creation
@@ -125,31 +144,10 @@ questions:
125144
- Image
126145
- CommandLine
127146
128-
- question: What was the complete process chain leading to this file event?
129-
context: |
130-
Tracing back through parent processes reveals the full execution chain.
131-
range: -10m
132-
answer_sources:
133-
- process_creation
134-
query: |
135-
aggregation: false
136-
logsource:
137-
category: process_creation
138-
detection:
139-
selection:
140-
hostname|expand: '%hostname%'
141-
ProcessGuid|expand: '%ParentProcessGuid%'
142-
condition: selection
143-
fields:
144-
- Image
145-
- CommandLine
146-
- User
147-
- ProcessGuid
148-
149147
- question: Are other hosts showing similar file creation patterns?
150148
context: |
151149
Widespread file creation across multiple systems may indicate deployment, malware spread, or policy changes.
152-
range: +/-30m
150+
range: +/-6h
153151
answer_sources:
154152
- file_event
155153
query: |
@@ -158,7 +156,7 @@ questions:
158156
category: file_event
159157
detection:
160158
selection:
161-
TargetFilename|endswith|expand: '%TargetFilename|basename%'
159+
TargetFilename|contains|expand: '%TargetFilename%'
162160
filter:
163161
hostname|expand: '%hostname%'
164162
condition: selection and not filter
@@ -245,9 +243,9 @@ questions:
245243
- Image
246244
- TargetFilename
247245
248-
- question: Are there related alerts for file-based attacks?
246+
- question: Are there any other alerts associated with this system?
249247
context: |
250-
Other file-related alerts may provide additional context about ongoing campaigns.
248+
Other alerts may provide additional context.
251249
range: -24h
252250
answer_sources:
253251
- alert
@@ -256,16 +254,9 @@ questions:
256254
logsource:
257255
category: alert
258256
detection:
259-
selection_host:
260-
hostname|expand: '%hostname%'
261-
selection_file_alerts:
262-
rule.name|contains:
263-
- 'file'
264-
- 'persistence'
265-
- 'drop'
266-
- 'stage'
267-
- 'exfil'
268-
condition: all of selection_*
257+
selection:
258+
related.ip|expand: '%related_ip%'
259+
condition: selection
269260
fields:
270261
- rule.name
271262
- rule.level

0 commit comments

Comments
 (0)