Skip to content

Reject relative ProcessContainer filesystem policy paths - #1695

Open
Safet Hrbinic (safmswork) wants to merge 1 commit into
mainfrom
fix/processcontainer-absolute-policy-paths
Open

Safet Hrbinic (safmswork) wants to merge 1 commit into
mainfrom
fix/processcontainer-absolute-policy-paths

Conversation

@safmswork

@safmswork Safet Hrbinic (safmswork) commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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

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

  • Signed the Contributor License Agreement
  • Linked to an issue
  • For features or changes requiring a spec: linked the issue with maintainer-applied feature-accepted
  • For implementation: linked the required approved and merged design/API spec, or explained why no spec is required
  • Feature issue remains open unless this PR completes all agreed implementation, validation, and documentation
  • Updated documentation (if applicable)
  • Updated Copilot instructions (if build, architecture, or conventions changed)
  • If this PR changes Cargo.lock, the dependency-feed-check check passes (see pull request builds)

📋 Issue Type

  • Bug fix
  • Feature
  • Task
Microsoft Reviewers: Open in CodeFlow

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
@safmswork
Safet Hrbinic (safmswork) requested a review from a team as a code owner November 6, 2026 08:02
Copilot AI balanced review requested due to automatic review settings November 6, 2026 08:02
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment on lines +473 to +475
if let Some(rejection) = Self::filesystem_path_rejection(request) {
return rejection;
}
Comment on lines +524 to +525
if let Some(index) = paths.iter().position(|path| !Path::new(path).is_absolute()) {
return Some(BaseContainerRequestDecision::InvalidFilesystemPath { field, index });

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants