Repository navigation
Conversation
Intune sends all of its log categories to one Event Hub, but the package had a separate Event Hub input for each of the audit and managed_device data streams. Users had to configure the same hub twice, and every event was read and processed once per data stream, with most of it discarded at ingest. Add an events data stream that holds the only Event Hub input. Its ingest pipeline reads the Azure Monitor log category, and routing rules reroute AuditLogs events to microsoft_intune.audit and Devices events to microsoft_intune.managed_device. Events with any other category stay in microsoft_intune.events with the category kept in microsoft_intune.events.category. The audit and managed_device data streams no longer have inputs and only receive rerouted events. The Event Hub connection, storage, authority host, processor and transport settings move to package-level variables. This is a breaking change: existing policies must be configured again after upgrade. The default checkpoint container name is unchanged so that the agent continues from existing checkpoints. The two fake Event Hub servers used by the script tests are merged into one that sends audit, device and uncategorised events, and the policy and script tests move to the events data stream. Fixes elastic#22227 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tick the box to add this pull request to the merge queue (same as
|
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! 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. |
There was a problem hiding this comment.
🟡 Changes recommended
Cross-namespace write permissions break namespace isolation, and preservation-enabled or failed events do not populate event.original.
2 open issues
What changed in this PR
Consolidates Microsoft Intune collection into one Azure Event Hub input, addressing #22227 while retaining the existing audit and managed-device pipelines.
Changes:
- Adds an
eventsdata stream that routes known categories and retains unmatched events. - Moves shared connection settings to package-level variables and documents the breaking upgrade.
- Consolidates fake Event Hub servers and moves policy and transport tests to the new input.
| File | Description |
|---|---|
packages/microsoft_intune/manifest.yml |
Centralizes settings and bumps the package version. |
packages/microsoft_intune/docs/README.md |
Documents routing, setup, and migration. |
packages/microsoft_intune/data_stream/managed_device/manifest.yml |
Makes managed devices a reroute-only destination. |
packages/microsoft_intune/data_stream/managed_device/agent/stream/azure_eventhub.yml.hbs.link |
Removes the separate device input template link. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/scripts/eventhub_websocket.txt |
Removes the separate device WebSocket test. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/scripts/eventhub_v2.txt |
Removes the separate device AMQP test. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/policy/test-websocket-override.yml |
Removes the device-specific override fixture. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/policy/test-websocket-override.expected |
Removes device-specific override expectations. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/policy/test-default.yml |
Removes the device-specific default fixture. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/policy/test-default.expected |
Removes device-specific default expectations. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/policy/test-all.yml |
Removes the device-specific full-settings fixture. |
packages/microsoft_intune/data_stream/managed_device/_dev/test/policy/test-all.expected |
Removes device-specific full-settings expectations. |
packages/microsoft_intune/data_stream/events/routing_rules.yml |
Routes audit and device categories to their destinations. |
packages/microsoft_intune/data_stream/events/manifest.yml |
Defines the single input and routing permissions. |
packages/microsoft_intune/data_stream/events/fields/fields.yml |
Defines the retained category field. |
packages/microsoft_intune/data_stream/events/fields/ecs.yml.link |
Reuses shared ECS field definitions. |
packages/microsoft_intune/data_stream/events/fields/beats.yml.link |
Reuses shared Beats field definitions. |
packages/microsoft_intune/data_stream/events/fields/base-fields.yml |
Defines base data-stream fields. |
packages/microsoft_intune/data_stream/events/elasticsearch/ingest_pipeline/default.yml |
Selects routing datasets and handles parsing failures. |
packages/microsoft_intune/data_stream/events/agent/stream/azure_eventhub.yml.hbs |
Provides the consolidated Event Hub input template. |
packages/microsoft_intune/data_stream/events/_dev/test/scripts/routed_data_streams.txt |
Tests AMQP delivery across all three destinations. |
packages/microsoft_intune/data_stream/events/_dev/test/scripts/eventhub_websocket.txt |
Tests routing over WebSockets. |
packages/microsoft_intune/data_stream/events/_dev/test/policy/test-websocket-override.yml |
Tests package-level WebSocket processor override settings. |
packages/microsoft_intune/data_stream/events/_dev/test/policy/test-websocket-override.expected |
Updates override expectations for the consolidated input. |
packages/microsoft_intune/data_stream/events/_dev/test/policy/test-default.yml |
Defines default consolidated policy settings. |
packages/microsoft_intune/data_stream/events/_dev/test/policy/test-default.expected |
Updates default input and permission expectations. |
packages/microsoft_intune/data_stream/events/_dev/test/policy/test-all.yml |
Exercises shared and stream-level options. |
packages/microsoft_intune/data_stream/events/_dev/test/policy/test-all.expected |
Updates full-settings policy expectations. |
packages/microsoft_intune/data_stream/events/_dev/test/pipeline/test-events.log-expected.json |
Defines routed and catch-all pipeline expectations. |
packages/microsoft_intune/data_stream/events/_dev/test/pipeline/test-events.log |
Supplies known, unknown, and missing-category cases. |
packages/microsoft_intune/data_stream/audit/manifest.yml |
Makes audit a reroute-only destination. |
packages/microsoft_intune/data_stream/audit/agent/stream/azure_eventhub.yml.hbs.link |
Removes the separate audit input template link. |
packages/microsoft_intune/data_stream/audit/_dev/test/scripts/eventhub_websocket.txt |
Removes the separate audit WebSocket test. |
packages/microsoft_intune/data_stream/audit/_dev/test/scripts/eventhub_v2.txt |
Removes the separate audit AMQP test. |
packages/microsoft_intune/data_stream/audit/_dev/test/policy/test-websocket-override.yml |
Removes the audit-specific override fixture. |
packages/microsoft_intune/data_stream/audit/_dev/test/policy/test-default.yml |
Removes the audit-specific default fixture. |
packages/microsoft_intune/data_stream/audit/_dev/test/policy/test-all.yml |
Removes the audit-specific full-settings fixture. |
packages/microsoft_intune/changelog.yml |
Records the breaking configuration change. |
packages/microsoft_intune/_dev/scripts/azure-eh/main.go |
Combines audit, device, and unmatched test events. |
packages/microsoft_intune/_dev/scripts/azure-eh/go.mod |
Defines the consolidated fake-server module. |
packages/microsoft_intune/_dev/scripts/azure-eh/docker-compose.yml |
Configures the consolidated test server. |
packages/microsoft_intune/_dev/scripts/azure-eh-managed-device/main.go |
Removes the duplicate device test server. |
packages/microsoft_intune/_dev/scripts/azure-eh-managed-device/go.mod |
Removes the duplicate server module. |
packages/microsoft_intune/_dev/scripts/azure-eh-managed-device/docker-compose.yml |
Removes the duplicate server configuration. |
packages/microsoft_intune/_dev/build/docs/README.md |
Updates documentation source for routing and migration. |
Review effort: Balanced
Fleet quotes the breaking change description in the upgrade callout and flyout as plain text, so the entry now avoids Markdown and tells users what to do. An upgrade dry run from 0.3.0 showed that Fleet cannot carry the Event Hub settings over to the new package-level variables, so existing policies keep running 0.3.0 until they are edited, and per-input options such as Preserve original event and a custom Storage Account Container are reset. The README upgrade section now lists the steps to upgrade a policy. Updates elastic#22227 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🚀 Benchmarks reportTo see the full report comment with |
Grant only dataset-dynamic write permissions on the events data stream. The routing rules keep the namespace, so dynamic_namespace only widened the agent's API key from logs-*-<namespace> to logs-*-*. Restore the per-data-stream tags on routed events. The agent sets the default microsoft_intune-events tag on every event, so routed audit and managed device documents had lost the microsoft_intune-audit and microsoft_intune-managed_device tags of earlier versions. The events pipeline now replaces the default tag with the tag of the target data stream. Remove the Preserve duplicate custom fields setting, a legacy pattern that the new events stream would otherwise carry forward. The vendor fields copied to ECS fields are now always removed, and their field definitions are dropped. Doing this in the same breaking release avoids a second breaking upgrade later. Extend the upgrade guidance in the changelog and README to cover the Consumer Group reset to $Default, and 0.3.x setups where the audit and managed device inputs read different Event Hubs. Updates elastic#22227 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The events pipeline omits event.original for unrouted or malformed events when preservation is enabled and leaves the previously supported DeviceComplianceOrg category unparsed.
2 open issues
2 resolved since last review
Review effort: Balanced
The managed_device pipeline has parsed DeviceComplianceOrg records since 0.1.1, and in 0.3.x they reached it because the managed_device input read the whole Event Hub. The new routing sent only the Devices category to managed_device, so compliance records stayed unparsed in the events data stream. Route both categories to managed_device, and cover the compliance event in the events pipeline test and in the script tests. Rename the AMQP script test back to eventhub_v2.txt so that it pairs with eventhub_websocket.txt as before. Updates elastic#22227 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Explain in the changelog and README that the agent reads the Event Hub again from the start when it finds no checkpoints, and how the document IDs and Processor start position limit duplicates. Also explain that Tags now apply to all log categories, with an example of combining the tags of the old Audit and Managed Device inputs. Updates elastic#22227 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two breaking-change descriptions were each a single line of over a thousand characters, which made them hard to read and review. Wrap them at 100 columns. They use folded block scalars, so the parsed text that Fleet shows in the upgrade flyout is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔵 Needs a closer look
The preservation setting fails to populate event.original for unrouted events and malformed JSON, leaving the raw payload only in message and breaking the advertised field contract.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
…records DeviceComplianceOrg records are routed to managed_device, but the pipeline only mapped the properties of the Devices schema. The compliance state, owner type, device health threat level and the other compliance-only properties were removed with the rest of the parsed JSON, so a compliance record arrived without its compliance state. Map these properties to new fields under microsoft_intune.managed_device.properties, and UserId to user.id. No existing field changes. The numeric codes are stored as keywords next to their display values, because the sample has them both as numbers and as strings. Add a pipeline test with mock compliance records. The Managed Device dashboard filters only on the dataset, so it counted compliance records as devices. Select the Devices category by default in its Category control, and describe the two kinds of records in the README. Updates elastic#22227 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Build 54181 failed in the "Buildkite scripts unit tests" step before
any package test ran. The step installs python3-venv, and apt-get
update failed because the Ubuntu security mirror was being synchronized
("File has unexpected size ... Mirror sync in progress?"). The failure
is not related to the package, so this empty commit only starts a new
build.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Build 54186 failed in the same "Buildkite scripts unit tests" step as build 54181, again because apt-get update got index files of an unexpected size from the Ubuntu security mirror. Later builds of other pull requests pass this step, so start a new build. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The two breaking-change descriptions were long, and Fleet showed them as a list in a flyout. Merge them into one shorter entry that covers the single Event Hub input, the settings to enter again, how to keep the checkpoints, the different Event Hubs case, and the removed Preserve duplicate custom fields setting. With one entry, Fleet quotes the text in the upgrade callout. The details that were dropped remain in the README upgrade section. Updates elastic#22227 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…s data stream The Preserve original event setting promises a raw copy in event.original, but the events pipeline never set that field. Events that are not routed kept the raw text only in message, and failed events got the preserve_original_event tag without the field it refers to. Copy message to event.original for unrouted events when the setting is enabled, and for failed events. Keep message as well, because event.original is not indexed and message is the only searchable content of these events. Routed events are unchanged: the pipeline of the target data stream sets event.original. Also remove the temporary _tmp field in the failure handler. A message that is valid JSON but not an object fails after it is parsed, and the field was left in the document. Add a pipeline test with the setting enabled. Updates elastic#22227 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… script tests The events pipeline keeps events that it cannot parse as pipeline errors, but nothing tested that. A pipeline test cannot cover it, because the elastic-package pipeline tester fails any document that has error.message. Make the fake Event Hub send two more events, one that is not JSON and one that is JSON but not an object, and check in both script tests that they stay in microsoft_intune.events with event.kind pipeline_error and an error message, that message and event.original hold the raw event although Preserve original event is disabled, and that the temporary _tmp field is removed. The non-object event is a number. The azure-eventhub input splits a JSON array into one event per element, so an array never reaches the pipeline as one event. Updates elastic#22227 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
✅ All changelog entries have the correct PR link. |
|
🟢 No issues across the latest commits 83999ee. Review summaryIssues found across earlier commits 3114ec3 — 1 medium
Issues found across earlier commits d1569f4 — 1 medium
Issues found across earlier commits 9b29f83 — 1 medium, 2 low
🤖 AI-Generated Review | Vera Review Bot - v0.4.8 | 📚 Knowledge base: integration-skills
|
💚 Build Succeeded
History
|



