[Filebeat] Replace Suricata/Eve fields with aliases to ECS fields#10377
[Filebeat] Replace Suricata/Eve fields with aliases to ECS fields#10377adriansr merged 10 commits intoelastic:masterfrom
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. |
webmat
left a comment
There was a problem hiding this comment.
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.
| "user_agent.major": "7", | ||
| "user_agent.minor": "58", | ||
| "user_agent.name": "curl", | ||
| "user_agent.original": "curl/7.58.0", |
| "suricata.eve.timestamp" | ||
| ], | ||
| "ignore_missing": true | ||
| } |
There was a problem hiding this comment.
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.
You are completely right. There's a lot of cleanup that can be done
| "suricata.eve.http.length": 1155, | ||
| "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.
suricata.eve.http.url => url.path
There was a problem hiding this comment.
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.
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.
Oh, I overlooked url.original. Done!
ruflin
left a comment
There was a problem hiding this comment.
LGTM (after addressing review from Mat). I mostly focused on the change in the golden files.
| "suricata.eve.flow.pkts_toserver": 4, | ||
| "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.
@webmat This and the one below could be something for ECS in the future.
There was a problem hiding this comment.
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? |
ruflin
left a comment
There was a problem hiding this comment.
I'm good with getting this in as is and have follow up PR's if needed.
| }, | ||
| { | ||
| "convert": { | ||
| "field": "suricata.eve.http.http_refer", |
There was a problem hiding this comment.
This one's straightforward as well. Any reason why you're not renaming it?
There was a problem hiding this comment.
Nope, just skipped it by mistake. Good catch
webmat
left a comment
There was a problem hiding this comment.
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:
@timestampAlso, the following non-related fixes are performed: