Skip to content

m365_defender,microsoft_defender_endpoint: switch vulnerability data stream to delta API - #19034

Merged
kcreddy merged 10 commits into
elastic:mainfrom
kcreddy:m365_defender-incremental-vuln
May 27, 2026
Merged

m365_defender,microsoft_defender_endpoint: switch vulnerability data stream to delta API#19034
kcreddy merged 10 commits into
elastic:mainfrom
kcreddy:m365_defender-incremental-vuln

Conversation

@kcreddy

@kcreddy kcreddy commented May 15, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

m365_defender,microsoft_defender_endpoint: switch vulnerability data stream to delta API

Replace the SoftwareVulnerabilitiesExport (gzip file download) API with
the SoftwareVulnerabilityChangesByMachine (paginated JSON delta) API for
the vulnerability data stream. The gzip approach caused high memory usage
because entire compressed files were decompressed in memory.

The delta API returns only new, fixed, and updated vulnerabilities since
a given timestamp, using OData pagination. This eliminates gzip handling
from the CEL program entirely.

Key changes across both packages:

- Rewrite cel.yml.hbs to use paginated delta API with @odata.nextLink
  pagination and sinceTime cursor management.
- Add initial_interval variable (default 336h / 14 days, the API max)
  to control the first historical lookback window.
- Remove sas_valid_hours and max_retries variables.
- Add EventTimestamp (date) and Status (keyword) fields; remove
  SecurityUpdateAvailable (boolean).
- Add Painless script processor to normalize camelCase JSON field names
  to PascalCase, handling API response casing inconsistencies between
  the full-export and delta endpoints.
- Update ingest pipeline to process new fields.
- Widen transform source query from now-4h to now-90d and bump
  retention_policy.max_age to 2160h to accommodate delta semantics.
- Add vulnerability.status to transform destination field mappings.
- Bump fleet_transform_version to 0.4.0 to trigger reinstall.
- Update mock server configs, system test configs, pipeline test
  fixtures (with both PascalCase and camelCase events), policy test
  expected files, script tests, and Rally benchmark definitions.
- Change default polling interval from 4h to 6h.
- Bump m365_defender to 5.14.0, microsoft_defender_endpoint to 4.7.0.

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

kcreddy added 2 commits May 15, 2026 19:09
…stream to delta API

Replace the SoftwareVulnerabilitiesExport (gzip file download) API with
the SoftwareVulnerabilityChangesByMachine (paginated JSON delta) API for
the vulnerability data stream. The gzip approach caused high memory usage
because entire compressed files were decompressed in memory.

The delta API returns only new, fixed, and updated vulnerabilities since
a given timestamp, using OData pagination. This eliminates gzip handling
from the CEL program entirely.

Key changes across both packages:

- Rewrite cel.yml.hbs to use paginated delta API with @odata.nextLink
  pagination and sinceTime cursor management.
- Add initial_interval variable (default 336h / 14 days, the API max)
  to control the first historical lookback window.
- Remove sas_valid_hours and max_retries variables.
- Add EventTimestamp (date) and Status (keyword) fields; remove
  SecurityUpdateAvailable (boolean).
- Update ingest pipeline to process new fields.
- Widen transform source query from now-4h to now-90d and bump
  retention_policy.max_age to 2160h to accommodate delta semantics.
- Bump fleet_transform_version to 0.4.0 to trigger reinstall.
- Update mock server configs, system test configs, pipeline test
  fixtures, policy test expected files, script tests, and Rally
  benchmark definitions.
- Change default polling interval from 4h to 6h.
- Bump m365_defender to 5.14.0, microsoft_defender_endpoint to 4.7.0.
@kcreddy kcreddy self-assigned this May 15, 2026
@kcreddy kcreddy added enhancement New feature or request Integration:microsoft_defender_endpoint Microsoft Defender for Endpoint Integration:m365_defender Microsoft Defender XDR Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels May 15, 2026
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…ization and field fixes

Add a Painless script processor to the vulnerability ingest pipelines
that normalizes camelCase JSON field names to PascalCase. The delta
API (SoftwareVulnerabilityChangesByMachine) returns camelCase keys
while the full-export API used PascalCase. The script handles the
"os" prefix specially (osPlatform -> OSPlatform) so host.os fields
are populated correctly regardless of which casing the API sends.

Restore original PascalCase test events in pipeline fixtures and
add camelCase events to cover both code paths. Add missing
vulnerability.status field to transform destination mappings.
Update sample events and system test configs for completeness.
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Vale Linting Results

Summary: 2 warnings found

⚠️ Warnings (2)
File Line Rule Message
packages/m365_defender/_dev/build/docs/README.md 24 Elastic.DirectionalLanguage Don't use directional language. Use 'in the following section' instead of 'listed below'.
packages/m365_defender/docs/README.md 24 Elastic.DirectionalLanguage Don't use directional language. Use 'in the following section' instead of 'listed below'.

