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

Cherry-pick #18223 to 7.x: Disable host fields for "cloud", panw, cef modules #19074

Merged
merged 2 commits into from
Jun 9, 2020

Conversation

andrewkroh
Copy link
Member

Cherry-pick of PR #18223 to 7.x branch. Original message:

What does this PR do?

This changes the default configuration of Filebeat to not add host fields to events that
originated in other places. The host field is defined in ECS as "host on which the event happened" but for data pulled from cloud APIs for data forwarded to Filebeat from other sources (PANW, CEF) this host field is inaccurate.

The affected "cloud" modules are azure, aws, googlecloud, o365, and okta. By default they will
tag events with cloud. This causes the module to not add host.name at the input state. And then the default configuration for Filebeat was updated to add a when condition to the add_host_metadata processors to skip events containing the cloud tag.

For PANW and CEF when data is forwarded to Filebeat from another host/device (this is most of the time) you don't want Filebeat to add host. So by default this modules add a forwarded tag to events that behaves the same as the cloud tag. If you configure the module to not include the forwarded tag (e.g. var.tags: [my_tag]) then Filebeat will add the host.* fields.

And for PANW I added some additional static observer.* fields.

Why is it important?

We want Filebeat to follow Elastic Common Schema. And setting host with the correct value is part of that. By setting (or not setting host) we can better interpret events. Without this change the Filebeat host is being attributed as the source of many cloud based audit/login events.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

Run this config from the x-pack/filebeat dir and verify that events do not contain host.

filebeat.modules:
- module: panw
  panos:
    var.input: file
    var.paths:
      - module/panw/panos/test/*.log
processors:
  - add_host_metadata:
      when.not.or:
        - contains.tags: cloud
        - contains.tags: forwarded
output.console.pretty: true

Related issues

Relates: #13920
Requires: #18159

This changes the default configuration of Filebeat to not add `host` fields to events that
originated in other places. The `host` field is defined in ECS as "host on which the event happened"
but for data pulled from cloud APIs for data forwarded to Filebeat from other sources (PANW, CEF)
this `host` field is inaccurate.

The affected "cloud" modules are azure, aws, googlecloud, o365, and okta. By default they will
tag events with `forwarded`. This will cause the module to not add `host.name` at the input state. And then
the default configuration for Filebeat was updated to add a `when` condition to the `add_host_metadata`
processors to skip events containing the `forwarded` tag.

For PANW and CEF when data is forwarded to Filebeat from another host/device (this is most of the time)
you don't want Filebeat to add `host`. So by default this modules add a `forwarded` tag to events. If you configure the module to not include the `forwarded` tag
(e.g. `var.tags: [my_tag]`) then Filebeat will add the `host.*` fields.

And for PANW I added some additional static `observer.*` fields.

Relates: elastic#13920
(cherry picked from commit e990740)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 9, 2020
@adriansr adriansr added Team:SIEM and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 9, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 9, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #19074 updated]

  • Start Time: 2020-06-09T16:44:50.237+0000

  • Duration: 66 min 34 sec

Test stats 🧪

Test Results
Failed 0
Passed 2656
Skipped 417
Total 3073

@andrewkroh andrewkroh merged commit 8af0424 into elastic:7.x Jun 9, 2020
@andrewkroh andrewkroh deleted the backport_18223_7.x branch January 14, 2022 14:04
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