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

Added support for intel.log zeek module #14404

Merged
merged 10 commits into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add `index` option to all inputs to directly set a per-input index value. {pull}14010[14010]
- Remove beta flag for some filebeat modules. {pull}14374[14374]
- Add attack_pattern_kql field to MISP threat indicators. {pull}14470[14470]
- Add fileset to the Zeek module for the intel.log. {pull}14404[14404]

*Heartbeat*
- Add non-privileged icmp on linux and darwin(mac). {pull}13795[13795] {issue}11498[11498]
Expand Down
2 changes: 2 additions & 0 deletions x-pack/filebeat/filebeat.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@ filebeat.modules:
enabled: true
http:
enabled: true
intel:
enabled: true
irc:
enabled: true
kerberos:
Expand Down
2 changes: 2 additions & 0 deletions x-pack/filebeat/module/zeek/_meta/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
enabled: true
http:
enabled: true
intel:
enabled: true
irc:
enabled: true
kerberos:
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/zeek/fields.go

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions x-pack/filebeat/module/zeek/intel/_meta/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
- name: intel
type: group
garanews marked this conversation as resolved.
Show resolved Hide resolved
default_field: false
description: >
Fields exported by the Zeek Intel log.
fields:

- name: seen
type: group
fields:
- name: indicator
type: keyword
description: >
The intelligence indicator.

- name: indicator_type
type: keyword
description: >
The type of data the indicator represents.

- name: host
type: keyword
description: >
If the indicator type was Intel::ADDR, then this field will be present.

- name: conn
type: keyword
description: >
If the data was discovered within a connection, the connection record should go here to give context to the data.

- name: where
type: keyword
description: >
Where the data was discovered.

- name: node
type: keyword
description: >
The name of the node where the match was discovered.

- name: uid
type: keyword
description: >
If the data was discovered within a connection, the connection uid should go here to give context to the data. If the conn field is provided, this will be automatically filled out.

- name: fa_file
type: keyword
description: >
If the data was discovered within a file, the file record should go here to provide context to the data.

- name: fuid
type: keyword
description: >
If the data was discovered within a file, the file uid should go here to provide context to the data. If the file record f is provided, this will be automatically filled out.


- name: matched
type: keyword
description: >
Event to represent a match in the intelligence data from data that was seen.

- name: sources
type: keyword
description: >
Sources which supplied data for this match.

- name: fuid
type: keyword
description: >
If a file was associated with this intelligence hit, this is the uid for the file.

- name: file_mime_type
type: keyword
description: >
A mime type if the intelligence hit is related to a file. If the $f field is provided this will be automatically filled out.

- name: file_desc
type: keyword
description: >
Frequently files can be described to give a bit more context. If the $f field is provided this field will be automatically filled out.
33 changes: 33 additions & 0 deletions x-pack/filebeat/module/zeek/intel/config/intel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
type: log
paths:
{{ range $i, $path := .paths }}
- {{$path}}
{{ end }}
exclude_files: [".gz$"]
tags: {{.tags}}

json.keys_under_root: false

processors:
- rename:
fields:
- from: "json"
to: "zeek.intel"

- from: "zeek.intel.uid"
to: "zeek.session_id"

- from: "zeek.intel.id.orig_h"
to: "source.address"

- from: "zeek.intel.id.orig_p"
to: "source.port"

- from: "zeek.intel.id.resp_h"
to: "destination.address"

- from: "zeek.intel.id.resp_p"
to: "destination.port"

ignore_missing: true
fail_on_error: false
104 changes: 104 additions & 0 deletions x-pack/filebeat/module/zeek/intel/ingest/pipeline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"description": "Pipeline for normalizing Zeek intel.log",
"processors": [
{
"script": {
"lang": "painless",
"source": "ctx.event.created = ctx['@timestamp']; ctx['@timestamp'] = (long)ctx['zeek']['intel']['ts'] * 1000; ctx.zeek.intel.remove('ts');"
}
},
{
"set": {
"field": "destination.ip",
"value": "{{destination.address}}",
"if": "ctx.destination?.address != null"
}
},
{
"set": {
"field": "source.ip",
"value": "{{source.address}}",
"if": "ctx.source?.address != null"
}
},
{
"set": {
"field": "event.id",
"value": "{{zeek.session_id}}",
"if": "ctx.zeek.session_id != null"
}
},
{
"geoip": {
"field": "destination.ip",
"target_field": "destination.geo",
"ignore_missing": true
}
},
{
"geoip": {
"field": "source.ip",
"target_field": "source.geo",
"ignore_missing": true
}
},
{
"geoip": {
"database_file": "GeoLite2-ASN.mmdb",
"field": "source.ip",
"target_field": "source.as",
"properties": [
"asn",
"organization_name"
],
"ignore_missing": true
}
},
{
"geoip": {
"database_file": "GeoLite2-ASN.mmdb",
"field": "destination.ip",
"target_field": "destination.as",
"properties": [
"asn",
"organization_name"
],
"ignore_missing": true
}
},
{
"rename": {
"field": "source.as.asn",
"target_field": "source.as.number",
"ignore_missing": true
}
},
{
"rename": {
"field": "source.as.organization_name",
"target_field": "source.as.organization.name",
"ignore_missing": true
}
},
{
"rename": {
"field": "destination.as.asn",
"target_field": "destination.as.number",
"ignore_missing": true
}
},
{
"rename": {
"field": "destination.as.organization_name",
"target_field": "destination.as.organization.name",
"ignore_missing": true
}
}
],
"on_failure" : [{
"set" : {
"field" : "error.message",
"value" : "{{ _ingest.on_failure_message }}"
}
}]
}
21 changes: 21 additions & 0 deletions x-pack/filebeat/module/zeek/intel/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module_version: 1.0

var:
- name: paths
default:
- /var/log/bro/current/intel.log
os.linux:
- /var/log/bro/current/intel.log
os.darwin:
- /usr/local/var/logs/current/intel.log
- name: tags
default: [zeek.intel]
- name: community_id
default: true

ingest_pipeline: ingest/pipeline.json
input: config/intel.yml

requires.processors:
- name: geoip
plugin: ingest-geoip
1 change: 1 addition & 0 deletions x-pack/filebeat/module/zeek/intel/test/intel-json.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ts":1573030980.989353,"uid":"Ctefoj1tgOPt4D0EK2","id.orig_h":"192.168.1.1","id.orig_p":37598,"id.resp_h":"198.41.0.4","id.resp_p":53,"seen.indicator":"198.41.0.4","seen.indicator_type":"Intel::ADDR","seen.where":"Conn::IN_RESP","seen.node":"worker-1-2","matched":["Intel::ADDR"],"sources":["ETPRO Rep: AbusedTLD Score: 127"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[
{
"@timestamp": 1573030980000,
"destination.address": "198.41.0.4",
"destination.as.number": 20431,
"destination.as.organization.name": "VeriSign Global Registry Services",
"destination.geo.continent_name": "North America",
"destination.geo.country_iso_code": "US",
"destination.geo.location.lat": 37.751,
"destination.geo.location.lon": -97.822,
"destination.ip": "198.41.0.4",
"destination.port": 53,
"event.dataset": "zeek.intel",
"event.id": "Ctefoj1tgOPt4D0EK2",
"event.module": "zeek",
"fileset.name": "intel",
"input.type": "log",
"log.offset": 0,
"service.type": "zeek",
"source.address": "192.168.1.1",
"source.ip": "192.168.1.1",
"source.port": 37598,
"tags": [
"zeek.intel"
],
"zeek.intel.matched": [
"Intel::ADDR"
],
"zeek.intel.seen.indicator": "198.41.0.4",
"zeek.intel.seen.indicator_type": "Intel::ADDR",
"zeek.intel.seen.node": "worker-1-2",
"zeek.intel.seen.where": "Conn::IN_RESP",
"zeek.intel.sources": [
"ETPRO Rep: AbusedTLD Score: 127"
],
"zeek.session_id": "Ctefoj1tgOPt4D0EK2"
}
]
2 changes: 2 additions & 0 deletions x-pack/filebeat/modules.d/zeek.yml.disabled
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
enabled: true
http:
enabled: true
intel:
enabled: true
irc:
enabled: true
kerberos:
Expand Down