m365_defender,microsoft_defender_endpoint: switch vulnerability data stream to delta API - #19034
Conversation
…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.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Vale Linting ResultsSummary: 2 warnings found
|
| 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.
🚀 Benchmarks reportTo see the full report comment with |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
This comment has been minimized.
This comment has been minimized.
TL;DR
Remediation
Investigation detailsRoot Cause
Evidence
Verification
Follow-up
Note 🔒 Integrity filter blocked 2 itemsThe following items were blocked because they don't meet the GitHub integrity level.
To allow these resources, lower tools:
github:
min-integrity: approved # merged | approved | unapproved | noneWhat is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
|
The failures here appear to be due to the mock events being outside the 90 day source query causing the transforms to fail. |
💚 Build Succeeded
History
cc @kcreddy |
|
Package m365_defender - 5.14.0 containing this change is available at https://epr.elastic.co/package/m365_defender/5.14.0/ |
|
Package microsoft_defender_endpoint - 4.7.0 containing this change is available at https://epr.elastic.co/package/microsoft_defender_endpoint/4.7.0/ |
…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.
Proposed commit message
Checklist
changelog.ymlfile.Author's Checklist
How to test this PR locally
Related issues
Screenshots