Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Zeek] Add additional data sets #3340

Merged
merged 12 commits into from
Jun 28, 2022
6 changes: 6 additions & 0 deletions packages/zeek/_dev/build/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ contains kerberos data.

{{fields "kerberos"}}

### known_certs
legoguy1000 marked this conversation as resolved.
Show resolved Hide resolved

The `known_certs` dataset captures information about SSL/TLS certificates seen on the local network.
legoguy1000 marked this conversation as resolved.
Show resolved Hide resolved

{{fields "known_certs"}}

### known_hosts
legoguy1000 marked this conversation as resolved.
Show resolved Hide resolved

The `known_hosts` dataset captures information about SSL/TLS certificates seen on the local network.
legoguy1000 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fields:
"@timestamp": "2020-04-28T11:07:58.223Z"
tags:
- preserve_original_event
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{"ts":"2021-01-03T01:19:26.260073Z","host":"192.168.4.25"}
{"ts":"2021-01-03T01:19:27.353353Z","host":"192.168.4.29"}
{"ts":"2021-01-03T01:19:32.488179Z","host":"192.168.4.43"}
{"ts":"2021-01-03T01:19:58.792683Z","host":"192.168.4.142"}
{"ts":"2021-01-03T12:17:22.496004Z","host":"192.168.4.115"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"expected": [
{
"@timestamp": "2021-01-03T01:19:26.260Z",
"ecs": {
"version": "8.2.0"
},
"event": {
"category": "network",
"created": "2020-04-28T11:07:58.223Z",
"kind": "info",
"original": "{\"ts\":\"2021-01-03T01:19:26.260073Z\",\"host\":\"192.168.4.25\"}"
},
"host": {
"ip": "192.168.4.25"
},
"network": {
"type": "ipv4"
},
"related": {
"ip": [
"192.168.4.25"
]
},
"tags": [
"preserve_original_event"
]
},
{
"@timestamp": "2021-01-03T01:19:27.353Z",
"ecs": {
"version": "8.2.0"
},
"event": {
"category": "network",
"created": "2020-04-28T11:07:58.223Z",
"kind": "info",
"original": "{\"ts\":\"2021-01-03T01:19:27.353353Z\",\"host\":\"192.168.4.29\"}"
},
"host": {
"ip": "192.168.4.29"
},
"network": {
"type": "ipv4"
},
"related": {
"ip": [
"192.168.4.29"
]
},
"tags": [
"preserve_original_event"
]
},
{
"@timestamp": "2021-01-03T01:19:32.488Z",
"ecs": {
"version": "8.2.0"
},
"event": {
"category": "network",
"created": "2020-04-28T11:07:58.223Z",
"kind": "info",
"original": "{\"ts\":\"2021-01-03T01:19:32.488179Z\",\"host\":\"192.168.4.43\"}"
},
"host": {
"ip": "192.168.4.43"
},
"network": {
"type": "ipv4"
},
"related": {
"ip": [
"192.168.4.43"
]
},
"tags": [
"preserve_original_event"
]
},
{
"@timestamp": "2021-01-03T01:19:58.792Z",
"ecs": {
"version": "8.2.0"
},
"event": {
"category": "network",
"created": "2020-04-28T11:07:58.223Z",
"kind": "info",
"original": "{\"ts\":\"2021-01-03T01:19:58.792683Z\",\"host\":\"192.168.4.142\"}"
},
"host": {
"ip": "192.168.4.142"
},
"network": {
"type": "ipv4"
},
"related": {
"ip": [
"192.168.4.142"
]
},
"tags": [
"preserve_original_event"
]
},
{
"@timestamp": "2021-01-03T12:17:22.496Z",
"ecs": {
"version": "8.2.0"
},
"event": {
"category": "network",
"created": "2020-04-28T11:07:58.223Z",
"kind": "info",
"original": "{\"ts\":\"2021-01-03T12:17:22.496004Z\",\"host\":\"192.168.4.115\"}"
},
"host": {
"ip": "192.168.4.115"
},
"network": {
"type": "ipv4"
},
"related": {
"ip": [
"192.168.4.115"
]
},
"tags": [
"preserve_original_event"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
vars:
base_paths:
- "{{SERVICE_LOGS_DIR}}"
input: logfile
data_stream:
vars: ~
legoguy1000 marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 21 additions & 0 deletions packages/zeek/data_stream/known_hosts/agent/stream/log.yml.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
paths:
{{#each base_paths}}
{{#each ../filenames}}
- {{../this}}/{{this}}
{{/each}}
{{/each}}
exclude_files: [".gz$"]
tags:
{{#if preserve_original_event}}
- preserve_original_event
{{/if}}
{{#each tags as |tag i|}}
- {{tag}}
{{/each}}
{{#contains "forwarded" tags}}
publisher_pipeline.disable_host: true
{{/contains}}
{{#if processors}}
processors:
{{processors}}
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
description: Pipeline for normalizing Zeek conn.log
processors:
- rename:
field: message
target_field: event.original
- json:
field: event.original
target_field: json
- drop:
description: Drop if no timestamp (invalid json)
if: 'ctx?.json?.ts == null'

# Sets event.created from the @timestamp field generated by filebeat before being overwritten further down
- set:
field: event.created
copy_from: "@timestamp"
- set:
field: ecs.version
value: '8.2.0'
- set:
field: event.kind
value: info
- set:
field: event.category
value: network
- date:
field: json.ts
formats:
- UNIX
- ISO8601
- rename:
field: json.host
target_field: host.ip
ignore_missing: true
- set:
field: network.type
value: ipv4
if: ctx.host?.ip.contains('.')
- set:
field: network.type
value: ipv6
if: ctx.host?.ip.contains(':')
- append:
field: related.ip
value: "{{host.ip}}"
if: ctx?.host?.ip != null
allow_duplicates: false
- geoip:
field: host.ip
target_field: host.geo
ignore_missing: true
- remove:
field:
- json
ignore_missing: true
- remove:
field: event.original
if: "ctx?.tags == null || !(ctx.tags.contains('preserve_original_event'))"
ignore_failure: true
ignore_missing: true
on_failure:
- set:
field: error.message
value: "{{ _ingest.on_failure_message }}"
Loading