Repository navigation
Replies: 1 comment
|
Root cause: dsh had tagged the venv executables with a Low Mandatory Integrity Level SACL. Low-IL processes are Windows-sandbox-restricted to Running Great job dsh for wasting time 👎 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When running an application inside the DSH Windows sandbox, writes to the default application data directory (
%LOCALAPPDATA%) are denied with "Access is denied" errors. After a DSH session runs the application once, the application becomes permanently unusable outside of DSH because the directory has been labeled with Low integrity level.Steps to Reproduce
%LOCALAPPDATA%\some-appExpected: Application should either work, or gracefully handle the sandbox restriction.
Root Cause Analysis
The DSH sandbox uses a Windows ACL-based write restriction mechanism:
Workspace-based grants: DSH creates a capability SID derived from the workspace path and grants it write access only to the workspace directory and a private temp directory.
Low integrity labels: When grants are applied, DSH sets a Low integrity label (S-1-16-4096) on the granted directories.
The problem: The
%LOCALAPPDATA%directory is NOT inside the workspace, so DSH does not grant write access there. However:Persistence issue: If an application modifies files in directory
%LOCALAPPDATA%\some-app(e.g., by explicitly requesting a workspace path outside the sandbox, or through some other mechanism), and DSH applies modifications to it, the Low integrity label persists even after the sandbox session ends.Observed Behavior
After DSH initially runs code in it's sandbox:
%LOCALAPPDATA%\appTechnical Details
From
diagnose-windows-sandbox-acl.ps1documentation (lines 78-82):This is by design for DSH's security model - but it creates an unexpected user experience when applications that normally use
%LOCALAPPDATA%are run inside DSH.Suggested Improvements
Documentation: Clearly document that writing to
%LOCALAPPDATA%is not supported in DSH sandbox mode. Applications should use workspace-relative paths for data.Recovery mechanism: Provide a built-in way to remove Low integrity labels from directories when DSH exits, or provide a cleanup command.
Diagnostic skill enhancement: The
diagnose-windows-sandbox-aclskill requires elevated privileges to fix. Consider adding a DSH-level command to strip labels from non-workspace directories.Alternative approach: Consider using a different mechanism for directories outside the workspace that doesn't apply persistent Low labels.
Environment
All reactions