Skip to content

fix(image): let bwrap actually create its sandbox, and prove it as the job user - #321

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/bwrap-can-actually-sandbox
Aug 31, 2026
Merged

fix(image): let bwrap actually create its sandbox, and prove it as the job user#321
rldyourmnd merged 1 commit into
mainfrom
fix/bwrap-can-actually-sandbox

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

ai-stp conformance on b19 read unmeasured=7: bwrap was present and dead — kernel.apparmor_restrict_unprivileged_userns=1 denies the uid map to every unprivileged caller, nesting does not help, and only dockerd survives by being container-root. The fix is Ubuntu's own mechanism: an AppArmor profile granting userns, to /usr/bin/bwrap alone (verified live on a worker: probe exit 0). Provision runs the consumer's own probe as the runner, both smokes repeat it at boot. Aliases: b20/b13.

https://claude.ai/code/session_01LsGid6U5RrQdFvJmvYdGCF

…e job user

The b19 conformance measurement came back "cannot run this local phase
without network isolation" on a worker that carried /usr/bin/bwrap. The
binary was never the capability: Ubuntu 24.04 ships
kernel.apparmor_restrict_unprivileged_userns=1, so an unprivileged bwrap
dies at "setting up uid map: Permission denied" -- inside every worker,
docker-capable or not, because security.nesting does not lift a kernel-wide
userns restriction.

The image now carries Ubuntu's own answer for exactly this case: an AppArmor
profile granting `userns,` to /usr/bin/bwrap alone. The restriction stays in
force for everything else on the worker, untrusted pools are not widened,
and the host sysctl is untouched. Provisioning loads the profile and runs
the consumer's own probe as the runner; both smokes repeat it at boot, so a
binary-present-capability-absent image can never pass again. Aliases move to
b20/b13 (and the dormant VM manifests follow), because a recipe that
produces different bytes must not build under a promoted name.

Claude-Session: https://claude.ai/code/session_01LsGid6U5RrQdFvJmvYdGCF
@rldyourmnd
rldyourmnd force-pushed the fix/bwrap-can-actually-sandbox branch from e264fa2 to f317c81 Compare August 31, 2026 22:04
@rldyourmnd
rldyourmnd merged commit 43256c3 into main Aug 31, 2026
10 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.

1 participant