Skip to content

Test secure mode with latest bubblewrap#17

Merged
nbeerbower merged 3 commits into
mainfrom
claude/test-secure-bubblewrap-3q09U
Jan 10, 2026
Merged

Test secure mode with latest bubblewrap#17
nbeerbower merged 3 commits into
mainfrom
claude/test-secure-bubblewrap-3q09U

Conversation

@nbeerbower

Copy link
Copy Markdown
Contributor
  • Create test/test_secure_mode.hml with comprehensive tests for:

    • Bubblewrap installation and namespace support
    • Basic sandbox execution (print, arithmetic, functions, loops)
    • Filesystem isolation (blocking writes to /etc, /home, root)
    • Network isolation (--unshare-net)
    • Process isolation (running as uid 65534)
    • Grove secure mode configuration verification
  • Update .github/workflows/test.yml with new secure-mode job that:

    • Installs bubblewrap on Ubuntu
    • Verifies kernel namespace support
    • Tests bwrap execution with hemlock
    • Tests JSON stdlib in sandbox
    • Verifies filesystem and network isolation
    • Runs the secure mode test suite
    • Tests Grove startup with GROVE_SECURE_MODE=1
    • Adds lint checks for test files and setup script

- Create test/test_secure_mode.hml with comprehensive tests for:
  - Bubblewrap installation and namespace support
  - Basic sandbox execution (print, arithmetic, functions, loops)
  - Filesystem isolation (blocking writes to /etc, /home, root)
  - Network isolation (--unshare-net)
  - Process isolation (running as uid 65534)
  - Grove secure mode configuration verification

- Update .github/workflows/test.yml with new secure-mode job that:
  - Installs bubblewrap on Ubuntu
  - Verifies kernel namespace support
  - Tests bwrap execution with hemlock
  - Tests JSON stdlib in sandbox
  - Verifies filesystem and network isolation
  - Runs the secure mode test suite
  - Tests Grove startup with GROVE_SECURE_MODE=1
  - Adds lint checks for test files and setup script
- Add step to enable unprivileged user namespaces in CI workflow
  - Set kernel.unprivileged_userns_clone=1
  - Disable AppArmor namespace restrictions if present

- Update test_secure_mode.hml to gracefully skip bwrap tests when:
  - bwrap is not installed
  - User namespaces are not available (permission denied)

- Add BWRAP_AVAILABLE check that runs at test startup and prints
  helpful messages about how to enable user namespaces

This ensures tests pass in restricted environments while still
validating Grove's secure mode configuration.
The bwrap sandbox needs access to the hemlock binary which is built
in the workspace, not in standard system paths.

Changes:
- Add HEMLOCK_DIR env var in CI workflow pointing to hemlock build dir
- Update all bwrap commands to --ro-bind $HEMLOCK_DIR and include it in PATH
- Update test_secure_mode.hml to detect hemlock directory via `which`
- Build bwrap command with dynamic hemlock directory bind
@nbeerbower
nbeerbower merged commit 3bd6c7a into main Jan 10, 2026
6 checks passed
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