Repository navigation
Conversation
- EmbeddedPolicyMapper hardcoded containment="isolation_session" for every non-egress mapping regardless of the configured backend, so ProcessContainer sandboxes were mapped with grant-only semantics and isolation_session sandboxes could carry filesystem policies the backend cannot enforce.
- MapCtx now carries the MxcBackend; the non-egress path derives containment ("isolation_session" / "processcontainer") from it, and the driver passes config.backend through.
- isolation_session filesystem shares are grant-only with no deny primitive, so an authored filesystem_policy would silently lose OpenShell's default-deny semantics: map_to_mxc now emits an error-severity loss and CreateSandbox is rejected. Deployments selecting backend=isolation_session with a filesystem policy must switch to processcontainer (the default, genuinely default-deny backend).
Signed-off-by: ytfh44 <82327657+ytfh44@users.noreply.github.com>
This branch has not been deployed
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.
Summary
EmbeddedPolicyMapper::maphardcodedcontainment: "isolation_session"for every non-egress mapping regardless of the configured MXC backend. This change threads the backend throughMapCtxso containment reflects the real backend, and fails closed when a grant-only backend receives a filesystem policy it cannot enforce.Related Issue
Closes #5990
Changes
crates/openshell-driver-mxc/src/policy.rs: addbackend: MxcBackendtoMapCtx; derivecontainment("isolation_session"/"processcontainer") fromctx.backendon the non-egress path instead of hardcoding"isolation_session"; update stale commentcrates/openshell-driver-mxc/src/driver.rs: passself.config.backendintoMapCtxcrates/openshell-driver-mxc/src/policy_map/map.rs:add_static_policy_lossemits an error-severity loss when containment isisolation_sessionandpolicy.filesystem.is_some(), soCreateSandboxis rejected (the backend is grant-only with no deny primitive and cannot honor OpenShell's default-deny filesystem model)embedded_rejects_filesystem_policy_on_isolation_session;embedded_rejects_network_policy_on_isolation_sessionnow exercises the real isolation_session backend;MapCtxliterals updated in unit and integration testsMigration note: deployments selecting
backend = "isolation_session"together with afilesystem_policywill now be rejected at create time; selectprocesscontainer(the default, genuinely default-deny backend) instead.Release Notes
The MXC driver no longer silently accepts filesystem policies on the grant-only
isolation_sessionbackend; such sandbox creates are rejected with a clear error. Policy mapping now reports the containment of the actually configured backend.Testing
rustfmt --checkclean on all touched files; fullcargo checkis blocked locally by a pre-existing environment issue (msvc_spectre_libsrequires VS Spectre libs via the regorus dependency) — CI must verifyChecklist