Skip to content

feat(ci): bwrap sandbox wrapper for pnpm install (Linux runners) - #14430

Draft
h0lybyte wants to merge 1 commit into
devfrom
chore/ci-bwrap-pnpm-sandbox
Draft

feat(ci): bwrap sandbox wrapper for pnpm install (Linux runners)#14430
h0lybyte wants to merge 1 commit into
devfrom
chore/ci-bwrap-pnpm-sandbox

Conversation

@h0lybyte

Copy link
Copy Markdown
Member

Part of #14423.

Adds scripts/ci/bwrap-pnpm.sh — a bubblewrap sandbox wrapper for pnpm install on Linux CI runners.

What it does

  • Env scrub (primary defense): --clearenv + an allowlist, so a compromised lifecycle/build script cannot read $GITHUB_TOKEN, registry tokens, or other CI secrets.
  • FS confinement: RO-root, RW holes only for the workspace + pnpm store; $HOME is tmpfs'd to hide ~/.ssh / ~/.aws / ~/.npmrc auth.
  • macOS = passthrough (bwrap is Linux-namespaces only).
  • BWRAP_KEEP_ENV escape hatch for a private-registry token if ever needed.

Not wired in yet — intentional

This PR only adds the script. It is not referenced by any workflow, so it changes nothing at runtime. Two blockers before wiring (tracked in #14423):

  1. bubblewrap must be in the ARC/KubeVirt runner image — and ARC pods usually block unprivileged userns, so it needs a setuid bwrap or a securityContext change.
  2. Then swap the install step in utils-nx-kbve-shell.yml to ./scripts/ci/bwrap-pnpm.sh install --frozen-lockfile.

Verification

bash -n + shellcheck clean.

Confines pnpm install to workspace + store (RO-root), tmpfs's $HOME to
hide credentials, and scrubs secret env (--clearenv + allowlist) so a
compromised postinstall cannot read $GITHUB_TOKEN / registry tokens.
Linux-only; macOS = passthrough. Not yet wired into any workflow (needs
bubblewrap in the runner image). Refs #14423.
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.

1 participant