Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
e5155fb
test(macos): assert what the aliasing probes show instead of logging it
ronleizrowice-ant Sep 18, 2026
17cb628
test(glob): cover bracket sets in globToRegex, and check it against a…
ronleizrowice-ant Sep 18, 2026
f7b4bd8
test(windows): put patterns in the swept corpus so the glob branch is…
ronleizrowice-ant Sep 18, 2026
4bfe3c2
test(sigv4): sign each vector a second time with the header set reversed
ronleizrowice-ant Sep 18, 2026
4db3603
test(linux): fail the seccomp suite when a sandbox dependency is missing
ronleizrowice-ant Sep 18, 2026
6e566a2
test: pin the package's public export list
ronleizrowice-ant Sep 18, 2026
03b1a5b
test: drive the mandatory-deny cases off the exported constants
ronleizrowice-ant Sep 18, 2026
621f497
Merge remote-tracking branch 'origin/main' into fix/glob-to-regex-neg…
ronleizrowice-ant Sep 19, 2026
3aeca04
fix(glob): read a pattern once, so a path spelled like a placeholder …
ronleizrowice-ant Sep 19, 2026
2c417ce
fix(glob): a leading ! or ^ negates a bracket set
ronleizrowice-ant Sep 19, 2026
e392ac5
docs: name the negated bracket set, and drop a fence the walk no long…
ronleizrowice-ant Sep 19, 2026
3f6f80c
windows: the mandatory write denies the working directory carries
ronleizrowice-ant Sep 20, 2026
673b30c
windows: stamp the mandatory denies with the session's file-access set
ronleizrowice-ant Sep 20, 2026
149e7c6
docs: what the Windows mandatory denies cover, and what they do not
ronleizrowice-ant Sep 20, 2026
f6b1ce5
Merge remote-tracking branch 'origin/main' into fix/glob-to-regex-neg…
ronleizrowice-ant Sep 20, 2026
3133594
build: type against Node 22 and Bun 1.4, and check the tls options by…
ronleizrowice-ant Sep 21, 2026
98d1548
ci: pin ripgrep, Node and the actions, and enforce the lockfile
ronleizrowice-ant Sep 21, 2026
6384a68
globToRegex: write a `-` that is a set member first, with no backslash
ronleizrowice-ant Sep 21, 2026
b7fc80a
Raise the engines floor to Node 22
ronleizrowice-ant Sep 21, 2026
d6b977d
test: run the built package bundled, minified and as bytecode
ronleizrowice-ant Sep 21, 2026
5401685
ci: a bundled-bytecode step, an Alpine container and a macOS 26 leg
ronleizrowice-ant Sep 21, 2026
9abe353
test: build the embedder both ways, and run it with no package around it
ronleizrowice-ant Sep 21, 2026
87b5756
ci: install bun in the containers from its release archive, by checksum
ronleizrowice-ant Sep 21, 2026
093576e
test: reach the helper and ripgrep by running the embedder under thei…
ronleizrowice-ant Sep 21, 2026
9ae0274
whichSync: search PATH inside the process, on Node as well
ronleizrowice-ant Sep 21, 2026
76e09c0
Take host-side helpers only from where the sandboxed command cannot w…
ronleizrowice-ant Sep 21, 2026
10cea5e
README: where bubblewrap, socat and ripgrep are taken from
ronleizrowice-ant Sep 21, 2026
9ab1799
Look npm up on a PATH without what the sandboxed command can write
ronleizrowice-ant Sep 22, 2026
23ffc8f
Judge a PATH entry by the file it would give, not only as a directory
ronleizrowice-ant Sep 22, 2026
f04fc43
hostSearchPath: judge whatever is at the name, joined as the shell joins
ronleizrowice-ant Sep 22, 2026
de9aad7
linux: a read-deny glob stays in its own tree, and its walk has a budget
ronleizrowice-ant Sep 25, 2026
883cf6a
test: the tree a read-deny glob stays in, and the budget of its walk
ronleizrowice-ant Sep 25, 2026
c2bb9c8
README: the tree of a denyRead pattern on Linux, and the budget
ronleizrowice-ant Sep 25, 2026
99a93d1
linux: the read configuration says which links its patterns left unfo…
ronleizrowice-ant Sep 25, 2026
f9ef1a8
Say exactly which links unfollowedDenyLinks holds
ronleizrowice-ant Sep 25, 2026
cbc1200
linux: a read-deny glob never lists outside its tree
ronleizrowice-ant Sep 25, 2026
fc9c36d
test: nothing outside a read-deny glob's tree is listed, matched or not
ronleizrowice-ant Sep 25, 2026
b84e5c5
README: what a denyRead pattern's tree leaves out, in full
ronleizrowice-ant Sep 25, 2026
f3bc5f0
linux: the read-deny walk follows links as before; only the budget stays
ronleizrowice-ant Sep 26, 2026
60da702
test: a match behind a link out of the tree stays denied, within the …
ronleizrowice-ant Sep 26, 2026
48151af
README: the budget of the denyRead expansion; links as before
ronleizrowice-ant Sep 26, 2026
0b19ff9
Shorten the comments this change adds
ronleizrowice-ant Sep 28, 2026
09cc96d
Shorten the comments this change adds
ronleizrowice-ant Sep 28, 2026
1d8146b
Shorten the comments this change adds
ronleizrowice-ant Sep 28, 2026
30480ee
Shorten the comments this change adds
ronleizrowice-ant Sep 28, 2026
b7f0918
globToRegex: write set members bare, and test the sets under sandbox-…
ronleizrowice-ant Sep 28, 2026
faed62f
linux: a read-deny glob budget that real trees fit in, and an option …
ronleizrowice-ant Sep 28, 2026
4d5c7a4
windows: test three ways the mandatory denies could fail, and run the…
ronleizrowice-ant Sep 28, 2026
5707925
denyReadGlobBudget: refuse a key it does not know
ronleizrowice-ant Sep 28, 2026
179d99a
Merge branch 'main' into fix/windows-mandatory-denies
ronleizrowice-ant Sep 28, 2026
4af01bb
Host helpers: count an allowed write path only as the wrap binds it
ronleizrowice-ant Sep 28, 2026
ac608ae
test: building a wrap runs no planted bubblewrap, whatever the options
ronleizrowice-ant Sep 28, 2026
e54050c
windows: recompute deny set per exec and pin .git ancestor chain
ant-kurt Aug 21, 2026
a73b75d
windows: one mandatory set for every command, and a read deny that a …
ronleizrowice-ant Sep 29, 2026
287e378
test: name the helpers in the empty-HOME wrap, which allows writes to…
ronleizrowice-ant Sep 29, 2026
aa1ab72
docs: name the usual case in which no host helper is left
ronleizrowice-ant Sep 29, 2026
dd56018
linux: host_helper_unavailable says what it passed over as fields too
ronleizrowice-ant Sep 29, 2026
493cfff
test: read the passed-over copy's `path` in the Node test too
ronleizrowice-ant Sep 29, 2026
006e9aa
windows: hold the directory-level denies for the session, and skip a …
ronleizrowice-ant Sep 29, 2026
dceb160
test(windows): M11 compares the ACEs, not icacls' text
ronleizrowice-ant Sep 29, 2026
7acbfe0
windows: release one path at a time, and write each directory once at…
ronleizrowice-ant Sep 29, 2026
bcceb73
windows: hold every deny for the session, and check it again at every…
ronleizrowice-ant Sep 29, 2026
8b93f02
windows: what the sandbox account owns among the denied is taken over…
ronleizrowice-ant Sep 29, 2026
89fab6d
test(windows): read owners with pwsh, and expand the 8.3 name of the …
ronleizrowice-ant Sep 29, 2026
972068b
windows: what is taken over loses what its owner wrote, and the walk …
ronleizrowice-ant Sep 29, 2026
63b5cb4
A write deny keeps the symbolic links on the way to it in place
ronleizrowice-ant Oct 10, 2026
0635086
Merge main into fix/a-write-deny-on-a-link-holds-the-name-too
ronleizrowice-ant Oct 10, 2026
05a3683
Links on the way to read denies are kept too, and what a hold is said…
ronleizrowice-ant Oct 10, 2026
154c32a
test: macOS follows fewer links than Linux, and one row had nothing t…
ronleizrowice-ant Oct 10, 2026
f88e744
Merge main into the toolchain pins
claude Oct 20, 2026
c01c372
Merge the toolchain pins, with main in them, into the new legs
claude Oct 20, 2026
ba0a884
Merge main into the read-deny glob budget
claude Oct 20, 2026
6ea4cea
Merge main into the links kept on the way to a deny
claude Oct 20, 2026
8be91e7
Merge main into the negated bracket sets
claude Oct 20, 2026
54716d5
package.json: test:bundled after typecheck, which it starts with
claude Oct 20, 2026
a383b79
Merge main into the host helpers taken from outside the write paths
claude Oct 20, 2026
b0f47a3
test: a negated set with a `-` under sandbox-exec, and a `,` for the …
claude Oct 20, 2026
438380f
test: read EBUSY as either C library words it
claude Oct 20, 2026
4f8bc03
test: name the helpers where a case allows writes to /usr
claude Oct 20, 2026
cf6cfdd
ci: what a review of the whole change found
claude Oct 20, 2026
d90089f
Merge branch 'ci/pin-toolchain' into ci/more-legs
claude Oct 20, 2026
bc03da8
ci: what a review of the whole change found, in the new legs
claude Oct 20, 2026
9c54fab
ci: a simplification pass over the whole change
claude Oct 20, 2026
4aaa50d
Merge branch 'ci/pin-toolchain' into ci/more-legs
claude Oct 20, 2026
adbae33
ci: a simplification pass over the new legs
claude Oct 20, 2026
b34cef5
linux: what a review of the whole glob budget found
claude Oct 20, 2026
1951705
linux: the glob budget in a third of the lines
claude Oct 20, 2026
dcc0f33
What a review of the whole diff found in the links on the way to a deny
claude Oct 20, 2026
c479240
glob: write a set the way a macOS profile was measured to read it
claude Oct 20, 2026
2c01587
linux: what a second review of the glob budget found
claude Oct 20, 2026
bab2847
WIP: host helpers judged in one place (tests of its own suite not yet…
claude Oct 20, 2026
b0aa23a
Merge main, and take its tree: the mandatory denies are written anew …
claude Oct 20, 2026
80ca316
windows: the mandatory write denies, on the kept grants
claude Oct 20, 2026
19da72c
glob: leave what is beyond ASCII in a set where it was written
claude Oct 20, 2026
4c9a85d
A simplification pass over the source of the links on the way to a deny
claude Oct 20, 2026
f508a02
WIP: the suite of the host helpers for the new shape (512 lines, was …
claude Oct 20, 2026
08d1132
test: the links on the way to a deny in 671 lines, where there were 1…
claude Oct 20, 2026
a6fcda6
WIP: an empty HOME no longer switches the comparison off; the which s…
claude Oct 20, 2026
37749b7
test(windows): the denied are not opened by rewriting permissions or …
claude Oct 20, 2026
71953c1
host helpers: look the shell up where it was, and shorter which suites
claude Oct 20, 2026
e8c9d28
host helpers: writablePlaces leaves the resolving to normalizePathFor…
claude Oct 20, 2026
9f3106d
host helpers: drop a case that repeats another's pin
claude Oct 20, 2026
8aa1749
windows: what a review of the mandatory denies found
claude Oct 20, 2026
ef2a6d7
host helpers: what the second review found
claude Oct 20, 2026
4ac7e7e
linux: a shut directory on the way does not lift the deny of the miss…
claude Oct 20, 2026
f151d32
windows: the mandatory denies come sorted, and what the second review…
claude Oct 20, 2026
7b12bf9
Merge remote-tracking branch 'origin/fix/glob-to-regex-negation-and-p…
claude Oct 20, 2026
0e078d1
Merge remote-tracking branch 'origin/fix/linux-read-deny-glob-bound' …
claude Oct 20, 2026
bbc0996
Merge remote-tracking branch 'origin/fix/windows-mandatory-denies' in…
claude Oct 20, 2026
9748edd
Merge remote-tracking branch 'origin/fix/a-write-deny-on-a-link-holds…
claude Oct 20, 2026
96c9913
Merge remote-tracking branch 'origin/fix/host-helpers-from-trusted-pa…
claude Oct 20, 2026
fb56896
join: the helper read for --holds-links is the one the wrap runs
claude Oct 20, 2026
70b624f
TRIAL, not for merging: the seven merged together, with their joins
claude Oct 20, 2026
7b53da1
host helpers: export the new type a few lines up
claude Oct 20, 2026
5b979ee
Merge main into ci/pin-toolchain
claude Nov 6, 2026
234678f
Merge main into ci/more-legs
claude Nov 6, 2026
8a4a93f
Merge main into fix/glob-to-regex-negation-and-placeholders
claude Nov 6, 2026
369c275
Merge main into fix/linux-read-deny-glob-bound
claude Nov 6, 2026
18e1aeb
Merge main into fix/windows-mandatory-denies
claude Nov 6, 2026
2a4776d
Merge main into fix/a-write-deny-on-a-link-holds-the-name-too
claude Nov 6, 2026
cf3bd57
Merge main into fix/host-helpers-from-trusted-paths
claude Nov 6, 2026
6cb9e4e
windows: the mxc backend is handed no mandatory deny
claude Nov 6, 2026
4f3a8dd
ci: the smoke test looks at which seccomp helper is named, and dist i…
claude Nov 6, 2026
eea3465
Merge main into the trial of all seven
claude Nov 6, 2026
1895e53
Merge commit '5b979ee' into HEAD
claude Nov 6, 2026
9c5d656
Merge commit '4f3a8dd' into HEAD
claude Nov 6, 2026
f6871df
Merge commit '8a4a93f' into HEAD
claude Nov 6, 2026
700a8da
Merge commit '369c275' into HEAD
claude Nov 6, 2026
9b06acf
Merge commit '6cb9e4e' into HEAD
claude Nov 6, 2026
c6e030d
Merge commit '2a4776d' into HEAD
claude Nov 6, 2026
5ac60cb
Merge commit 'cf3bd57' into HEAD
claude Nov 6, 2026
fb6e0ec
windows: what a review of the mxc guard found
claude Nov 6, 2026
503075e
ci: the step that builds dist says so
claude Nov 6, 2026
ac83299
Merge commit 'fb6e0ec966472c2100f0484a14b344f999b7832e' into HEAD
claude Nov 6, 2026
252d09c
Merge commit '503075e742ec0313db288537c0590f3360cae644' into HEAD
claude Nov 6, 2026
acac083
Merge main into ci/pin-toolchain
claude Nov 9, 2026
dd943e9
Merge main into ci/more-legs
claude Nov 9, 2026
9713af9
Merge main into fix/glob-to-regex-negation-and-placeholders
claude Nov 9, 2026
dbd699b
Merge main into fix/linux-read-deny-glob-bound
claude Nov 9, 2026
be119d2
Merge main into fix/windows-mandatory-denies
claude Nov 9, 2026
c3ae746
Merge main into fix/a-write-deny-on-a-link-holds-the-name-too
claude Nov 9, 2026
4c67c24
Merge main into fix/host-helpers-from-trusted-paths
claude Nov 9, 2026
cebfadc
Merge main into the trial of all seven
claude Nov 9, 2026
2ed1051
Merge commit 'acac083b0c022f7fab918690ed73377f164ab3ee' into trial751
claude Nov 9, 2026
2cdf409
Merge commit 'dd943e93c2a6b080b37726866d1d30caf449dfdb' into trial751
claude Nov 9, 2026
2f5282b
Merge commit '9713af921f393537b952d9d3093f945c723a886c' into trial751
claude Nov 9, 2026
24b4cdf
Merge commit 'dbd699b55de642c0022e29d1cc0cf5cdb80c9988' into trial751
claude Nov 9, 2026
c695385
Merge commit 'be119d23514a7dd2fab479266f01d95b74bf4d6a' into trial751
claude Nov 9, 2026
3952c2c
Merge commit 'c3ae7464ae67e45ab6ad938abe526b1d87b4a3f3' into trial751
claude Nov 9, 2026
9bc15b9
Merge commit '4c67c24e19b1d33d1b4d2716c65b18af53a64673' into trial751
claude Nov 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 107 additions & 24 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
# certificate and of its public key.
jobs:
integration-tests:
name: Tests (${{ matrix.os }} / ${{ matrix.arch }})
name: Tests (${{ matrix.os }} / ${{ matrix.label || matrix.arch }})
runs-on: ${{ matrix.runner }}

strategy:
Expand All @@ -32,6 +32,13 @@ jobs:
- arch: arm64
runner: macos-15
os: macos
# The newest macOS as well: the sandbox profile's own regex engine
# and what Seatbelt refuses have both moved between releases, and
# the two legs above stay on the images they name.
- arch: arm64
label: arm64-macos26
runner: macos-26
os: macos
# Windows legs build srt-win, run the Rust smoke scripts,
# then the TS integration suite (test/sandbox/winsrt.test.ts).
- arch: x86-64
Expand Down Expand Up @@ -398,7 +405,36 @@ jobs:
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y bubblewrap libseccomp-dev gcc socat ripgrep apparmor-profiles zsh
sudo apt-get install -y bubblewrap libseccomp-dev gcc socat apparmor-profiles zsh

# The library reads both the output and the exit status of ripgrep, and
# those differ between releases: for an unreadable directory exactly at
# --max-depth, 14.1.1 prints "Permission denied" and exits 2, where
# 15.2.0 passes over it and exits 0. 14.1.1 is what most installations
# have, so every later step finds it first on PATH; the second full run
# below puts 15.2.0 ahead of it. Both are upstream's archives, by the
# checksums upstream publishes. macOS runs whatever Homebrew serves.
- name: Install ripgrep 14.1.1 and 15.2.0 (Linux)
if: matrix.os == 'linux'
run: |
install_ripgrep() {
case "${{ matrix.arch }}" in
x86-64) asset=ripgrep-$1-x86_64-unknown-linux-musl.tar.gz sha256=$2 ;;
arm64) asset=ripgrep-$1-aarch64-unknown-linux-gnu.tar.gz sha256=$3 ;;
esac
curl -fsSL --retry 3 -o "$RUNNER_TEMP/$asset" "https://github.com/BurntSushi/ripgrep/releases/download/$1/$asset"
echo "$sha256 $RUNNER_TEMP/$asset" | sha256sum --check --strict
mkdir "$RUNNER_TEMP/ripgrep-$1"
tar -xzf "$RUNNER_TEMP/$asset" -C "$RUNNER_TEMP/ripgrep-$1" --strip-components=1
"$RUNNER_TEMP/ripgrep-$1/rg" --version
}
install_ripgrep 14.1.1 \
4cf9f2741e6c465ffdb7c26f38056a59e2a2544b51f7cc128ef28337eeae4d8e \
c827481c4ff4ea10c9dc7a4022c8de5db34a5737cb74484d62eb94a95841ab2f
install_ripgrep 15.2.0 \
33e15bcf1624b25cdd2a55813a47a2f95dbe126268203e76aa6a585d1e7b149c \
a740b91c82eaf9914cfedd353572f2791cbe0162c84101ee0951058f4dcbc90d
echo "$RUNNER_TEMP/ripgrep-14.1.1" >> "$GITHUB_PATH"

