-
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
[Filebeat] Replace Suricata/Eve fields with aliases to ECS fields #10377
[Filebeat] Replace Suricata/Eve fields with aliases to ECS fields #10377
Conversation
Aliased fields don't seem to be handled in dashboards.
This field cannot be aliased to `message` as we need this data in a keyword field. There is no suitable field for that in ECS.
Pinging @elastic/secops |
Note to reviewers: To review the ingest pipeline it's easier if you look at the changes added in every individual commit in the PR. |
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.
This is almost ready to go. Good work!
I've noticed one missing alias, for url.path. That's the only change required in my review.
I also have one optional suggestion to make the IN code a little more straightforward.
@@ -76,6 +58,7 @@ | |||
"user_agent.major": "7", | |||
"user_agent.minor": "58", | |||
"user_agent.name": "curl", | |||
"user_agent.original": "curl/7.58.0", |
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 catch!
"suricata.eve.timestamp" | ||
], | ||
"ignore_missing": true | ||
} |
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 most of these fields, you could actually get rid of the convert { type: string}
and do a straight field rename. Would look much more like the other modules, and would remove the need to have this huge remove
operation.
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.
You are completely right. There's a lot of cleanup that can be done
"suricata.eve.http.protocol": "HTTP/1.1", | ||
"suricata.eve.http.status": 200, | ||
"suricata.eve.http.url": "/dd.xml", |
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.
suricata.eve.http.url => url.path
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.
I'm not so sure about that one, as we will be losing information if s.e.http.url has query and/or fragment part (those go into url.query and url.fragment).
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.
perhaps then url.original?
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.
Yeah, in this case url.original
should be used. This is for the value as observed.
Then optionally (out of scope here) the other fields could be populated to break it down (url.path, url.query, url.fragment), or rebuild full context (url.full).
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.
Oh, I overlooked url.original. Done!
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 (after addressing review from Mat). I mostly focused on the change in the golden files.
"suricata.eve.flow_id": 2191386088856669, | ||
"suricata.eve.http.hostname": "example.net", | ||
"suricata.eve.http.http_content_type": "text/html", |
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 and the one below could be something for ECS in the future.
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.
Yeah I took a note to add content_type
, when reviewing this PR, indeed :-)
What's the other field you're referring to? The field below is method
LOL. And .hostname
=> .domain
;-)
I initially thought these should not go into the ecs-migration.yml file but now I think it would make sense to add them there. This has two advantages:
|
@ruflin I've updated the ecs-migration.yml, please have a look. I'm unsure if I used the right set of flags. Is there a way to test this migration script? |
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.
I'm good with getting this in as is and have follow up PR's if needed.
"type": "string", | ||
"ignore_missing": true | ||
} | ||
}, | ||
{ | ||
"convert": { | ||
"field": "suricata.eve.http.http_refer", |
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.
This one's straightforward as well. Any reason why you're not renaming it?
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.
Nope, just skipped it by mistake. Good catch
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 as well
One last nit about doing a straight rename for http_refer
.
jenkins, test this |
This PR avoids duplicate data in documents ingested via the Suricata Eve fileset by replacing a few fields with aliases to ECS fields.
This allows to maintain the full set of fields Suricata users may expect while at the same time reducing the size of the events.
The aliased fields are:
@timestamp
Also, the following non-related fixes are performed: