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

Rename source_ecs to source #8983

Merged
merged 3 commits into from
Nov 9, 2018

Conversation

andrewkroh
Copy link
Member

Update Suricata module to use source instead of source_ecs now that the Filebeat source
field has been changed. This updates libbeat/_meta/fields.ecs.yml to include the ECS
source.* fields.

This updates the dashboards and visualizations to use the new source fields. And I also updated
the saved searches to use event.module instead of fileset.module.

@andrewkroh andrewkroh force-pushed the feature/fb/rename-source_ecs branch from ad51a65 to 93d9d6c Compare November 7, 2018 23:16
Update Suricata module to use `source` instead of `source_ecs` now that the Filebeat source
field has been changed. This updates `libbeat/_meta/fields.ecs.yml` to include the ECS
`source.*` fields.

This updates the dashboards and visualizations to use the new `source` fields. And I also updated
the saved searches to use `event.module` instead of `fileset.module`.

Remove source.ip, source,port, and source.hostname from auditbeat's auditd module fields.
Remove source.ip, source.port, and source.mac from packetbeat's flow fields.
@andrewkroh andrewkroh force-pushed the feature/fb/rename-source_ecs branch from 93d9d6c to 3eb2749 Compare November 8, 2018 00:38

Can be one or multiple IPv4 or IPv6 addresses.

- name: hostname
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andrewkroh @webmat This does not exist anymore in ECS. Do we need it for suricata? Can you two sync up?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ECS fields I used are stale because I moved this source definition from filebeat to libbeat, rather than getting an entirely new copy from elastic/ecs. We should do a full update in a separate PR (we have to verify that any fields removed from ECS are still accounted for elsewhere in fields.yml files when we do this).

Auditbeat had source.hostname in its fields.yml, so I had to remove it because it was now duplicated. I think Auditbeat uses source.hostname in cases where the SSH daemon reports both the remote client's IP and the reverse DNS name of that IP.

We can proceed with a rename in Auditbeat or a change ECS. Similarly we are using source.geo.* which is not in ECS.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, geo is a reuseable object, and source and destination are both expected places where geo can be nested. The template.json doesn't reflect it yet, but the official spec is the readme :-)

So source.geo.* is perfectly ECS compliant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that source.hostname should be replaced by source.domain. Same goes for destination.hostname.

If you want to store an ambiguous value as well, before determining if it's a hostname or an IP, ECS no longer has a field for this (at least for now). You may store it in a custom field, or you may add logic to save to .ip only when it's an IP, or save to .domain when it's a hostname/domain.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll update Auditbeat to send source.domain instead of source.hostname.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the source.hostname and destination.hostname fields. And I added the source.geo.* and destination.geo.*.

I reverted the changes to Auditbeat's mapping w.r.t. source.hostname as I will do that in an independent PR since it's separate change.

@@ -272,7 +272,7 @@
"alias": null,
"disabled": false,
"index": "filebeat-*",
"key": "fileset.module",
"key": "event.module",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should update the dashboards here as I planned to this in bulk. Like this we have some dashboards converted but not all. But not sure if it will have an affect on the migration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to update them to test my UI changes, but I could undo these lines. However if the bulk migration just does a find/replace on fileset.module this won't be a problem. I'm in favor of leaving it as is, but I'll follow your direction.

"source_ecs.ip": "192.168.1.146",
"source_ecs.port": 52340,
"source.ip": "192.168.1.146",
"source.port": 52340,
"suricata.eve.alert.action": "allowed",
"suricata.eve.alert.category": "Not Suspicious Traffic",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tsg category ;-)

@webmat webmat added the ecs label Nov 8, 2018
Copy link
Contributor

@webmat webmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall.

I'd just make sure to get rid of source.hostname and destination.hostname.

I don't have a strong opinion on whether or not to rename fileset.module now vs as part of Nic's PR. I agree that if it's done via a find/replace, it shouldn't matter :-)

alias: true
copy_to: false

- from: source_ecs.geo.continent_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needlessly verbose, IMO. What about the following?

- from: source_ecs.geo
  to: source.geo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how ecs-migration.yml will be used so I can't say for sure whether this is needlessly verbose. But if I can speculate, I think the level of detail here is appropriate if this will be used to create aliases because aliases must target concrete fields, not objects like source.geo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point


Can be one or multiple IPv4 or IPv6 addresses.

- name: hostname
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that source.hostname should be replaced by source.domain. Same goes for destination.hostname.

If you want to store an ambiguous value as well, before determining if it's a hostname or an IP, ECS no longer has a field for this (at least for now). You may store it in a custom field, or you may add logic to save to .ip only when it's an IP, or save to .domain when it's a hostname/domain.

Removes `source.hostname` and `destination.hostname` from fields.ecs.yml.
Adds `source.geo` and `destination.geo` to fields.ecs.yml.
Copy link
Contributor

@webmat webmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@webmat
Copy link
Contributor

webmat commented Nov 9, 2018

@andrewkroh Actually there's a mention of source_ecs left in the Alerts-Overview dashboard

@andrewkroh andrewkroh merged commit 2b748a3 into elastic:master Nov 9, 2018
@ruflin ruflin mentioned this pull request Nov 14, 2018
DStape pushed a commit to DStape/beats that referenced this pull request Aug 20, 2019
* Rename source_ecs to source

Update Suricata module to use `source` instead of `source_ecs` now that the Filebeat source
field has been changed. This updates `libbeat/_meta/fields.ecs.yml` to include the ECS
`source.*` fields.

This updates the dashboards and visualizations to use the new `source` fields. And I also updated
the saved searches to use `event.module` instead of `fileset.module`.

- Remove source.ip, source,port from auditbeat's auditd module fields (source.hostname remains, will remove separately).
- Remove source.ip, source.port, and source.mac from packetbeat's flow fields.
- Adds `source.geo` and `destination.geo` to fields.ecs.yml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants