Test secure mode with latest bubblewrap#17
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create test/test_secure_mode.hml with comprehensive tests for:
Update .github/workflows/test.yml with new secure-mode job that: