Repository navigation
Reject relative ProcessContainer filesystem policy paths - #1695
Safet Hrbinic (safmswork) wants to merge 3 commits into
Conversation
Validate all four filesystem policy lists before backend availability checks or native launch, including direct dry-run validation. Add regression-first backend and public SDK coverage, scheduled native controls, and compatibility documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 893f07dd-e993-4211-9514-19f718c8eb8f
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The V1 path-validation behavior change needs an explicit maintainer compatibility decision, and validation diagnostics can point callers to the wrong entry after list normalization.
2 open issues
What changed in this PR
This PR tightens ProcessContainer filesystem policy validation within the backend, rejecting relative paths before capability checks or native launch while leaving other backends unchanged.
Changes:
- Validate all four filesystem policy lists, including direct dry-run validation.
- Add backend, public Rust SDK, and native policy-suite regression coverage with readable-file and absolute-deny controls.
- Document caller requirements and the V1 security-servicing compatibility exception.
| File | Description |
|---|---|
tests/scripts/run_processcontainer_policy_tests.ps1 |
Adds native controls and relative-path rejection cases. |
tests/scripts/lib/processcontainer_policy_probe.ps1 |
Adds file-read and denied-access assertions. |
src/mxc-sdk/tests/streaming_processcontainer.rs |
Tests public run/spawn rejection before workload execution. |
src/mxc-sdk/src/backends/process_container/common/probe.rs |
Adapts probe diagnostics to owned rejection messages. |
src/mxc-sdk/src/backends/process_container/common/base_container_runner.rs |
Adds path validation, policy errors, and backend regressions. |
docs/schema.md |
Documents fully qualified filesystem path requirements. |
docs/development/guides/process-container-adding-os-features.md |
Explains backend validation ordering. |
docs/development/build-and-test/ci-validation-infrastructure.md |
Describes native policy-suite regression scenarios. |
docs/development/architecture/versioning.md |
Records the security-servicing compatibility exception. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The change breaks published V1 ProcessContainer compatibility without an explicit maintainer decision or versioned surface, and its validation diagnostics can identify the wrong caller path.
2 open issues
Review effort: Balanced
| ProcessContainer validates that filesystem policy paths are fully qualified | ||
| before checking host capabilities or creating a PSEC environment. The direct | ||
| backend validation path applies the same check, including dry runs. Do not | ||
| resolve relative policy paths against the launcher or workload directory. | ||
| See [filesystem policy](../../schema.md#filesystem-policy) for the caller-facing | ||
| requirements. |
There was a problem hiding this comment.
issue: this file is for telling folks how to add an os feature for mxc and then expose it through MXC. Not rreally the place to put this information. Tbh this seems more like it would be in a code coment.
| Self::Serviceable => return None, | ||
| Self::InvalidFilesystemPath { field, index } => { | ||
| return Some(format!( | ||
| "{field}[{index}] must be a fully qualified Windows filesystem path; \ |
There was a problem hiding this comment.
question: how would {field}[{index}] appear in the error text? I'm mostlly asking about the index, since I wonder what the value would refer too. My thinking would be that we should actually print the path rather than the index so the user actually knows.
| // PSEC policy paths have no working-directory base. In particular, | ||
| // a relative deny must not silently leave a broader grant in effect. | ||
| if let Some(index) = paths.iter().position(|path| !Path::new(path).is_absolute()) { | ||
| return Some(BaseContainerRequestDecision::InvalidFilesystemPath { field, index }); |
There was a problem hiding this comment.
note: would be preferrable for user diagnostics to return the path themselves tbh rather than the index.
Report escaped offending paths instead of normalized list indices, add overlap regression coverage, and move servicing notes into SDK changelogs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 893f07dd-e993-4211-9514-19f718c8eb8f
There was a problem hiding this comment.
🔵 Needs a closer look
This security-sensitive Windows containment change requires native PSEC validation of readable-file, absolute-deny, and relative-path rejection controls, whose runtime results were unavailable during static review.
No open issues 🎉
2 resolved since last review
Review effort: Balanced

Validate all four filesystem policy lists before backend availability checks or native launch, including direct dry-run validation. Add regression-first backend and public SDK coverage, scheduled native controls, and compatibility documentation.
📖 Description
Currently if we configure filesystem access as:
Allow: c:\foo
Deny: bar.txt
Because bar.txt is a relative path and there is no way to know exactly which bar.txt on the device is meant here, the results are undefined. I ran a test on Windows and it actually allows access to c:\foo\bar.txt .
So let's require fully qualified Windows paths in ProcessContainer's read/write,
read-only, denied, and enumeration-only filesystem policy lists. Reject
unresolved paths before host capability checks and native creation, including
direct backend validation and dry runs. Return a path-specific policy validation
error instead of resolving entries against the launcher or workload directory.
Keep the validation in the ProcessContainer backend. Other backends, published
SDK API shapes, released schemas, and existing absolute-path handling are
unchanged. This is a security-servicing validation fix, not a new feature or API;
no separate feature/API design spec is required. Document the compatibility
exception and caller requirements.
Add backend and public Rust SDK regressions, plus scheduled native policy-suite
coverage with host-readable and absolute-deny controls.
🔗 References
🔍 Validation
✅ Checklist
feature-acceptedCargo.lock, thedependency-feed-checkcheck passes (see pull request builds)📋 Issue Type
Microsoft Reviewers: Open in CodeFlow