Skip to content

Block sandbox account from mounting disks - #233

Merged
webcoyote merged 2 commits into
mainfrom
disable-mount
Sep 1, 2026
Merged

webcoyote merged 2 commits into
mainfrom
disable-mount

Conversation

@webcoyote

@webcoyote webcoyote commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Prevent sandbox account from mounting disks

webcoyote referenced this pull request in MikeMcQuaid/sandvault Sep 1, 2026
Use macOS sandbox-exec to prevent the sandvault user from accessing
external drives mounted in /Volumes. The sandbox profile denies all
file operations on /Volumes except for /Volumes/Macintosh HD.

The profile is stored in /var/sandvault/ with root ownership (mode 0444)
so the sandvault user cannot modify it.

Fixes webcoyote#9
@MikeMcQuaid

Copy link
Copy Markdown
Contributor

@webcoyote Just a thought: will this prevent the Xcode tools from installing Metal? I know it needs to do a disk mount for this and seems to be a per-user operation.

@webcoyote

Copy link
Copy Markdown
Owner Author

@webcoyote Just a thought: will this prevent the Xcode tools from installing Metal? I know it needs to do a disk mount for this and seems to be a per-user operation.

Good call-out! I checked and it works:

sandvault-pat in sandvault🔒 on  disable-mount
❯ xcodebuild -showComponent MetalToolchain
Build Version: 17F109
Status: uninstalled

sandvault-pat in sandvault🔒 on  disable-mount
❯ xcodebuild -downloadComponent MetalToolchain
Beginning asset download...
Downloaded asset to: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/5f4a441a6d0a11f2e9b28c67384263afe92320f7.asset/AssetData/Restore/022-21788-058.dmg
Done downloading: Metal Toolchain 17F109.

sandvault-pat in sandvault🔒 on  disable-mount took 18s
❯ xcodebuild -showComponent MetalToolchain   # expect: installed
Asset Path: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/5f4a441a6d0a11f2e9b28c67384263afe92320f7.asset/AssetData
Build Version: 17F109
Status: installed
Toolchain Identifier: com.apple.dt.toolchain.Metal.32023.883
Toolchain Search Path: /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.6.109.0.NK2RrA

sandvault-pat in sandvault🔒 on  disable-mount
❮ cat > /tmp/t.metal <<'EOF'
  #include <metal_stdlib>
  kernel void k() {}
EOF

sandvault-pat in sandvault🔒 on  disable-mount
❯ xcrun metal -c /tmp/t.metal -o /tmp/t.air

(no errors)

@webcoyote
webcoyote enabled auto-merge September 1, 2026 22:27
@webcoyote
webcoyote merged commit 42460b7 into main Sep 1, 2026
2 checks passed
@webcoyote
webcoyote deleted the disable-mount branch September 1, 2026 22:31
@MikeMcQuaid

Copy link
Copy Markdown
Contributor

Thanks for checking 🙇‍♂️

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