Conversation
|
🌿 Preview your docs: https://nvidia-preview-pr-3492.docs.buildwithfern.com/openshell |
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
bc5e9b7 to
830e3ff
Compare
drew
left a comment
There was a problem hiding this comment.
gator-agent
PR Review Status
This maintainer-authored follow-up to #3439 is project-valid, and its docs cover the new service-authentication behavior. The initial code-only review found one blocking credential-boundary defect.
Action required: keep a gateway bearer token from ever being relayed to the sandbox service after session-cookie authentication, and add regression coverage for the two-request flow.
Blocking findings:
GATOR-830e3ff2-01: a standard gatewayAuthorizationtoken can be forwarded upstream after the new session cookie takes precedence on a later request.
Carried findings:
- None
Non-blocking suggestions:
- None
Gator metadata
- Validation: maintainer-authored gateway security work stacked on #3439 and related to #3402
- Docs: Fern docs and architecture guidance updated
- Checks: current-head branch checks are still running
- E2E: required for gateway service routing; dispatch follows resolution of blocking feedback
- Head SHA:
830e3ff2882300a81d2b375470ddacb9dadb23a6 - Base SHA:
8733df2c8db75379b512062df0129f96937721b3 - Merge base SHA:
8733df2c8db75379b512062df0129f96937721b3 - Patch ID:
d8db2c327f16082f60cce94c9a84b66fea72977a - Gator payload:
9 - Review mode:
initial - Previous reviewed SHA: none
- Review budget exhausted: no
- Maintainer decision required: no
- Next state:
gator:in-review
| ServiceCredentialSource::DedicatedHeader, | ||
| Some(token), | ||
| ) | ||
| } else if let Some(token) = cookie { |
There was a problem hiding this comment.
gator-agent
Critical — GATOR-830e3ff2-01 · Gateway token can reach the sandbox service
Summary: A cookie-preserving client that authenticates once with the documented standard Authorization header receives a service session cookie. On its next request, the cookie branch wins and the still-configured Authorization header is treated as application auth, so the sandbox service receives the user’s gateway token. A compromised service can replay that token against gateway APIs with the user’s access.
Fix: Mint the service cookie only from the dedicated OpenShell header, always consume standard Authorization as a gateway credential, and let a supplied dedicated header replace an existing cookie for safe rotation.
Verify: Send Authorization: Bearer T, retain the returned cookie, then send both on a second request; the upstream must never receive T. Also verify a dedicated header plus an old cookie authenticates with and replaces the header token.
Agent context
- Agent path: service request authentication → cookie precedence → upstream header filtering
- Ownership: This PR introduces both cookie minting from standard
Authorizationand source-dependent forwarding. - Location:
crates/openshell-server/src/service_routing.rs:237
Summary
Require gateway authentication and workspace access for remotely exposed sandbox services while preserving local loopback development. Add a dedicated OpenShell service credential channel so applications can continue using the standard
Authorizationheader.This PR is stacked on #3439.
Related Issue
Related to #3402
Changes
OpenShell-Service-Authorization, standard bearer authorization, mTLS identity, and an exact-host secure session cookieTesting
mise run pre-commitpassesAdditional verification:
cargo test -p openshell-server(1,685 passed, 8 ignored; all integration tests passed)cargo clippy -p openshell-server --all-targets -- -D warningsChecklist