Skip to content

Conversation

@mohitjha-elastic
Copy link
Collaborator

@mohitjha-elastic mohitjha-elastic commented Sep 8, 2025

Proposed Commit Message

m365_defender, microsoft_defender_endpoint: extract process.name from process.command_line

* m365_defender: updated process.name ECS mapping in alert, event, and incident
  data streams to extract the process name from process.command_line instead of
  relying on file.name.
* microsoft_defender_endpoint: updated process.name ECS mapping in log data stream
  to extract the process name from process.command_line.

M365 Defender:

* Alert – If process.name already exists, leave it as is. Otherwise, extract it
  from process.command_line(since process.executable is not available here).
* Event – Some pipelines already contain logic to parse process.executable and
  process.name. The script to set process.name from command_line will only be
  used when either of these fields is missing.
* Incident – Both process.name and process.executable are not available.
  Therefore, the script must be used to parse and populate process.name.

Microsoft Defender Endpoint:

* log - Both process.name and process.executable are not available. Therefore,
  the script must be used to parse and populate process.name.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

How to test this PR locally

To test integration

Clone integrations repo.
Install the elastic package locally.
Start the elastic stack using the elastic package.
Move to integrations/packages/<integration_name> directory.
Run the following command to run tests.
elastic-package test -v

NOTE: To test individual integrations, replace <integration_name> with one of the following: m365_defender or microsoft_defender_endpoint.

Related issues

SDH 6382

@mohitjha-elastic mohitjha-elastic self-assigned this Sep 8, 2025
@mohitjha-elastic mohitjha-elastic requested a review from a team as a code owner September 8, 2025 14:35
@mohitjha-elastic mohitjha-elastic added Integration:microsoft_defender_endpoint Microsoft Defender for Endpoint Integration:m365_defender Microsoft Defender XDR bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Sep 8, 2025
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Sep 8, 2025
Some pipelines already contain logic to parse process.executable and process.name. The script will only be used when either of these fields is missing to set the process.name.
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

nits only

Optimize initializing process ECS
@efd6 efd6 changed the title [microsoft_defender_endpoint, m365_defender] Update Process Name ECS Mapping [microsoft_defender_endpoint, m365_defender] extract process.name from process.command_line Sep 10, 2025
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @mohitjha-elastic

@elastic-sonarqube
Copy link

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Thanks

@efd6 efd6 merged commit 78ec5bf into elastic:main Sep 10, 2025
9 checks passed
@efd6
Copy link
Contributor

efd6 commented Sep 10, 2025

I have manually tested this on a problematic sample and it behaves as wanted.

@elastic-vault-github-plugin-prod

Package m365_defender - 4.0.1 containing this change is available at https://epr.elastic.co/package/m365_defender/4.0.1/

@elastic-vault-github-plugin-prod

Package microsoft_defender_endpoint - 3.0.1 containing this change is available at https://epr.elastic.co/package/microsoft_defender_endpoint/3.0.1/

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

Labels

bugfix Pull request that fixes a bug issue documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:m365_defender Microsoft Defender XDR Integration:microsoft_defender_endpoint Microsoft Defender for Endpoint Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants