-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Set event.category and event.kind for Suricata #10882
Set event.category and event.kind for Suricata #10882
Conversation
Pinging @elastic/secops |
aea3464
to
4c380a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good improvement for geoip 👍
I think we should make sure we don't categorize Suricata stats at all, if we're not ready, or perhaps go with my suggestion below.
"value": "event" | ||
"script": { | ||
"lang": "painless", | ||
"source": "def t = ctx.suricata?.eve?.event_type; if (t == \"stats\") {\n ctx['event']['kind'] = \"metric\";\n} else if (t == \"alert\") {\n ctx['event']['kind'] = \"alert\";\n ctx['event']['category'] = \"network_traffic\";\n} else {\n ctx['event']['kind'] = \"event\";\n ctx['event']['category'] = \"network_traffic\";\n}" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the reviewers sake, this is what the code looked like before I made it JSON.
- script:
lang: painless
source: >-
def t = ctx.suricata?.eve?.event_type;
if (t == "stats") {
ctx['event']['kind'] = "metric";
} else if (t == "alert") {
ctx['event']['kind'] = "alert";
ctx['event']['category'] = "network_traffic";
} else {
ctx['event']['kind'] = "event";
ctx['event']['category'] = "network_traffic";
}
@@ -194,7 +199,7 @@ | |||
"ecs.version": "1.0.0-beta2", | |||
"event.dataset": "suricata.eve", | |||
"event.end": "2018-07-05T19:51:23.009Z", | |||
"event.kind": "event", | |||
"event.kind": "metric", | |||
"event.module": "suricata", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@webmat This is metric
now. 👍
Set `event.category: network_traffic`. And conditionally set event.kind based on the `event_type` field. Use `alert` for suricata alerts and `event` for everything else. Also skip geoip if the event has already been enriched (like if the data went through Logstash first).
77521f1
to
f3b893d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the adjustment :-)
Set
event.category: network_traffic
. And conditionally set event.kind based on theevent_type
field. Usealert
for suricata alerts andevent
for everything else.Also skip geoip if the event has already been enriched (like if the data went through Logstash first).