Add processContainer.captureDenials config for Windows denial capture#663
Open
richiemsft wants to merge 4 commits into
Open
Add processContainer.captureDenials config for Windows denial capture#663richiemsft wants to merge 4 commits into
richiemsft wants to merge 4 commits into
Conversation
Introduce a captureDenials object under processContainer that enables the Windows deny-and-record learning-mode trace. Presence enables capture; an optional outputPath names where the ETL trace is sealed (validated absolute with an existing parent), otherwise the runner falls back to a managed per-run temp file. Config plumbing only: wire model, ContainerPolicy, parser validation, regenerated dev schema + SDK wire types, docs, and an example. Capability auto-injection and the runner trace wiring land in the follow-up integration PR (on top of #622 + #661). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
…K conformance oracle Mirror the existing learningMode treatment: captureDenials is a wire field the SDK does not surface through the policy API yet, so the compile-time conformance test must include it in the ProcessContainer OnlyInWire allow-list. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds the config-contract plumbing for Windows denial capture (“learning-mode” deny-and-record trace) by introducing a new processContainer.captureDenials object that maps from wire → domain model, validates outputPath, and updates schema/docs/examples accordingly.
Changes:
- Extend the Rust wire model with
processContainer.captureDenials: { outputPath?: string }and propagate it into the domain policy model. - Add parse-time validation + mapping for
captureDenials.outputPathinconfig_parser.rs, with unit tests. - Regenerate the dev JSON schema + Node SDK generated wire types, and update docs + an example config.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/examples/29_capture_denials.json | New example configuration demonstrating processContainer.captureDenials. |
| src/core/wxc_common/src/wire.rs | Adds CaptureDenials wire struct and hooks it into ProcessContainer. |
| src/core/wxc_common/src/models.rs | Adds ContainerPolicy.capture_denials: Option<CaptureDenialsConfig> domain field. |
| src/core/wxc_common/src/config_parser.rs | Maps + validates captureDenials (including outputPath) and adds unit tests. |
| sdk/node/src/generated/wire.ts | Codegen update reflecting the new wire schema types. |
| schemas/dev/mxc-config.schema.0.8.0-dev.json | Codegen update adding the CaptureDenials definition and field. |
| docs/schema.md | Updates the schema documentation snippet to include captureDenials. |
- validate_capture_denials_output_path now rejects filesystem-root paths (Path::parent()==None), with a new unit test. - wire.rs doc drops the unverified 'and be writable' claim (validation only checks parent existence); schema + SDK types regenerated. - Example 29 and docs/schema.md no longer show a C:\\logs path whose parent may not exist (example omits outputPath; docs note the parent must already exist). - Renamed capture_denials_threads_... test to capture_denials_accepts_... for clarity. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
/azp run |
richiemsft
marked this pull request as ready for review
July 21, 2026 16:50
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Introduce a CaptureDenialsMode enum on the captureDenials config object so a single learning-mode surface chooses between block-and-log (default; deny-by-default preserved) and allow-and-log (audit; relaxes deny-by-default, emits a security warning). Both modes record every ungranted access check; mode only decides block vs allow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
.github/copilot-instructions.md.Summary
Adds a
captureDenialsobject underprocessContainerthat will enable theWindows learning-mode trace. This is the config-contract half of the
learning-mode denial-capture feature — pure plumbing, no runtime behavior yet.
Shape —
processContainer.captureDenials: { mode?: "block-and-log" | "allow-and-log", outputPath?: string }:mode(optional) selects how each ungranted access check is handled while itis recorded. Both modes log every access the policy does not grant; the mode
only decides whether that access is blocked or allowed:
block-and-log(default) — the access stays denied and the denialis recorded. Deny-by-default containment is preserved; the safe default.
allow-and-log— the access is allowed and recorded (audit mode). Thisrelaxes deny-by-default for the run, so it is security-sensitive and the
runner emits a security warning.
modedefaults toblock-and-log. An unknown value is rejected atparse time with an error naming both valid modes.
outputPath(optional) names where the ETL trace is sealed. The OS model iscaller-controlled (
StopLearningModeTrace(trace, lpOutputPath)), so thecaller names the path; it is opened under the caller''s own identity. When
omitted, the runner will fall back to a managed per-run temp file.
directory) with actionable errors.
What''s in scope (this PR):
wire::CaptureDenials+wire::CaptureDenialsModeonwire::ProcessContainer).CaptureDenialsConfig+CaptureDenialsModeonContainerPolicy.capture_denials).config_parser.rs.schemas/dev/mxc-config.schema.0.8.0-dev.json) and SDKwire types (
sdk/node/src/generated/wire.ts) viamxc_schema_gen(codegen —not hand-edited).
docs/schema.md) + example (tests/examples/29_capture_denials.json).What''s intentionally NOT here (follow-up integration PR):
learningModeLoggingcapability whencaptureDenialsis set — that reuses the capability recognition from the capabilities PR.
block-vs-allow enforcement behind each
mode— that consumes thelearning-mode OS API.
Both land in the integration PR stacked on top of the capabilities + consume-API
PRs plus this one.
Related Issues
learningModeLoggingrecognition)Validation
cargo test -p wxc_common— 466 pass (9captureDenialstests, incl. 4modetests)cargo fmt --all -- --check,cargo clippy -p wxc_common --all-targets -- -D warningscargo check --workspace --all-targetsnpm run test:unit(SDK) — 201 passnode scripts/versioning/{validate-configs,check-schema-codegen,check-sdk-types-codegen,check-schema-versions}.jsMicrosoft Reviewers: Open in CodeFlow