- name: Enable unprivileged user namespaces (Linux)
if: matrix.os == 'linux'
Expand All @@ -424,18 +460,20 @@ jobs:

- name: Install Node dependencies
if: matrix.os != 'windows'
run: npm install
run: npm ci

# Builds dist/ as `npm run build` does, which compiles src only. This is
# the one step that checks the types of test/, which bun strips at runtime.
- name: Build and typecheck
if: matrix.os != 'windows'
run: npm run typecheck

# After the type check, which builds dist/: test/smoke imports it, and
# without it the rules that read types see `any` there and say nothing.
- name: Lint (ESLint)
if: matrix.os == 'linux' && matrix.arch == 'x86-64'
run: npx eslint .

# `npm run build` compiles src only. This is the one step that checks
# the types of test/, which bun strips at runtime.
- name: Typecheck
if: matrix.os != 'windows'
run: npm run typecheck

- name: Build seccomp binaries (Linux)
if: matrix.os == 'linux'
run: npm run build:seccomp
Expand All @@ -444,10 +482,6 @@ jobs:
if: matrix.os != 'windows'
run: npm run build:java-agent

- name: Build project
if: matrix.os != 'windows'
run: npm run build

- name: Run tests
if: matrix.os != 'windows'
run: npm test
Expand All @@ -470,9 +504,9 @@ jobs:
ninja -C _build install
"$RUNNER_TEMP/bwrap-0.12/bin/bwrap" --version

- name: Run tests against bubblewrap 0.12.0 (Linux)
- name: Run tests against bubblewrap 0.12.0 and ripgrep 15.2.0 (Linux)
if: matrix.os == 'linux'
run: PATH="$RUNNER_TEMP/bwrap-0.12/bin:$PATH" npm test
run: PATH="$RUNNER_TEMP/bwrap-0.12/bin:$RUNNER_TEMP/ripgrep-15.2.0:$PATH" npm test

# RHEL 8 and 9 ship bubblewrap 0.4.0 and 0.4.1, the oldest versions in
# current distribution use, and both refuse to start on a plan that
Expand Down Expand Up @@ -515,11 +549,23 @@ jobs:
if: matrix.os != 'windows'
run: node test/utils/which-node-test.mjs

# Everything above ran with Node 22 on PATH. What runs the library under
# Node repeats on 24, in a step so that the matrix stays as it is.
- name: Setup Node.js 24
if: matrix.os != 'windows'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'

- name: Run the tests that use Node (Node 24)
if: matrix.os != 'windows'
run: npm run test:node

- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: test-results-${{ matrix.os }}-${{ matrix.arch }}
name: test-results-${{ matrix.os }}-${{ matrix.label || matrix.arch }}
path: |
test-results/
*.log
Expand Down Expand Up @@ -679,6 +725,11 @@ jobs:
with:
node-version: '22'

- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.2

- name: Enable unprivileged user namespaces on host
run: |
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
Expand All @@ -697,22 +748,22 @@ jobs:
--security-opt apparmor=unconfined \
-v "${{ github.workspace }}:/work" \
-v "$(dirname "$(dirname "$(command -v node)")")":/opt/node:ro \
-v "$(command -v bun)":/usr/local/bin/bun:ro \
-w /work \
-e SRT_E2E_DOCKER=1 \
ubuntu:24.04 \
bash -euo pipefail -c '
apt-get update -qq
# node and npm are those of the runner, bound in: no second
# piped installer, and not those of the image, which has Node
# 18, below what engines in package.json allows. bun is pinned
# to the version the rest of the matrix runs (oven-sh/setup-bun
# above). The tree carries a dozen bun-version-specific
# node, npm and bun are those of the runner, bound in: no piped
# installer, not the Node 18 of the image, which is below what
# engines in package.json allows, and the bun the rest of the
# matrix runs. The tree carries a dozen bun-version-specific
# workarounds, so "whatever bun shipped this morning" is not
# the runtime under test.
apt-get install -y -qq bubblewrap socat ripgrep python3 curl ca-certificates unzip gcc libseccomp-dev libcap2-bin
curl -fsSL https://bun.sh/install | bash -s bun-v1.4.2
export PATH="/opt/node/bin:$HOME/.bun/bin:$PATH"
apt-get install -y -qq bubblewrap socat ripgrep python3 ca-certificates gcc libseccomp-dev libcap2-bin
export PATH="/opt/node/bin:$PATH"
node --version
bun --version
npm ci
npm run build:seccomp
npm run build
Expand All @@ -721,3 +772,35 @@ jobs:
echo "== as uid 0 without CAP_SYS_ADMIN"
capsh --drop=cap_sys_admin -- -c "bun test test/docker-weak-sandbox.test.ts"
'

# The same two runs on musl, and the package as an embedder ships it.
# bubblewrap, socat, ripgrep and node are Alpine's own builds, and bun is
# its musl build, from the release archive by checksum. The rest is what
# the step above left in the workspace: node_modules and dist, which are
# JavaScript, and the seccomp helper, static against glibc, because that
# is the file the npm package brings to a musl host.
- name: Run srt end-to-end as uid 0 in an Alpine container
run: |
docker run --rm \
--cap-add SYS_ADMIN \
--security-opt seccomp=unconfined \
--security-opt apparmor=unconfined \
-v "${{ github.workspace }}:/work" \
-w /work \
-e SRT_E2E_DOCKER=1 \
alpine:3.22 \
sh -euc '
apk add --no-cache bash bubblewrap socat ripgrep python3 curl ca-certificates unzip libcap-utils libstdc++ libgcc nodejs
case "$(uname -m)" in
x86_64) bun=bun-linux-x64-musl sha256=4835eca59d6da70f4674f5642f6e459dcadab773695b2ed9922d131057989742 ;;
aarch64) bun=bun-linux-aarch64-musl sha256=71760b6c8ea30623b81a4907cb815d48e2ea266f2e73e751534a44a0607950df ;;
esac
curl -fsSL --retry 3 -o /tmp/bun.zip "https://github.com/oven-sh/bun/releases/download/bun-v1.4.2/$bun.zip"
echo "$sha256 /tmp/bun.zip" | sha256sum -c -
unzip -q /tmp/bun.zip -d /tmp
install -m 0755 "/tmp/$bun/bun" /usr/local/bin/bun
echo "== as uid 0 with CAP_SYS_ADMIN"
bun test test/docker-weak-sandbox.test.ts test/smoke/bundled.test.ts
echo "== as uid 0 without CAP_SYS_ADMIN"
capsh --drop=cap_sys_admin -- -c "bun test test/docker-weak-sandbox.test.ts"
'
Loading
Loading