Proposed commit message
Checklist
changelog.ymlfile.Devicesby default in its Category control. Checked through the Kibana saved objects API and equivalent Elasticsearch queries, not visually.Author's Checklist
microsoft_intune.eventsinstead of being dropped.Breaking change
Version 0.4.0 has one
breaking-changeentry inchangelog.yml. When users upgrade from 0.3.x, the integration Settings page shows "Action required due to breaking changes" and quotes the entry as plain text in the callout, with a link to this PR. Users must tick "I've reviewed the breaking changes" before upgrading.Upgrade behaviour checked on a 9.4.3 stack: installed 0.3.0 from EPR, created a policy with both inputs enabled (one with a custom storage account container and Preserve original event on), installed 0.4.0 and ran
POST /api/fleet/package_policies/upgrade/dryrun:hasErrors: truewith Azure Event Hub, Connection String, Storage Account and Storage Account Key reported as required. Consumer Group is not reported because it falls back to its$Defaultdefault.POST /api/fleet/package_policies/upgradefails with the same validation errors.The README has an "Upgrading from version 0.3.x" section with the steps to upgrade a policy, an example of combining the tags of the old inputs, what happens when no checkpoints are found, the different Event Hubs case, and the removed setting.
How to test this PR locally
Results against a 9.4.3 stack: all pipeline, policy and script tests pass. The script tests (
eventhub_v2over AMQP andeventhub_websocket) run a fake Event Hub that sends 2AuditLogs, 2Devices, 1DeviceComplianceOrgand 1OperationalLogsevent, and check that they land inaudit(2),managed_device(3) andevents(1), with the tags of each data stream.The
managed_devicepipeline tests includetest-device-compliance.log, four mockDeviceComplianceOrgrecords that cover the compliance states, both date formats, numeric and string codes, and null or empty values. The state and threat level names in them are assumed; only the compliance record intest-managed-device.logcomes from a real event.Dashboard check: the 25
managed_devicefixture events (20Devices, 5DeviceComplianceOrg) were sent throughlogs-microsoft_intune.events-*and all were routed tomanaged_devicewithout pipeline errors. Without a category selection, the Managed Device dashboard counts 25 devices; withDevicesselected, it counts 20.Screen Shots
Related issues