forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add decode_cef processor to Filebeat (elastic#13264)
This adds a decode_cef processor that decodes Common Event Format (CEF) messages. It is expected to be used in conjunction with the syslog input. The processor turns messages like "CEF:0|Trend Micro|Deep Security Manager|1.2.3|600|User Signed In|3|src=10.52.116.160 suser=admin target=admin msg=User signed in from 2001:db8::5" into { "cef": { "device": { "event_class_id": "600", "product": "Deep Security Manager", "vendor": "Trend Micro", "version": "1.2.3" }, "extensions": { "message": "User signed in from 2001:db8::5", "sourceAddress": "10.52.116.160", "sourceUserName": "admin", "target": "admin" }, "name": "User Signed In", "severity": "3", "version": 0 }, "message": "User signed in from 2001:db8::5", "source": { "ip": "10.52.116.160", "user": { "name": "admin" } } } The processor is built on top a CEF parser implemented using Ragel. The parser is a self contained Go package that's responsible for parsing the CEF message and optionally translating the standard short CEF extension names to their full names (e.g. src -> sourceAddress). The processor uses the parser to get the data in a structured format, and then translates the extensions fields to ECS fields via copy. By copying rather than moving the original CEF fields are left intact. The parser tries to be lenient in some aspects compared to the CEF specification. - Extension key names can start with [a-zA-Z0-9_] and in addition contain dots (.), commas (,), left-brackets ([), and right-brackets (]). - If an extension value contains an illegal unescaped equals sign, then the parser will attempt to jump the start of the next extension key can and continue parsing. It will return an error about this because it's possible that rest of the extensions may have been parsed incorrectly. This is a benchmark of the cef parser package. BenchmarkEventUnpack-12 20000000 771 ns/op 498 B/op 16 allocs/op
- Loading branch information
1 parent
ebdc4c2
commit f9c8390
Showing
27 changed files
with
3,995 additions
and
5 deletions.
There are no files selected for viewing
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,70 @@ | ||
- key: cef | ||
title: Decode CEF processor fields | ||
description: > | ||
Common Event Format (CEF) data. | ||
fields: | ||
- name: cef | ||
type: group | ||
description: > | ||
By default the `decode_cef` processor writes all data from the CEF | ||
message to this `cef` object. It contains the CEF header fields and the | ||
extension data. | ||
fields: | ||
- name: version | ||
type: keyword | ||
description: > | ||
Version of the CEF specification used by the message. | ||
- name: device.vendor | ||
type: keyword | ||
description: > | ||
Vendor of the device that produced the message. | ||
- name: device.product | ||
type: keyword | ||
description: > | ||
Product of the device that produced the message. | ||
- name: device.version | ||
type: keyword | ||
description: > | ||
Version of the product that produced the message. | ||
- name: device.event_class_id | ||
type: keyword | ||
description: > | ||
Unique identifier of the event type. | ||
- name: severity | ||
type: keyword | ||
example: Very-High | ||
description: > | ||
Importance of the event. The valid string values are Unknown, Low, | ||
Medium, High, and Very-High. The valid integer values are 0-3=Low, | ||
4-6=Medium, 7- 8=High, and 9-10=Very-High. | ||
- name: name | ||
type: keyword | ||
description: > | ||
Short description of the event. | ||
- name: extensions | ||
type: object | ||
object_type: keyword | ||
description: > | ||
Collection of key-value pairs carried in the CEF extension field. | ||
- name: observer.product | ||
type: keyword | ||
description: | ||
Product name. | ||
|
||
- name: source.service.name | ||
type: keyword | ||
description: | ||
Service that is the source of the event. | ||
|
||
- name: destination.service.name | ||
type: keyword | ||
description: | ||
Service that is the target of the event. |
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,2 @@ | ||
cef.svg | ||
*.dot |
Oops, something went wrong.