fix(security): authenticate extension services - #2638
Draft
pimlock wants to merge 3 commits into
Draft
Conversation
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
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
Authenticate remote supervisor middleware and gateway-interceptor RPCs with short-lived, exact-audience gateway-signed JWTs. Add a shared extension client foundation so both mechanisms use the same bearer rotation and TLS/custom-CA implementation.
Related Issue
Closes #2623
Security Fix
Remote extension services previously could not cryptographically distinguish OpenShell gateway or sandbox-supervisor calls from direct network callers. This change adds authenticated caller identity and policy-constrained token distribution while preserving the existing Ed25519 signing authority and sandbox refresh API.
Severity Assessment
Changes
openshell-extension-corewith shared extension identity, claims, expiry-aware bearer slots, HTTP/HTTPS/Unix channels, and custom-CA primitives.kid,jti, and bounded expiry.RefreshSandboxTokento return only middleware credentials selected by the authenticated sandbox effective policy./.well-known/jwks.jsonfor extension verification.Testing
mise run pre-commitpassesChecklist
Example branch
The runnable authenticated middleware example is intentionally kept on the separate
2623-authenticated-middleware-example/pimlockbranch. Its service-side JWT verifier is a dedicated example module marked for future extraction into an extension-building SDK, keeping inbound verification concerns out ofopenshell-extension-core. After this PR lands, the branch can be rebased and merged separately or folded into later work.Follow-up: JWKS bootstrap
This PR publishes JWKS only after extension registration, so initial key provisioning is still out of band. A follow-up should bind the primary gateway listener immediately after loading TLS/JWT keys, serve only
/.well-known/jwks.json(503for other routes), initialize middleware/interceptors against that trusted URL, then atomically switch the same listener to the fullMultiplexService. Compute-driver callback listeners can be added later without rebinding the primary listener. Keep issuer, audience, and gateway TLS trust operator-configured; retain a JWKS-file fallback if useful. Test pre-ready routing, TLS/hostname verification, the ready transition, and cleanup after startup failure.