Repository navigation
Conversation
- Add SYS_keyctl, SYS_add_key and SYS_request_key as unconditional EPERM entries in both the main workload filter (sandbox/linux/seccomp.rs) and the spawned-child filter (linux/child_seccomp.rs). - Kernel keyrings are shared with the boundary process at the same UID, and request_key(2) can invoke the root-owned /sbin/request-key upcall outside the sandbox's logging and mediation. - Extend unconditional_blocks_present_in_filter to pin the new blocks. Signed-off-by: ytfh44 <82327657+ytfh44@users.noreply.github.com>
This branch has not been deployed
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.
Summary
The Linux workload seccomp filters allowed the kernel keyring syscall family (
keyctl,add_key,request_key) through the default-allow path. This change blocks all three unconditionally in both the main workload filter and the spawned-child filter.Related Issue
Closes #5989
Changes
crates/openshell-sandbox/src/sandbox/linux/seccomp.rs: addSYS_keyctl,SYS_add_key,SYS_request_keyto the unconditional block list inbuild_filter_rules, and extendunconditional_blocks_present_in_filterto pin themcrates/openshell-sandbox/src/linux/child_seccomp.rs: add the same three syscalls to the spawned-child unconditional deny arrayKernel keyrings are shared with the boundary process at the same UID, and
request_key(2)can invoke the root-owned/sbin/request-keyupcall outside the sandbox's logging and mediation.Release Notes
Sandboxed workloads can no longer invoke the Linux kernel keyring syscalls (
keyctl,add_key,request_key); they now fail with EPERM like other blocked syscall families.Testing
rustfmt --checkclean;cargo +1.98.1 check -p openshell-sandboxpasses on Windows (Linux-gated modules are cfg'd out locally; CI covers the Linux build)unconditional_blocks_present_in_filternow asserts the three new unconditional blocksChecklist