Skip to content

[New Rule] Microsoft Defender XDR Promotion Rules#6360

Open
terrancedejesus wants to merge 4 commits into
mainfrom
new-rule/m365-defender-promotion-rules
Open

[New Rule] Microsoft Defender XDR Promotion Rules#6360
terrancedejesus wants to merge 4 commits into
mainfrom
new-rule/m365-defender-promotion-rules

Conversation

@terrancedejesus

@terrancedejesus terrancedejesus commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Issue link(s):

Summary - What I changed

Reported duplicate open Elastic alerts for the same Defender alert/incident when using a copy of the generic External Alerts rule with suppression on event.id. Investigation of the integration ingest pipelines showed event.id is already the stable Defender ID, so the duplicates come from suppression lifecycle behavior, not a wrong key. There was no out-of-the-box rule for the native m365_defender.alert and incident data streams, similar to CrowdStrike, S1, etc.. These rules give a turnkey workflow that keeps one analyst-facing alert per Defender alert or incident and folds subsequent update events into it, with the suppression key and window set correctly and documented.

New files (2 promotion rules in rules/promotions/):

  • m365_defender_alert_external_alerts.toml: promotes each Microsoft Defender XDR alert from logs-m365_defender.alert-* into an Elastic alert. Suppresses on m365_defender.alert.id + tenant_id with a 1 day window.
  • m365_defender_incident_external_alerts.toml: promotes each Defender incident from logs-m365_defender.incident-*. Suppresses on m365_defender.incident.id + tenant_id with a 1 day window. This is the recommended default since it produces one Elastic alert per incident.

Modified files (2):

  • rules_building_block/initial_access_microsoft_defender_alerts_signal.toml: added a note pointing to the two new promotion rule IDs (clarifying UAL path vs native data stream), and raised severity from low to medium (risk_score 21 to 47).

Checklist

  • Added a label for the type of pr: bug, enhancement, schema, maintenance, Rule: New, Rule: Deprecation, Rule: Tuning, Hunt: New, or Hunt: Tuning so guidelines can be generated
  • Added the meta:rapid-merge label if planning to merge within 24 hours
  • Secret and sensitive material has been managed correctly
  • Automated testing was updated or added to match the most common scenarios
  • Documentation and comments were added for features that require explanation

Contributor checklist

@tradebot-elastic

tradebot-elastic commented Jun 30, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Microsoft Defender XDR Incident External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Defender XDR Alert External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@terrancedejesus terrancedejesus added Rule: New Proposal for new rule Rule: Tuning tweaking or tuning an existing rule labels Jun 30, 2026
@terrancedejesus terrancedejesus self-assigned this Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Rule: New - Guidelines

These guidelines serve as a reminder set of considerations when proposing a new rule.

Documentation and Context

  • Detailed description of the rule.
  • List any new fields required in ECS/data sources.
  • Link related issues or PRs.
  • Include references.

Rule Metadata Checks

  • creation_date matches the date of creation PR initially merged.
  • min_stack_version should support the widest stack versions.
  • name and description should be descriptive and not include typos.
  • query should be inclusive, not overly exclusive, considering performance for diverse environments. Non ecs fields should be added to non-ecs-schema.json if not available in an integration.
  • min_stack_comments and min_stack_version should be included if the rule is only compatible starting from a specific stack version.
  • index pattern should be neither too specific nor too vague, ensuring it accurately matches the relevant data stream (e.g., use logs-endpoint.process-* for process data).
  • integration should align with the index. If the integration is newly introduced, ensure the manifest, schemas, and new_rule.yaml template are updated.
  • setup should include the necessary steps to configure the integration.
  • note should include any additional information (e.g. Triage and analysis investigation guides, timeline templates).
  • tags should be relevant to the threat and align/added to the EXPECTED_RULE_TAGS in the definitions.py file.
  • threat, techniques, and subtechniques should map to ATT&CK always if possible.

New BBR Rules

  • building_block_type should be included if the rule is a building block and the rule should be located in the rules_building_block folder.
  • bypass_bbr_timing should be included if adding custom lookback timing to the rule.

Testing and Validation

  • Provide evidence of testing and detecting the expected threat.
  • Check for existence of coverage to prevent duplication.

@tradebot-elastic

tradebot-elastic commented Jul 1, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Microsoft Defender XDR Incident External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Defender XDR Alert External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

…Defender notes

The generic External Alerts rule (eb079c62) does not exclude the
m365_defender.alert/incident datasets, so the claim that it does was
incorrect. Drop it from both promotion rules' investigation guides.
@tradebot-elastic

tradebot-elastic commented Jul 1, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Microsoft Defender XDR Incident External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Defender XDR Alert External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

@terrancedejesus terrancedejesus marked this pull request as ready for review July 1, 2026 22:28
Copilot AI review requested due to automatic review settings July 1, 2026 22:28
@botelastic botelastic Bot added the bbr Building Block Rules label Jul 1, 2026
@tradebot-elastic

tradebot-elastic commented Jul 1, 2026

Copy link
Copy Markdown

⛔️ Test failed

Results
  • ❌ Microsoft Defender XDR Incident External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta
  • ❌ Microsoft Defender XDR Alert External Alerts (kuery)
    • coverage_issue: no_rta
    • stack_validation_failed: no_rta

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds Microsoft Defender XDR “promotion” rules so native m365_defender.alert and m365_defender.incident data streams can be promoted into Elastic detection alerts with suppression keyed on stable Defender IDs, enabling a single ongoing Elastic alert per Defender alert/incident update lifecycle.

Changes:

  • Introduces dedicated promotion rules for Defender XDR alerts and incidents (with 24h suppression windows keyed on {alert|incident}.id + tenant_id).
  • Updates the existing UAL-based “M365 Defender Alerts Signal” building block rule name/description and adds guidance pointing to the new promotion rules.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
rules/promotions/m365_defender_incident_external_alerts.toml New incident-level promotion rule with suppression keyed on incident id + tenant id and an investigation guide.
rules/promotions/m365_defender_alert_external_alerts.toml New alert-level promotion rule with suppression keyed on alert id + tenant id and an investigation guide.
rules_building_block/initial_access_microsoft_defender_alerts_signal.toml Clarifies this building block is UAL-specific via naming + note, and updates metadata/severity fields.

Comment on lines +2 to +6
creation_date = "2026/06/30"
integration = ["m365_defender"]
maturity = "production"
promotion = true
updated_date = "2026/07/01"
Comment on lines +2 to +6
creation_date = "2026/06/30"
integration = ["m365_defender"]
maturity = "production"
promotion = true
updated_date = "2026/07/01"
integration = ["o365"]
maturity = "production"
updated_date = "2026/04/07"
updated_date = "2026/06/30"

### Avoiding duplicate alerts

To avoid double-counting, enable either this alert-level rule or the Microsoft Defender XDR Incident External Alerts rule (incident-level), not both: a Defender incident's child alerts appear in both data streams. Choose incident-level for the least noise (one Elastic alert per Defender incident) or alert-level for finer-grained, per-alert triage.

### Avoiding duplicate alerts

To avoid double-counting, enable either this incident-level rule or the Microsoft Defender XDR Alert External Alerts rule (alert-level), not both: a Defender incident's child alerts appear in both data streams. Incident-level (this rule) produces the least noise (one Elastic alert per Defender incident) and is the recommended default; alert-level provides finer-grained, per-alert triage.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport: auto bbr Building Block Rules Rule: New Proposal for new rule Rule: Tuning tweaking or tuning an existing rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants