Back to Beats

Microsoft module [filebeat-module-microsoft]

docs/reference/filebeat/filebeat-module-microsoft.md

9.4.08.3 KB
Original Source

% This file is generated! See filebeat/scripts/mage/docs.go

Microsoft module [filebeat-module-microsoft]

:::::{admonition} Prefer to use {{agent}} for this use case? Refer to the Elastic Integrations documentation.

::::{dropdown} Learn more {{agent}} is a single, unified way to add monitoring for logs, metrics, and other types of data to a host. It can also protect hosts from security threats, query data from operating systems, forward data from remote services or hardware, and more. Refer to the documentation for a detailed comparison of {{beats}} and {{agent}}.

::::

:::::

This is a module for ingesting data from the different Microsoft Products. Currently supports these filesets:

  • defender_atp fileset: Supports Microsoft Defender for Endpoint (Microsoft Defender ATP)
  • m365_defender fileset: Supports Microsoft 365 Defender (Microsoft Threat Protection)

When you run the module, it performs a few tasks under the hood:

  • Sets the default paths to the log files (but don’t worry, you can override the defaults)
  • Makes sure each multiline log event gets sent as a single event
  • Uses an {{es}} ingest pipeline to parse and process the log lines, shaping the data into a structure suitable for visualizing in Kibana
  • Deploys dashboards for visualizing the log data

::::{tip} Read the quick start to learn how to configure and run modules. ::::

Configure the module [configuring-microsoft-module]

You can further refine the behavior of the microsoft module by specifying variable settings in the modules.d/microsoft.yml file, or overriding settings at the command line.

You must enable at least one fileset in the module. Filesets are disabled by default.

Variable settings [microsoft-settings]

Each fileset has separate variable settings for configuring the behavior of the module. If you don’t specify variable settings, the microsoft module uses the defaults.

For advanced use cases, you can also override input settings. See Override input settings.

::::{tip} When you specify a setting at the command line, remember to prefix the setting with the module name, for example, microsoft.defender_atp.var.paths instead of defender_atp.var.paths. ::::

m365_defender fileset settings [_m365_defender_fileset_settings]

To configure access for Filebeat to Microsoft 365 Defender you will have to create a new Azure Application registration, this will again return Oauth tokens with access to the Microsoft 365 Defender API

The procedure to create an application is found on the below link:

Create a new Azure Application

When giving the application the API permissions described in the documentation (Incident.Read.All) it will only grant access to read Incidents from 365 Defender and nothing else in the Azure Domain.

After the application has been created, it should contain 3 values that you need to apply to the module configuration.

These values are:

  • Client ID
  • Client Secret
  • Tenant ID

Example config:

yaml
- module: microsoft
  m365_defender:
    enabled: true
    var.oauth2.client.id: "123abc-879546asd-349587-ad64508"
    var.oauth2.client.secret: "980453~-Sg99gedf"
    var.oauth2.token_url: "https://login.microsoftonline.com/INSERT-TENANT-ID/oauth2/v2.0/token"
    var.oauth2.scopes:
      - "https://api.security.microsoft.com/.default"

var.oauth2.client.id : This is the client ID related to creating a new application on Azure.

var.oauth2.client.secret : The secret related to the client ID.

var.oauth2.token_url : A predefined URL towards the Oauth2 service for Microsoft. The URL should always be the same with the exception of the Tenant ID that needs to be added to the full URL.

var.oauth2.scopes : A list of included scopes, should use .default unless different is specified.

365 Defender ECS fields [_365_defender_ecs_fields]

This is a list of 365 Defender fields that are mapped to ECS.

365 Defender FieldsECS Fields
lastUpdateTime@timestamp
severityevent.severity
createdTimeevent.created
alerts.categorythreat.technique.name
alerts.descriptionrule.description
alerts.serviceSourceevent.provider
alerts.alertIdevent.id
alerts.firstActivityevent.start
alerts.lastActivityevent.end
alerts.titlemessage
entities.processIdprocess.pid
entities.processCommandLineprocess.command_line
entities.processCreationTimeprocess.start
entities.parentProcessIdprocess.parent.pid
entities.parentProcessCreationTimeprocess.parent.start
entities.sha1file.hash.sha1
entities.sha256file.hash.sha256
entities.urlurl.full
entities.filePathfile.path
entities.fileNamefile.name
entities.userPrincipalNamehost.user.name
entities.domainNamehost.user.domain
entities.aadUserIdhost.user.id

defender_atp fileset settings [_defender_atp_fileset_settings]

To allow the filebeat module to ingest data from the Microsoft Defender API, you would need to create a new application on your Azure domain.

The procedure to create an application is found on the below link:

Create a new Azure Application

When giving the application the API permissions described in the documentation (Windows Defender ATP Alert.Read.All) it will only grant access to read alerts from ATP and nothing else in the Azure Domain.

After the application has been created, it should contain 3 values that you need to apply to the module configuration.

These values are:

  • Client ID
  • Client Secret
  • Tenant ID

Example config:

yaml
- module: microsoft
  defender_atp:
    enabled: true
    var.oauth2.client.id: "123abc-879546asd-349587-ad64508"
    var.oauth2.client.secret: "980453~-Sg99gedf"
    var.oauth2.token_url: "https://login.microsoftonline.com/INSERT-TENANT-ID/oauth2/token"

var.oauth2.client.id : This is the client ID related to creating a new application on Azure.

var.oauth2.client.secret : The secret related to the client ID.

var.oauth2.token_url : A predefined URL towards the Oauth2 service for Microsoft. The URL should always be the same with the exception of the Tenant ID that needs to be added to the full URL.

Defender ATP ECS fields [_defender_atp_ecs_fields]

This is a list of Defender ATP fields that are mapped to ECS.

Defender ATP FieldsECS Fields
alertCreationTime@timestamp
aadTenantIdcloud.account.id
categorythreat.technique.name
computerDnsNamehost.hostname
descriptionrule.description
detectionSourceobserver.name
evidence.fileNamefile.name
evidence.filePathfile.path
evidence.processIdprocess.pid
evidence.processCommandLineprocess.command_line
evidence.processCreationTimeprocess.start
evidence.parentProcessIdprocess.parent.pid
evidence.parentProcessCreationTimeprocess.parent.start
evidence.sha1file.hash.sha1
evidence.sha256file.hash.sha256
evidence.urlurl.full
firstEventTimeevent.start
idevent.id
lastEventTimeevent.end
machineIdcloud.instance.id
relatedUser.userNamehost.user.name
relatedUser.domainNamehost.user.domain
titlemessage
severityevent.severity

Dashboards [_dashboards_4]

This module comes with a sample dashboard for Defender ATP.

% TO DO: Use :class: screenshot

The best way to view Defender ATP events and alert data is in the SIEM.

% TO DO: Use :class: screenshot

For alerts, go to Detections → External alerts.

% TO DO: Use :class: screenshot

And for all other Defender ATP event types, go to Host → Events.

Fields [_fields]

For a description of each field in the module, see the exported fields section.