Skip to content

Feature/secure access#745

Merged
Pangjiping merged 5 commits intoalibaba:mainfrom
ninan-nn:feature/secured_access
Apr 23, 2026
Merged

Feature/secure access#745
Pangjiping merged 5 commits intoalibaba:mainfrom
ninan-nn:feature/secured_access

Conversation

@ninan-nn
Copy link
Copy Markdown
Collaborator

@ninan-nn ninan-nn commented Apr 17, 2026

Background

Today, sandbox endpoints exposed through Kubernetes ingress gateway mode are reachable as long as the caller knows the public endpoint. We need an opt-in way to require an additional sandbox-scoped credential for endpoint access.

What changed

This PR adds secureAccess support for sandbox endpoint access.

Spec

  • add optional secureAccess: boolean to CreateSandboxRequest
  • document that secured endpoint responses include required access headers

Server

  • validate runtime/exposure compatibility for secureAccess
  • reject secureAccess=true for Docker runtime
  • reject secureAccess=true unless Kubernetes ingress.mode='gateway'
  • generate a secure access token during sandbox creation
  • persist the token in workload annotations
  • attach OPENSANDBOX-SECURE-ACCESS to endpoint response headers

Ingress

  • extend sandbox endpoint resolution to include secure access metadata
  • enforce OPENSANDBOX-SECURE-ACCESS on incoming requests
  • return 401 when the header is missing or invalid
  • strip the secure access header before forwarding HTTP traffic to backend

Kotlin SDK

  • add secureAccess(...) support to sandbox builder and pool creation spec
  • pass secureAccess through create sandbox requests
  • ensure endpoint headers are propagated to execd/generated API requests
  • redact the secure access header in HTTP logs

Tests

  • add server unit tests for schema, Docker rejection, and Kubernetes token/header wiring
  • add ingress tests for secure access enforcement
  • add Kotlin SDK tests for request mapping and endpoint header propagation
  • add Java E2E coverage for secured and unsecured endpoint access

Notes

  • secureAccess is currently supported only for Kubernetes sandboxes exposed through ingress.mode='gateway'
  • default behavior remains unchanged when secureAccess is omitted or false

@ninan-nn ninan-nn changed the title Feature/secured access Feature/secure access Apr 17, 2026
@ninan-nn ninan-nn force-pushed the feature/secured_access branch 2 times, most recently from edeea64 to a19ee12 Compare April 17, 2026 11:21
@ninan-nn ninan-nn marked this pull request as ready for review April 20, 2026 02:31
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a19ee125c1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/opensandbox_server/services/docker.py Outdated
Pangjiping
Pangjiping previously approved these changes Apr 20, 2026
@ninan-nn ninan-nn force-pushed the feature/secured_access branch from a19ee12 to e5ff793 Compare April 21, 2026 03:14
@ninan-nn ninan-nn requested a review from Spground as a code owner April 21, 2026 03:14
@ninan-nn ninan-nn force-pushed the feature/secured_access branch 2 times, most recently from 38cd994 to c2510f5 Compare April 21, 2026 04:27
@ninan-nn ninan-nn force-pushed the feature/secured_access branch from c2510f5 to 92e1201 Compare April 21, 2026 04:50
Pangjiping
Pangjiping previously approved these changes Apr 21, 2026
Copy link
Copy Markdown
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Collaborator

@hittyt hittyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pangjiping Pangjiping merged commit d069769 into alibaba:main Apr 23, 2026
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants