feat(ocap-kernel): restrict kernel services to system subclusters#833
Merged
feat(ocap-kernel): restrict kernel services to system subclusters#833
Conversation
ff565fb to
ed1f3ea
Compare
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
ed1f3ea to
f8c4b5c
Compare
Tag each kernel service as restricted or unrestricted at registration time. When launching a user subcluster, throw if it requests a restricted service. System subclusters can access all services. The kernelFacet is now registered as restricted, preventing user subclusters from accessing this privileged capability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f8c4b5c to
f384e2a
Compare
FUDCo
requested changes
Feb 11, 2026
Contributor
FUDCo
left a comment
There was a problem hiding this comment.
One philosophical thing I prefer to see adjusted. If you have strong feelings to the contrary, let me know and I'll approve the PR.
Comment on lines
+233
to
+237
| if (service.systemOnly && !isSystem) { | ||
| throw Error( | ||
| `kernel service '${name}' is restricted to system subclusters`, | ||
| ); | ||
| } |
Contributor
There was a problem hiding this comment.
I think in this case I'd throw the "no registered kernel service" error, rather than leaking information about system internals and that there's a thing there that's none of your business.
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.
Closes #832
Note
Medium Risk
Introduces new authorization checks around kernel service exposure that can break subcluster launches/reloads if configs depend on previously-unrestricted services; correctness is security-relevant because it prevents privilege escalation.
Overview
Kernel services can now be marked as system-only and are blocked from user subclusters.
KernelServiceManager.registerKernelServiceObjectgains asystemOnlyoption (defaultfalse) and stores this flag onKernelService.SubclusterManager.launchSubclusteradds anisSystemlaunch option and validates requestedconfig.services, throwing if a service is missing or issystemOnlyfor non-system launches; the same validation is applied during subcluster reload and reload-all flows, and system subcluster launches are explicitly flagged as system.Kernel.provideFacet()registerskernelFacetwith{ systemOnly: true }, and tests are updated/added to cover flag defaults, retrieval, and the new access restriction behavior.Written by Cursor Bugbot for commit f8c4b5c. This will update automatically on new commits. Configure here.