You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Load telemetry routing metadata from a signed component DLL; remove admin registry policy - #1673
This PR moves the Windows telemetry routing metadata out of the MXC source tree and into a signed mxc_telemetry.dll. The DLL is built in a separate pipeline. build.rs checks its Authenticode signature, loads it, and reads the metadata at build time. Release builds on Windows use the bundled DLL by default.
Details
Signed component:build_mxc_telemetry_component.rs resolves the DLL to an absolute path, verifies the signature (signer Microsoft Corporation) before loading it, calls mxc_telemetry_metadata_v1, and fails closed on a bad signature, a null result, or a parse error. The numbers reach the crate as MXC_BUILD_* env vars.
Bundled DLLs: signed x64 and arm64 DLLs are committed under src/mxc-sdk/resources/telemetry-component/. Release builds on a Windows host use the one for the host architecture. Debug builds, non-Windows hosts and non-Windows targets are not routed. MXC_TELEMETRY_COMPONENT_PATH overrides the DLL; an empty value forces an unrouted build.
Group input removed:MXC_TELEMETRY_PROVIDER_GROUP_GUID is no longer supported. A nonempty value fails Windows builds, so routing only comes from the verified component.
Public source: the real classification values are removed from source, tests and docs. Tests use mock placeholder values. The Windows CI telemetry test executor is built with an empty MXC_TELEMETRY_COMPONENT_PATH so it stays unrouted.
Registry policy unchanged: the V1 administrative registry policy (HKLM\SOFTWARE\Policies\Mxc\AllowTelemetry), PolicyState, the FFI and the SDK policy APIs keep their existing behavior.
Docs: updated README.md, docs/telemetry.md and the developer telemetry and CI docs to explain that Windows release builds from source are routed, and how to build without routing.
CI: a new Windows step in Build.Windows.Job.yml checks the default bundled release build, the empty-path unrouted build, and that a tampered DLL fails the signature check.
Packaging: the crate package now includes the DLLs, so crates.io consumers get routing in release builds.
cargo check --locked --release -p mxc-sdk --lib: passed with the bundled DLL, passed with an empty MXC_TELEMETRY_COMPONENT_PATH, and failed with "no valid Authenticode signature" for a tampered copy
Both DLLs have a valid signature; the x64 DLL's live ETW run on a VM passed.
Not run: Node and .NET SDK tests after the revert, the .ps1 scripts on an elevated Windows host, Linux/macOS Clippy locally, and Microsoft ingestion acceptance.
Load mxc_telemetry.dll from the module directory, check its ABI version, and write the four Required development-contract events through it. Fall back to the in-process ETW path when the DLL is missing, incompatible, or a write fails.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
Open the component with write sharing denied, require a trusted Authenticode signature from the same signer as the SDK module in release builds, and pass the host module path to the component (ABI 2) so it can authorize its caller. Failures fall back to the in-process provider.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
Products that build MXC from source sign with their own identity, so release builds now require the component to be signed by Microsoft Corporation and no longer compare it to the host's signer.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
The build verifies the component's Authenticode signature, loads it, and
passes the group, keywords, privacy tags, product and category to the crate
through cargo rustc-env variables. Only the group literal is generated.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
Required collection is no longer disabled by HKLM\SOFTWARE\Policies\Mxc\AllowTelemetry.
Published contracts keep their consent and policy gates. Remove the
Required-telemetry documentation on turning collection off.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
Use placeholder metadata when no signed telemetry component is present and describe the component-supplied values in the architecture doc.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
Release builds on Windows default to the signed mxc_telemetry.dll for the
build host architecture. Debug builds stay unrouted.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
MXC no longer reads HKLM\SOFTWARE\Policies\Mxc\AllowTelemetry. The V1
policy API and wire values are unchanged; get_policy now reports
unrestricted on Windows and not-applicable elsewhere. Consent is the only
gate. Registry tests, hooks, scripts and docs are removed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved V1 policy changes can bypass deployed telemetry restrictions, while a DLL path mismatch can execute code from a file whose signature was not verified.
This PR moves Windows telemetry routing metadata into a signed, build-time DLL and removes MXC’s administrative registry policy. It follows #1575’s Required-diagnostics work while retaining existing V1 policy types and wire formats.
Changes:
Loads verified component metadata for Windows release builds, with an explicit build-time override.
Removes registry-policy enforcement and related test fixtures while preserving consent handling for published contracts.
Updates telemetry documentation, SDK references, and Windows CI configuration.
File
Description
tests/scripts/test_telemetry_etw_assertions.ps1
Uses placeholder telemetry classifications.
tests/scripts/run_telemetry_etw_smoke_test.ps1
Removes registry setup and policy-gating scenarios.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The change breaks the published V1 telemetry policy contract and can load an unverified DLL because signature verification and loading may resolve to different files.
[P2] Add CI regression coverage for the component's fail-closed build path. The new tests exercise only metadata parsing/mapping, the ETW executor explicitly disables the component, and the release consent script never tests DLL rejection. Consequently, removing or bypassing signature verification could still leave every existing check green. Add Windows build-flow cases using the bundled signed DLL as the positive control and an unsigned or signature-invalid copy as rejection controls, and assert that rejected components fail the build rather than producing an unrouted fallback. Wire these cases into Windows CI.
Update consumer docs for the routed release default
src/mxc-sdk/build/build_mxc_telemetry.rs:46
[P1] Update the consumer telemetry notice for the new release default. Selecting the bundled component makes ordinary Windows source and crates.io release builds routed too, and development-contract requests can then emit without consent or request opt-in. However, README.md still says local open-source builds do not route telemetry, and docs/telemetry.md explicitly says they do not acquire automatic Required collection. Integrators relying on those statements can ship collection without the required disclosure. Correct both consumer-facing descriptions and document the empty component-path opt-out alongside this default change.
Require the signed component for routing, reject the legacy group input,
verify and load the canonical component path, skip the bundled DLL on
non-Windows hosts, gate the signer constant on Windows, add CI checks for
the bundled, unrouted and tampered component, and update consumer docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
Removing the policy changed V1 SDK behavior: hosts with AllowTelemetry=0
would stop reporting Blocked. Restore the registry policy and its docs and
tests, keeping the signed telemetry component changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Published V1 telemetry APIs now ignore deployed blocking policies, breaking their behavioral contract and permitting consented telemetry that was previously prohibited.
[P2] This recovery instruction is incorrect for Windows release builds: unsetting the override selects the bundled component, rather than building without routing. If the bundled DLL caused the failure, following the advice repeats the failure; if an explicit override failed, it can instead produce a routed binary despite the promised unrouted result. Tell the caller to set MXC_TELEMETRY_COMPONENT_PATH to an empty value.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Routed Windows builds bypass administrator restrictions on Required telemetry, while uncleared expected Cargo failures cause Windows CI to fail before subsequent validation and artifact uploads.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Required diagnostics bypass administrative telemetry denial, and the Windows negative test propagates an expected failure code, blocking subsequent verification and artifact uploads.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Required telemetry bypasses the machine-wide administrative deny policy, and the Windows CI tamper-rejection step fails even when the component is correctly rejected.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Required telemetry bypasses the administrative deny gate in routed Windows builds, allowing emission even when policy is disabled, invalid, or unreadable.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Required telemetry can initialize and emit despite an administrative block or invalid or unreadable policy, bypassing the existing fail-closed privacy restriction.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The PowerShell opt-out example and CI check remove rather than preserve empty environment values on versions before 7.5, causing routed builds where unrouted builds are intended.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR moves the Windows telemetry routing metadata out of the MXC source tree and into a signed
mxc_telemetry.dll. The DLL is built in a separate pipeline.build.rschecks its Authenticode signature, loads it, and reads the metadata at build time. Release builds on Windows use the bundled DLL by default.Details
build_mxc_telemetry_component.rsresolves the DLL to an absolute path, verifies the signature (signerMicrosoft Corporation) before loading it, callsmxc_telemetry_metadata_v1, and fails closed on a bad signature, a null result, or a parse error. The numbers reach the crate asMXC_BUILD_*env vars.src/mxc-sdk/resources/telemetry-component/. Release builds on a Windows host use the one for the host architecture. Debug builds, non-Windows hosts and non-Windows targets are not routed.MXC_TELEMETRY_COMPONENT_PATHoverrides the DLL; an empty value forces an unrouted build.MXC_TELEMETRY_PROVIDER_GROUP_GUIDis no longer supported. A nonempty value fails Windows builds, so routing only comes from the verified component.MXC_TELEMETRY_COMPONENT_PATHso it stays unrouted.HKLM\SOFTWARE\Policies\Mxc\AllowTelemetry),PolicyState, the FFI and the SDK policy APIs keep their existing behavior.README.md,docs/telemetry.mdand the developer telemetry and CI docs to explain that Windows release builds from source are routed, and how to build without routing.Build.Windows.Job.ymlchecks the default bundled release build, the empty-path unrouted build, and that a tampered DLL fails the signature check.References
Tests
From
src:cargo fmt --all -- --check: passedcargo test --locked -p mxc-sdk --lib --features test-support,isolation_session -- telemetry: 284 passedcargo clippy --locked -p mxc-sdk -p mxc_ffi -p wxc --all-targets --features test-support,isolation_session -- -D warnings: passedcargo check --locked --release -p mxc-sdk --lib: passed with the bundled DLL, passed with an emptyMXC_TELEMETRY_COMPONENT_PATH, and failed with "no valid Authenticode signature" for a tampered copyOther checks:
node scripts/check-telemetry-policy-parity.js: passedNot run: Node and .NET SDK tests after the revert, the
.ps1scripts on an elevated Windows host, Linux/macOS Clippy locally, and Microsoft ingestion acceptance.