-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add elastic SIEM integration (#197)
* chore: use update script for logstash alarm output This prevents out-of-order updates from filebeat to siem_alarms index [skip ci] * chore: add example on elastic SIEM integration * docs: add the doc for elastic SIEM integration * docs: also update the list and install doc [skip ci] * remove fields.go from deploments dir
- Loading branch information
1 parent
7d20b11
commit 41fca69
Showing
16 changed files
with
6,537 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
filebeat.config.modules: | ||
path: /usr/share/filebeat/modules.d/*.yml | ||
reload.enabled: false | ||
|
||
output.elasticsearch: | ||
hosts: ["elasticsearch:9200"] | ||
|
||
setup.template.settings: | ||
index.number_of_shards: 1 | ||
index.number_of_replicas: 0 | ||
|
||
setup.template.overwrite: true | ||
setup.template.enabled: true | ||
setup.template.fields: /usr/share/filebeat/fields.yml |
3 changes: 3 additions & 0 deletions
3
deployments/docker/conf/filebeat-es/module/dsiem/_meta/config.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- module: dsiem | ||
alarm: | ||
enabled: true |
47 changes: 47 additions & 0 deletions
47
deployments/docker/conf/filebeat-es/module/dsiem/_meta/docs.asciidoc
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
:modulename: dsiem | ||
:has-dashboards: true | ||
|
||
== dsiem module | ||
|
||
This is the dsiem module. | ||
|
||
include::../include/what-happens.asciidoc[] | ||
|
||
[float] | ||
=== Compatibility | ||
|
||
TODO: document with what versions of the software is this tested | ||
|
||
|
||
include::../include/running-modules.asciidoc[] | ||
|
||
[float] | ||
=== Example dashboard | ||
|
||
This module comes with a sample dashboard. For example: | ||
|
||
TODO: include an image of a sample dashboard. If you do not include a dashboard, | ||
remove this section and set `:has-dashboards: false` at the top of this file. | ||
|
||
include::../include/configuring-intro.asciidoc[] | ||
|
||
TODO: provide an example configuration | ||
|
||
:fileset_ex: {fileset} | ||
|
||
include::../include/config-option-intro.asciidoc[] | ||
|
||
TODO: document the variables from each fileset. If you're describing a variable | ||
that's common to other modules, you can reuse shared descriptions by including | ||
the relevant file. For example: | ||
|
||
[float] | ||
==== `{fileset}` log fileset settings | ||
|
||
include::../include/var-paths.asciidoc[] | ||
|
||
:has-dashboards!: | ||
|
||
:fileset_ex!: | ||
|
||
:modulename!: |
9 changes: 9 additions & 0 deletions
9
deployments/docker/conf/filebeat-es/module/dsiem/_meta/fields.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- key: dsiem | ||
title: "dsiem" | ||
description: > | ||
dsiem Module | ||
fields: | ||
- name: dsiem | ||
type: group | ||
description: > | ||
fields: |
6 changes: 6 additions & 0 deletions
6
deployments/docker/conf/filebeat-es/module/dsiem/alarm/_meta/fields.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- name: alarm | ||
description: dsiem alarm | ||
type: group | ||
fields: | ||
- name: updated_time | ||
type: date |
72 changes: 72 additions & 0 deletions
72
deployments/docker/conf/filebeat-es/module/dsiem/alarm/config/alarm.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
type: log | ||
paths: | ||
{{ range $i, $path := .paths }} | ||
- {{$path}} | ||
{{ end }} | ||
exclude_files: [".gz$"] | ||
|
||
processors: | ||
- rename: | ||
fields: | ||
- {from: message, to: event.original} | ||
- decode_json_fields: | ||
fields: [event.original] | ||
target: dsiem.alarm | ||
process_array: true | ||
max_depth: 2 | ||
- convert: | ||
mode: copy | ||
fields: | ||
- {from: '@timestamp', to: event.created} | ||
- timestamp: | ||
field: dsiem.alarm.created_time | ||
layouts: | ||
- UNIX | ||
test: | ||
- '1571045906' | ||
- timestamp: | ||
field: dsiem.alarm.update_time | ||
target_field: dsiem.alarm.update_time | ||
layouts: | ||
- UNIX | ||
test: | ||
- '1571045906' | ||
- add_fields: | ||
target: event | ||
fields: | ||
kind: 'alarm' | ||
- add_fields: | ||
target: threat | ||
fields: | ||
framework: 'OSSIM Cyber Kill Chain' | ||
- convert: | ||
mode: rename | ||
ignore_missing: true | ||
fields: | ||
- {from: dsiem.alarm.src_ips, to: source.address} | ||
- {from: dsiem.alarm.dst_ips, to: destination.address} | ||
- {from: dsiem.alarm.proto, to: network.transport} | ||
- {from: dsiem.alarm.risk, to: event.risk_score} | ||
- {from: dsiem.alarm.title, to: message} | ||
- {from: dsiem.alarm.kingdom, to: threat.tactic.name} | ||
- {from: dsiem.alarm.category, to: threat.technique.name} | ||
- {from: dsiem.alarm.update_time, to: dsiem.alarm.updated_time} | ||
- convert: | ||
mode: copy | ||
fields: | ||
- {from: dsiem.alarm.alarm_id, to: event.id} | ||
- {from: source.address, to: source.ip} | ||
- {from: destination.address, to: destination.ip} | ||
- drop_fields: | ||
fields: | ||
- dsiem.alarm.created_time | ||
- dsiem.alarm.status | ||
- dsiem.alarm.tag | ||
- dsiem.alarm.src_ips | ||
- dsiem.alarm.dst_ips | ||
- dsiem.alarm.proto | ||
- dsiem.alarm.category | ||
- dsiem.alarm.kingdom | ||
- dsiem.alarm.rules | ||
- dsiem.alarm.title | ||
ignore_missing: true |
11 changes: 11 additions & 0 deletions
11
deployments/docker/conf/filebeat-es/module/dsiem/alarm/ingest/pipeline.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"description": "use dsiem alarm_id as _id", | ||
"processors": [ | ||
{ | ||
"set": { | ||
"field": "_id", | ||
"value": "{{event.id}}" | ||
} | ||
} | ||
] | ||
} |
13 changes: 13 additions & 0 deletions
13
deployments/docker/conf/filebeat-es/module/dsiem/alarm/manifest.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module_version: 1.0 | ||
|
||
var: | ||
- name: paths | ||
default: | ||
- /tmp/siem_alarms.json | ||
os.darwin: | ||
- /var/log/dsiem/siem_alarms.json | ||
os.windows: | ||
- c:/programdata/dsiem/log/siem_alarms.json | ||
|
||
ingest_pipeline: ingest/pipeline.json | ||
input: config/alarm.yml |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dashboards: |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- module: dsiem | ||
alarm: | ||
enabled: true | ||
var.paths: | ||
- /var/log/dsiem/siem_alarms.json |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Elastic SIEM Integration | ||
|
||
Elastic stack 7.2 and newer versions include a [SIEM app in Kibana](https://www.elastic.co/guide/en/kibana/current/xpack-siem.html) that provides an interactive workspace for security teams to triage events and perform initial investigations. | ||
|
||
Integrating Dsiem into the app allows us to analyze Dsiem alarms data in it, and to further correlate those alarms and other compatible log entries such as those coming from Filebeat, Winlogbeat, Auditbeat, and others. | ||
|
||
The following picture shows an example of an Elastic SIEM timeline analyzing potential connection between Dsiem alarms and several auditbeat logs. | ||
|
||
 | ||
|
||
## Dsiem Filebeat Module | ||
|
||
Elastic SIEM app reads data from [Elastic Common Schema - ECS](https://www.elastic.co/guide/en/ecs/current/index.html) compliant documents stored in Elasticsearch indices. | ||
|
||
From a practical stand point, we can transform Dsiem alarms data into ECS format using either a Logstash filter, a Filebeat module, or a dedicated custom Beat. For now we opt to use the Filebeat module approach for its builtin support for ECS fields compared to a Logstash filter, and for its lower maintenance compared to a custom Beat. | ||
|
||
The Docker Compose environment created in the [installation guide](https://github.com/defenxor/dsiem/blob/master/docs/installation.md#using-docker-compose) already has Filebeat module for Dsiem enabled, so you can directly play with it by visiting http://localhost:5601/app/siem#/hosts/events. In that environment, all generated alarms should be visible in both Dsiem web UI and Kibana SIEM app. | ||
|
||
For reference, the Filebeat module for Dsiem files are located [here](https://github.com/defenxor/dsiem/tree/master/deployments/docker/conf/filebeat-es/). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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