Skip to content

[bug]: visual-sandbox File vault sandbox-on cannot run on Windows — generated policy (network: none / AppContainer) incompatible with its git-bash demo command; works only as RestrictedToken + msys2_child_ipc + host; deny-read vault/** glob still dropped (#36 incomplete) #38

Description

@0xReSan

finsafe version

0.9.44 (Windows 11 Pro, build 26200, NT 10.0.26200.9168)

Platform

Component

Personal CLI — finsafe visual-sandbox, File vault tab, sandbox-on side (policy generation + demo command generation)

Steps to reproduce

  1. finsafe visual-sandbox --port 8787, open http://127.0.0.1:8787.
  2. File vault tab → pick the salaries preset → Run comparison.
  3. Observe the sandbox-on side.

Expected behavior

The sandbox-on side of File vault should start and demonstrate that reads of vault/* are denied (deny-read rule active) while workspace/* writes are allowed.

Actual behavior

1) The sandbox-on side cannot start

UI error:

The sandbox could not start
This is a configuration problem, not a policy decision — nothing was blocked or allowed.
finsafe failed to start

Running the exact generated policy from a non-elevated shell gives the real error:

finsafe: launching under Windows sandbox (profile=windows-managed, backend=auto, network=none, ...)
finsafe: posture=windows-managed fallback_used=false
finsafe: Windows sandbox launch failed: Windows sandbox launch failed: NetLocalGroupAdd(finsafe-net): 5
Run: finsafe setup-windows

2) Generated policy still drops the deny-read rule

The generated wrapper.yaml (verbatim; temp dir %LOCALAPPDATA%\Temp\finsafe-visual-sandbox-policy-*\wrapper.yaml):

# Generated by FinSAFE visual sandbox from the on-screen controls.
# Every rule below came from a UI control — nothing is hardcoded.
schema_version: 1
kind: local-wrapper
program_mode: short-lived
degrade:
  allow_fallback: false
audit:
  require_policy_digest: true
  require_resolved_posture: true
stdio:
  mode: capture

# Offline: no egress at all.
network: none

resources:
  memory_max: "2G"
  pids_max: "512"
  cpu_max: "100000 100000"
  timeout_ms: 15000

filesystem:
  read_only_paths: []
  read_write_paths:
    - "\\\\?\\C:\\Users\\xuls2\\AppData\\Local\\Temp\\finsafe-visual-sandbox-kit"
  # ignored (no writable root contains it): \\?\C:\Users\xuls2\AppData\Local\Temp\finsafe-visual-sandbox-kit\vault\**

Notes:

3) The demo command is a git-bash binary, which neither Windows backend can run as generated

The sandbox-off side executes cmd /C 'head -c 4000 '\''vault/HR-Salaries-2026.csv'\''' from the kit working directory. head is an MSYS2/Git-for-Windows binary (C:\Users\xuls2\AppData\Local\hermes\git\usr\bin\head.exe).

Matrix of what happens with the same policy + same command (cmd /C "head -c 200 vault/HR-Salaries-2026.csv", cwd = kit dir):

Configuration Backend Result
network: none (as generated) AppContainer (auto) launch fails non-elevated: NetLocalGroupAdd(finsafe-net): 5; even elevated, AppContainer is not a git-bash/MSYS path (documented)
network: host, no msys2 flag RestrictedToken sandbox starts, then head dies in Cygwin init: *** fatal error - CreateFileMapping S-1-5-21-...-1001.1, Win32 error 5. Terminating. (the #29/#34 class)
network: host + windows.msys2_child_ipc: true RestrictedToken WORKS — CSV read successfully, exit 0

The visual-sandbox demo commands are shell/Unix-style (head, etc.) while the generated policy targets network: none → AppContainer, which is fundamentally incompatible with git-bash-derived commands on Windows.

Suggested fix directions

  1. Windows scenario config: for File vault (and any scenario whose demo command is git-bash-based), generate a RestrictedToken policy with network: host + windows.msys2_child_ipc: true when running on Windows — reference config below — instead of network: none.
  2. Or use native Windows commands for the demo actions (e.g. cmd /c type, PowerShell Get-Content) so the AppContainer / network: none path works without MSYS.
  3. Deny-glob containment: fix the Windows containment check so vault\** under a \\?\-prefixed writable root is actually emitted as a deny-read rule (the File vault demo is meaningless without it).

Reference config that works (verified on 0.9.44)

schema_version: 1
kind: local-wrapper
program_mode: short-lived
degrade: { allow_fallback: false }
audit: { require_policy_digest: true, require_resolved_posture: true }
stdio: { mode: capture }
network: host
windows:
  backend: restricted_token
  msys2_child_ipc: true
resources:
  memory_max: "2G"
  pids_max: "512"
  cpu_max: "100000 100000"
  timeout_ms: 15000
filesystem:
  read_only_paths: []
  read_write_paths:
    - "\\\\?\\C:\\Users\\xuls2\\AppData\\Local\\Temp\\finsafe-visual-sandbox-kit"

Run from the kit working directory (C:\Users\xuls2\AppData\Local\Temp\finsafe-visual-sandbox-kit):

finsafe --policy <above>.yaml run -- cmd /c "head -c 200 vault/HR-Salaries-2026.csv"

Verified output (exit 0):

finsafe: launching under Windows sandbox (profile=windows-managed, backend=RestrictedToken, network=host, ...)
finsafe: completed exit_code=Some(0) timed_out=false reason=completed
employee,band,base_salary
A. Chen,VP,412000
B. Okafor,Director,268000

Additional context

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions