Skip to content

ooeygui/sandbox_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sandbox.cli

Windows-native least-privilege launcher CLI implemented in modern C++.

Status

Phase 1, 2, and 3 implementation features are now present in the CLI:

  • Sandbox user lifecycle with DPAPI-protected credentials.
  • Hardened run pipeline with restricted token path, low-integrity support, and job object limits.
  • Configurable network policy defaults, timeout, memory limits, and CPU time caps.
  • GPU opt-in behavior with integrity fallback to medium for compatibility.
  • Python/Rust/GPU verification checks.
  • Password rotation, structured status output, and persistent run logs.
  • Ephemeral one-shot sandbox mode.

Build (Visual Studio Native)

  1. Open sandbox_cli.sln in Visual Studio 2022.
  2. Select x64 and either Debug or Release.
  3. Build the solution.

Command-line build with MSBuild Developer Command Prompt:

msbuild .\sandbox_cli.sln /p:Configuration=Release /p:Platform=x64

Commands

# Create a persistent sandbox profile and local user
sandbox-cli init --name dev

# Run a command in sandbox user context
sandbox-cli run --name dev -- python --version

# Run with additional controls
sandbox-cli run --name dev --integrity low --network restricted --timeout 120 --env MY_FLAG=1 -- gpu-tool.exe

# Run one-shot ephemeral sandbox (create -> run -> remove user)
sandbox-cli run --ephemeral -- rustc --version

# Check status
sandbox-cli status --name dev

# Verify Python/Rust/GPU prerequisites
sandbox-cli verify --name dev

# Rotate sandbox user password and refresh profile secret
sandbox-cli rotate-password --name dev

# Show or change global configuration
sandbox-cli config --show
sandbox-cli config --set network_default=allow --set default_integrity=medium

# Show recent audit logs
sandbox-cli logs --tail 50

# Remove user + profile metadata
sandbox-cli cleanup --name dev

Run Options

sandbox-cli run supports:

  • --name <sandbox> for persistent profiles.
  • --ephemeral for one-shot profile/user lifecycle.
  • --integrity low|medium.
  • --network allow|restricted.
  • --gpu to enable GPU execution path.
  • --env KEY=VALUE (repeatable).
  • --workdir <path>.
  • --timeout <seconds>.
  • --rotate-after to rotate password after successful run.
  • --json to emit machine-readable execution summary.

Configuration

Global config is stored at:

  • %LOCALAPPDATA%\\sandbox.cli\\config.ini

Supported keys:

  • network_default=restricted|allow
  • default_integrity=low|medium
  • gpu_mode=off|compute|graphics
  • timeout_seconds=<int>
  • memory_mb=<int>
  • cpu_time_ms=<int>
  • rotate_after_run=true|false

Security Notes

  • init, cleanup, and rotate-password generally require Administrator privileges.
  • When --gpu is used, low-integrity is relaxed to medium-integrity for compatibility.
  • Network mode is policy-signaled and logged (allow or restricted) with restricted as default.
  • Process tree control is enforced with job object limits and kill-on-close behavior.

Log File

  • %LOCALAPPDATA%\\sandbox.cli\\sandbox.log
  • Contains lifecycle, run, verify, config, and cleanup audit events.

About

Sandboxing CLI for Windows

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages