Repository navigation
feat(intune): model configuration policy evidence (#363) #526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4aece57
feat(intune): extract configuration policy evidence lane (#363)
adamgell 6e12fe0
fix(intune): close configuration CodeRabbit majors (#363)
adamgell 6e2a10d
test(intune): carry the configuration suite over the event_version fi…
adamgell 1a40c04
fix(intune): route configuration export through one ADR-004 redaction…
adamgell 3b4bfd5
fix(intune): reach configuration conflict and supersedence from the e…
adamgell 20b29ac
fix(intune): gate configuration success on assessable evidence and co…
adamgell 3108593
fix(intune): stop fabricating device scope and stop scraping foreign …
adamgell 0a7dc57
fix(intune): keep typed outcomes authoritative over free-text named d…
adamgell c461fc8
fix(intune): make the configuration reduction independent of caller o…
adamgell 8325b9b
fix(intune): close the configuration minors and the remaining CodeRab…
adamgell 3a0b174
docs(intune): document every public configuration variant and field (…
adamgell ef9e199
fix(intune): bind configuration redaction tokens to a caller-supplied…
adamgell 189c2fe
docs(intune): qualify the cross-scope token claim like its sibling
adamgell adb8b05
fix(intune): hash the caller's analysis scope verbatim
adamgell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
487 changes: 487 additions & 0 deletions
487
crates/cmtraceopen-parser/src/intune/device/windows/configuration/identity.rs
Large diffs are not rendered by default.
Oops, something went wrong.
86 changes: 80 additions & 6 deletions
86
crates/cmtraceopen-parser/src/intune/device/windows/configuration/mod.rs
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,84 @@ | ||
| //! Intune/MDM configuration policy evidence. | ||
| //! | ||
| //! Owner: issue #363 of epic #356. Implementation pending. | ||
| //! Owner: issue #363 of epic #356. | ||
| //! | ||
| //! Explains whether a setting was delivered, processed by its CSP, applied, rejected, conflicted, superseded, or left unresolved. | ||
| //! Explains whether a configuration setting was delivered, processed by its CSP, | ||
| //! applied, rejected, conflicted, superseded, removed, or left unresolved. | ||
| //! | ||
| //! This is a reserved slot created by the parser-family skeleton so that issue | ||
| //! #363 can be implemented without editing any file shared with a sibling issue. | ||
| //! Add source classification, reduction, and findings submodules here, and | ||
| //! consume the shared contracts in [`crate::intune::evidence`]. | ||
| //! # The shape of the answer | ||
| //! | ||
| //! An administrator asking "did this setting apply?" is really asking three | ||
| //! questions that routinely have different answers: | ||
| //! | ||
| //! 1. did the device *receive* a command for the node ([`ConfigurationReceiptState`]), | ||
| //! 2. what did the *CSP* do with it ([`ConfigurationLocalState`]), | ||
| //! 3. what was *Intune* told ([`ConfigurationServiceState`]). | ||
| //! | ||
| //! The output keeps all three and only then states a single | ||
| //! [`ConfigurationResolution`]. When the device and the service disagree, the | ||
| //! resolution is [`ConfigurationResolution::Contradicted`] and both statements | ||
| //! are cited; the newer one is never preferred, because the two clocks are not | ||
| //! comparable without provenance this crate is rarely given. | ||
| //! | ||
| //! # Pipeline | ||
| //! | ||
| //! ```text | ||
| //! ConfigurationInput normalized events + report rows + coverage | ||
| //! -> sources::observation_from_{event,report} one typed statement per record | ||
| //! -> reduce_configuration one transaction per CSP identity | ||
| //! -> derive_findings evidence-backed conclusions | ||
| //! ``` | ||
| //! | ||
| //! [`analyze_configuration`] runs that pipeline and stops there. Its result is | ||
| //! **not** redacted: [`ConfigurationSnapshot::redacted`] is `false` and the | ||
| //! applied values, node paths, and finding prose are the raw ones. A caller that | ||
| //! exports, persists, or transmits a snapshot must pass it through | ||
| //! [`redacted_configuration_snapshot`] first; that function is the export | ||
| //! projection, not something the analyzer applies on its own. Keeping the two | ||
| //! apart is deliberate — a caller correlating two settings by value needs the raw | ||
| //! reduction — but it means the redaction step is the caller's obligation and is | ||
| //! stated here rather than left to be inferred. | ||
| //! | ||
| //! # Boundaries | ||
| //! | ||
| //! Nothing here reads EVTX, HTML reports, the registry, or Graph. The native | ||
| //! adapter decodes those and supplies | ||
| //! [`crate::intune::normalized::NormalizedWindowsEvent`] and | ||
| //! [`crate::intune::normalized::NormalizedSettingReport`], which keeps this leaf | ||
| //! `wasm32-unknown-unknown` clean and testable from fixtures with no device | ||
| //! present. | ||
|
|
||
| mod identity; | ||
| mod models; | ||
| mod redaction; | ||
| mod reducer; | ||
| mod rules; | ||
| mod sources; | ||
|
|
||
| // The exported surface is the input contract, the snapshot's own type graph, and | ||
| // the four entry points. Projection helpers (URI canonicalization, message | ||
| // scraping, per-record classification, error-token parsing) stay internal: they | ||
| // are how this module reaches its answer, not part of the answer, and exporting | ||
| // them would commit the crate to their signatures with no caller asking for them. | ||
| pub use identity::{ConfigurationScope, ConfigurationSettingIdentity}; | ||
| pub use models::{ | ||
| ConfigurationDisposition, ConfigurationEventKind, ConfigurationEvidenceSide, | ||
| ConfigurationInput, ConfigurationLocalState, ConfigurationObservation, | ||
| ConfigurationReceiptState, ConfigurationResolution, ConfigurationServiceState, | ||
| ConfigurationSetting, ConfigurationSnapshot, ConfigurationSourceStatement, | ||
| INTUNE_CONFIGURATION_SCHEMA_VERSION, | ||
| }; | ||
| pub use redaction::redacted_configuration_snapshot; | ||
| pub use reducer::reduce_configuration; | ||
| pub use rules::derive_findings; | ||
|
|
||
| /// Reduce one evidence bundle and attach the findings derived from it. | ||
| /// | ||
| /// This is the entry point callers want; [`reduce_configuration`] and | ||
| /// [`derive_findings`] are exposed separately so a caller that wants to attach | ||
| /// supplemental evidence between the two steps can do so without re-parsing. | ||
| pub fn analyze_configuration(input: &ConfigurationInput) -> ConfigurationSnapshot { | ||
| let mut snapshot = reduce_configuration(input); | ||
| snapshot.findings = derive_findings(&snapshot); | ||
| snapshot | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.