The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label May 18, 2026
Comment thread packages/m365_defender/data_stream/vulnerability/agent/stream/cel.yml.hbs Outdated
Comment thread packages/m365_defender/data_stream/vulnerability/agent/stream/cel.yml.hbs Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@kcreddy
kcreddy marked this pull request as ready for review May 26, 2026 18:20
@kcreddy
kcreddy requested review from a team as code owners May 26, 2026 18:20
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@kcreddy
kcreddy requested a review from efd6 May 26, 2026 18:20
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

m365_defender is failing due to generated docs drift (README.md is outdated) and needs a docs rebuild committed to the PR. The microsoft_defender_endpoint failure cannot be root-caused from the attached log file because it only contains teardown/artifact-upload output after the failure.

Remediation

  • Regenerate and commit the m365 docs output (from repo root): elastic-package build -v -C packages/m365_defender (or run the package build flow used locally) so packages/m365_defender/docs/README.md matches generated output.
  • Re-run the Check integrations microsoft_defender_endpoint step and capture full step output (or provide the failing test section/JUnit failure text); current log starts at container teardown, so the triggering error is missing.
Investigation details

Root Cause

  1. Configuration/docs drift (m365_defender)

    • The failing step reports a README mismatch during lint/check:
      • README.md is outdated. Rebuild the package with 'elastic-package build'
      • checking readme files are up-to-date failed: files do not match
    • This is a generated-doc consistency failure in the package check stage.
  2. Inconclusive (microsoft_defender_endpoint)

    • The provided log file contains only teardown and artifact upload lines, then exit status 1, with no preceding test/assertion/error lines to attribute a concrete root cause.

Evidence

README.md is outdated. Rebuild the package with 'elastic-package build'
Error: checking package failed: checking readme files are up-to-date failed: files do not match
  • Job/step: Check integrations microsoft_defender_endpoint
    • Log excerpt (/tmp/gh-aw/buildkite-logs/integrations-check-integrations-microsoft_defender_endpoint.txt):
--- [microsoft_defender_endpoint] failed
🚨 Error: The command exited with status 1
user command error: exit status 1
~~~ Uploading artifacts
...
~~~ Running repository pre-exit hook
--- Take down the Elastic stack
Done

Verification

  • Not run in this workflow (read-only detective run).

Follow-up

  • If you attach the first failing assertion/error chunk for microsoft_defender_endpoint (or the relevant JUnit failure body), I can map it directly to the exact source file/line and suggest a concrete patch.

Note

🔒 Integrity filter blocked 2 items

The following items were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@efd6

efd6 commented May 26, 2026

Copy link
Copy Markdown
Contributor

The failures here appear to be due to the mock events being outside the 90 day source query causing the transforms to fail.

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @kcreddy

@kcreddy
kcreddy merged commit 5194d29 into elastic:main May 27, 2026
4 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

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

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

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

herrBez pushed a commit to herrBez/integrations that referenced this pull request Jun 1, 2026
…stream to delta API (elastic#19034)

Replace the SoftwareVulnerabilitiesExport (gzip file download) API with
the SoftwareVulnerabilityChangesByMachine (paginated JSON delta) API for
the vulnerability data stream. The gzip approach caused high memory usage
because entire compressed files were decompressed in memory.

The delta API returns only new, fixed, and updated vulnerabilities since
a given timestamp, using OData pagination. This eliminates gzip handling
from the CEL program entirely.

Key changes across both packages:

- Rewrite cel.yml.hbs to use paginated delta API with @odata.nextLink
  pagination and sinceTime cursor management.
- Add initial_interval variable (default 336h / 14 days, the API max)
  to control the first historical lookback window.
- Remove sas_valid_hours and max_retries variables.
- Add EventTimestamp (date) and Status (keyword) fields; remove
  SecurityUpdateAvailable (boolean).
- Add Painless script processor to normalize camelCase JSON field names
  to PascalCase, handling API response casing inconsistencies between
  the full-export and delta endpoints.
- Update ingest pipeline to process new fields.
- Widen transform source query from now-4h to now-90d and bump
  retention_policy.max_age to 2160h to accommodate delta semantics.
- Add vulnerability.status to transform destination field mappings.
- Bump fleet_transform_version to 0.4.0 to trigger reinstall.
- Update mock server configs, system test configs, pipeline test
  fixtures (with both PascalCase and camelCase events), policy test
  expected files, script tests, and Rally benchmark definitions.
- Change default polling interval from 4h to 6h.
- Bump m365_defender to 5.14.0, microsoft_defender_endpoint to 4.7.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request 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]

4 participants