Isolate gate command namespaces#134
Merged
Merged
Conversation
chasebryan
marked this pull request as ready for review
July 16, 2026 00:18
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.
What changed
/proc, and network namespaces, with an unprivileged user namespace where supportedsudofor namespace creation, then restore the invoking UID/GID, clear supplementary groups, and setno_new_privsbefore copied codeno_new_privsat runtimeunsharesupervisor is interrupted/procexposure, network restoration, lifecycle weakening, and assertion removalWhy
Closing capture descriptors 8 and 9 in copied commands prevented direct inheritance, but a same-account child could still enumerate the host
/proctree, find the trusted parent shell, and reopen those descriptors through/proc/<parent>/fd/{8,9}. Cargo's offline setting also did not prevent non-Cargo copied code from opening network connections.Private PID and
/procnamespaces remove the trusted parent from the child's process view. A private network namespace prevents new external connections at the kernel boundary. The preferred path creates these controls inside an unprivileged user namespace. GitHub's hosted Ubuntu policy rejects nested UID-map writes, so the fallback elevates only the namespace supervisor and drops back to the invoking identity before any copied command.--kill-child=KILLprevents interrupted supervision from leaving a detached namespace workload.Impact
Orange language behavior is unchanged. The Linux repository gate now requires runner-provided
unshareandsetpriv; hosts that reject unprivileged user mapping also require non-interactivesudopermission for the fixed namespace setup. Those mutable host facilities remain explicit trust dependencies.Validation
git diff --check0.2.84ProtectedControlHardeningTestsscripts/ci/check-repositoryruns after namespace integration, including the final privilege-drop fallback designunshare: write failed /proc/self/uid_map: Operation not permitted; the follow-up commit adds the privilege-dropping restricted-host path