mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat: Add support for Linux Sandbox using Bubblewrap (#120)
* feat: Add support for bubblewrap sandbox * fix: Glob pattern expansion limit for linux * fix: Bug in glob pattern expansion for bwrap * fix: README on trust * fix: Multiple bubblewrap translator fix * test: Add E2E for linux sandbox * fix: Refactor bwrap sandbox to use common dangerous files * fix: Path test case * fix: Non-existent path handling bug * refactor: Misc cleanup * fix: Avoid bind mount for non-existentent deny protection * fix: Off by one bug in path depth handling * ci: Disable AppArmor on GHA runner * fix: Disable apparmor userns restrictions
This commit is contained in:
@@ -443,3 +443,61 @@ jobs:
|
||||
|
||||
- name: Run Sandbox E2E Test
|
||||
run: pmg --sandbox npm exec -- node test/sandbox-e2e.js
|
||||
|
||||
sandbox-e2e-linux:
|
||||
name: Sandbox E2E - Linux (Bubblewrap)
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- name: Checkout Source
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||
with:
|
||||
node-version: 20
|
||||
check-latest: true
|
||||
|
||||
- name: Install Bubblewrap
|
||||
run: sudo apt-get update && sudo apt-get install -y bubblewrap
|
||||
|
||||
- name: Verify Bubblewrap Installation
|
||||
run: bwrap --version
|
||||
|
||||
- name: Build PMG
|
||||
run: make
|
||||
|
||||
- name: Add pmg to PATH
|
||||
run: echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup PMG
|
||||
run: pmg setup install
|
||||
|
||||
- name: Create Test Directories for Sandbox Permissions Tests
|
||||
run: mkdir -p ~/.aws ~/.gcloud ~/.kube ~/.ssh ~/.gnupg ~/.docker
|
||||
|
||||
- name: Create Test Files for Sandbox Permissions Tests
|
||||
run: |
|
||||
touch ~/.aws/credentials
|
||||
touch ~/.gcloud/credentials.json
|
||||
touch ~/.kube/config
|
||||
touch ~/.ssh/id_rsa
|
||||
touch ~/.gnupg/pubring.kbx
|
||||
touch ~/.docker/config.json
|
||||
|
||||
- name: Disable AppArmor for Bubblewrap
|
||||
run: |
|
||||
sudo systemctl stop apparmor
|
||||
sudo systemctl disable apparmor
|
||||
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
|
||||
- name: Run Sandbox E2E Test
|
||||
run: pmg --sandbox --sandbox-profile npm-restrictive npm exec -- node test/sandbox-e2e.js
|
||||
|
||||
Reference in New Issue
Block a user