Skip to content

Commit cfb9b98

Browse files
committed
[HOT FIX] v0.1.7-alpha02262019 - Logstash Pipeline
helk-logstash + Added offline plugins file + Updated win security conversion + cleaned process-name filter & process-name-split configs + cleaned process-id filter & proces-id conversion configs + set kafka max poll records to 500 + updated SOURCE_ & TARGET_ field names from process entity to be renamed process_source_ and process_target. Following the basic `entity_context_property` from OSSEM CIM
1 parent 65131b2 commit cfb9b98

16 files changed

+284
-266
lines changed

docker/helk-logstash/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ LABEL maintainer="Roberto Rodriguez @Cyb3rWard0g"
1111
LABEL description="Dockerfile base for the HELK Logstash."
1212

1313
RUN mv /usr/share/logstash/config/logstash.yml /usr/share/logstash/config/logstash.yml.backup
14-
COPY --chown=logstash:logstash config/logstash.yml /usr/share/logstash/config/logstash.yml
14+
COPY --chown=logstash:logstash config/logstash.yml /usr/share/logstash/config/logstash.yml
15+
COPY --chown=logstash:logstash plugins/logstash-offline-plugins-6.6.1.zip /usr/share/logstash/logstash-offline-plugins-6.6.1.zip

docker/helk-logstash/pipeline/0002-kafka-input.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ input {
2020
session_timeout_ms => "30000"
2121
max_poll_interval_ms => "300000"
2222
#############################
23-
max_poll_records => "250"
23+
max_poll_records => "500"
2424
}
2525
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# HELK process-name-filter filter conf
2+
# HELK build Stage: Alpha
3+
# Author: Roberto Rodriguez (@Cyb3rWard0g)
4+
# License: GPL-3.0
5+
6+
filter {
7+
if [event_id] {
8+
if [Image] {
9+
mutate { add_field => { "z_logstash_pipeline" => "1523_1" } }
10+
mutate { rename => { "Image" => "process_path" } }
11+
}
12+
if [Application] {
13+
mutate { add_field => { "z_logstash_pipeline" => "1523_2" } }
14+
mutate { rename => { "Application" => "process_path" } }
15+
}
16+
if [NewProcessName] {
17+
mutate { add_field => { "z_logstash_pipeline" => "1523_3" } }
18+
mutate { rename => { "NewProcessName" => "process_path" } }
19+
}
20+
if [ProcessName] {
21+
mutate { add_field => { "z_logstash_pipeline" => "1523_4" } }
22+
mutate { rename => { "ProcessName" => "process_path" }}
23+
}
24+
if [ParentProcessName] {
25+
mutate { add_field => { "z_logstash_pipeline" => "1523_5" } }
26+
mutate { rename => { "ParentProcessName" => "process_parent_path" } }
27+
}
28+
if [ParentImage] {
29+
mutate { add_field => { "z_logstash_pipeline" => "1523_6" } }
30+
mutate { rename => { "ParentImage" => "process_parent_path" } }
31+
}
32+
if [TargetImage] {
33+
mutate { add_field => { "z_logstash_pipeline" => "1523_7" } }
34+
mutate { rename => { "TargetImage" => "process_target_path" } }
35+
}
36+
if [SourceImage] {
37+
mutate { add_field => { "z_logstash_pipeline" => "1523_8" } }
38+
mutate { rename => { "SourceImage" => "process_path" } }
39+
}
40+
if [ProdessName] {
41+
mutate { rename => { "ProdessName" => "process_path" } }
42+
}
43+
}
44+
}

docker/helk-logstash/pipeline/1523-winevent-process-name-split.conf

Lines changed: 0 additions & 102 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# HELK process-ids filter conf
2+
# HELK build Stage: Alpha
3+
# Author: Roberto Rodriguez (@Cyb3rWard0g)
4+
# License: GPL-3.0
5+
6+
filter {
7+
if [event_id] {
8+
if [ProcessId] {
9+
mutate { add_field => { "z_logstash_pipeline" => "1524_2" } }
10+
mutate { rename => { "ProcessId" => "process_id" } }
11+
}
12+
if [NewProcessId] {
13+
mutate { add_field => { "z_logstash_pipeline" => "1524_3" } }
14+
mutate { rename => { "NewProcessId" => "process_id" } }
15+
}
16+
if [ParentProcessId] {
17+
mutate { add_field => { "z_logstash_pipeline" => "1524_5" } }
18+
mutate { rename => { "ParentProcessId" => "process_parent_id" } }
19+
}
20+
if [ProcessGuid] {
21+
mutate { add_field => { "z_logstash_pipeline" => "1524_6" } }
22+
mutate { rename => { "ProcessGuid" => "process_guid" } }
23+
}
24+
if [ParentProcessGuid] {
25+
mutate { add_field => { "z_logstash_pipeline" => "1524_7" } }
26+
mutate { rename => { "ParentProcessGuid" => "process_parent_guid" } }
27+
}
28+
if [SourceProcessGuid] {
29+
mutate { add_field => { "z_logstash_pipeline" => "1524_8" } }
30+
mutate { rename => { "SourceProcessGuid" => "process_guid" } }
31+
}
32+
if [SourceProcessGUID] {
33+
mutate { add_field => { "z_logstash_pipeline" => "1524_9" } }
34+
mutate { rename => { "SourceProcessGUID" => "process_guid" } }
35+
}
36+
if [SourceProcessId] {
37+
mutate { add_field => { "z_logstash_pipeline" => "1524_11" } }
38+
mutate { rename => { "SourceProcessId" => "process_id" } }
39+
}
40+
if [TargetProcessGuid] {
41+
mutate { add_field => { "z_logstash_pipeline" => "1524_12" } }
42+
mutate { rename => { "TargetProcessGuid" => "process_target_guid" } }
43+
}
44+
if [TargetProcessGUID] {
45+
mutate { add_field => { "z_logstash_pipeline" => "1524_13" } }
46+
mutate { rename => { "TargetProcessGUID" => "process_target_guid" } }
47+
}
48+
if [TargetProcessId] {
49+
mutate { add_field => { "z_logstash_pipeline" => "1524_15" } }
50+
mutate { rename => { "TargetProcessId" => "process_target_id" } }
51+
}
52+
}
53+
}

docker/helk-logstash/pipeline/1531-winevent-sysmon-filter.conf

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,10 @@ filter {
2020
source => "RuleName"
2121
field_split => ","
2222
value_split => "="
23-
prefix => "mitre_"
23+
prefix => "rule_"
2424
transform_key => "lowercase"
2525
}
2626
}
27-
if [Image] {
28-
mutate {
29-
rename => {
30-
"Image" => "process_path"
31-
"ProcessGuid" => "process_guid"
32-
"ProcessId" => "process_id"
33-
}
34-
}
35-
}
3627
if [Hashes] {
3728
kv {
3829
source => "Hashes"
@@ -42,18 +33,6 @@ filter {
4233
transform_key => "lowercase"
4334
}
4435
}
45-
if [TargetImage] {
46-
mutate {
47-
rename => {
48-
"SourceImage" => "process_path"
49-
"SourceProcessGUID" => "process_guid"
50-
"SourceProcessId" => "process_id"
51-
"TargetImage" => "target_process_path"
52-
"TargetProcessGUID" => "target_process_guid"
53-
"TargetProcessId" => "target_process_id"
54-
}
55-
}
56-
}
5736
if [User] {
5837
grok {
5938
match => { "User" => "%{GREEDYDATA:user_domain}\\%{GREEDYDATA:user_name}" }
@@ -66,13 +45,10 @@ filter {
6645
rename => {
6746
"CommandLine" => "process_command_line"
6847
"CurrentDirectory" => "process_current_directory"
69-
"ParentImage" => "process_parent_path"
7048
"ParentCommandLine" => "process_parent_command_line"
7149
"IntegrityLevel" => "process_integrity_level"
7250
"LogonGuid" => "user_logon_guid"
7351
"LogonId" => "user_logon_id"
74-
"ParentProcessGuid" => "process_parent_guid"
75-
"ParentProcessId" => "process_parent_id"
7652
"TerminalSessionId" => "user_session_id"
7753
"FileVersion" => "file_version"
7854
"Description" => "file_description"
@@ -238,7 +214,7 @@ filter {
238214
date {
239215
timezone => "UTC"
240216
match => [ "CreationUtcTime", "YYYY-MM-dd HH:mm:ss.SSS" ]
241-
target => "@date_creation"
217+
target => "@file_date_creation"
242218
tag_on_failure => [ "_sysmon_CreationUtcTime_datefailure", "_sysmon_datefailure", "_dateparsefailure" ]
243219
}
244220
date {

0 commit comments

Comments
 (0)