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

The Ingest Pipeline for Microsoft 365 Defender should populate hostname #29859

Closed
hinchliff opened this issue Jan 14, 2022 · 3 comments · Fixed by #29863
Closed

The Ingest Pipeline for Microsoft 365 Defender should populate hostname #29859

hinchliff opened this issue Jan 14, 2022 · 3 comments · Fixed by #29863

Comments

@hinchliff
Copy link
Contributor

Describe the enhancement:
The events from Defender ATP include the fields host.name and host.hostname, but these fields seem to be missing from the 365 Defender events.

Describe a specific use case for the enhancement or feature:
In order to use Elastic Security, host.name is a required field (Elastic Security ECS field reference)

Additional Details

Is this a "bug", that host.name is missing? Or an enhancement request to add host.name ?

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 14, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 14, 2022
@jamiehynds jamiehynds added enhancement needs_team Indicates that the issue/PR needs a Team:* label labels Jan 14, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 14, 2022
@botelastic
Copy link

botelastic bot commented Jan 14, 2022

This issue doesn't have a Team:<team> label.

@hinchliff
Copy link
Contributor Author

I hadn't realized at first, looking at the data in Elasticsearch, that the devices from 365 Defender is actually an array, e.g. from the expected test output

        "microsoft.m365_defender.alerts.devices": [
            {
                "deviceDnsName": "TestServer4",
                "firstSeen": "2020-06-30T08:55:08.8320449Z",
                "healthStatus": "Inactive",
                "mdatpDeviceId": "75a63a39f9bc5a964f417c11f6277d5bf9489f0d",
                "osBuild": 17763,
                "osPlatform": "Other",
                "osProcessor": "x64",
                "rbacGroupId": 0,
                "riskScore": "High",
                "version": "Other"
            }
        ],

I think it still makes sense to use (all) of the deviceDnsName field(s) to populate host.name and host.hostname ... but that may be more complicated to do?

I added a section to the ingest pipeline, based on the Defender ATP pipeline. But the test output has apparently not changed from the unmodified pipeline? (I have not yet adjusted the tests, and none of the tests are failing.)

  ######################
  ## ECS Host Mapping ##
  ######################
- rename:
    field: json.alerts.devices.deviceDnsName
    target_field: host.hostname
    ignore_missing: true
- set:
    field: host.name
    value: '{{host.hostname}}'
    if: ctx?.host?.hostname != null

maybe it would need to look something like this?

  ######################
  ## ECS Host Mapping ##
  ######################
- foreach:
  field: json.alerts.devices
  ignore_missing: true
  processor:
    - rename:
        field: _ingest._value.deviceDnsName
        target_field: host.hostname
        ignore_missing: true

- set:
    field: host.name
    value: '{{host.hostname}}'
    if: ctx?.host?.hostname != null

or maybe the rename will need to be an append, since it's inside theforeach loop?

i'm working on testing this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants