Skip to content

osep: add OSEP-0004 secure container runtime support#177

Open
hittyt wants to merge 1 commit intoalibaba:mainfrom
hittyt:docs/secure-container
Open

osep: add OSEP-0004 secure container runtime support#177
hittyt wants to merge 1 commit intoalibaba:mainfrom
hittyt:docs/secure-container

Conversation

@hittyt
Copy link
Collaborator

@hittyt hittyt commented Feb 5, 2026

Summary

OpenSandbox executes untrusted AI-generated code. Standard container isolation (runc) may not provide sufficient protection against container escape attempts. Secure container runtimes provide hardware-level isolation to protect the host system.

This PR add OSEP-0004: Pluggable Secure Container Runtime Support - a design proposal for integrating secure container runtimes (gVisor, Firecracker, Kata Containers) into OpenSandbox.

Testing

  • Not run (only design doc)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

- Breaks abstraction between Docker and K8s modes
- User code becomes deployment-specific

**Decision**: Rejected. The abstraction layer is essential for deployment-agnostic user code.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This conflicts with the implementation level. In Kubernetes implementations, the SRE administrator must be aware of the runtimeClass when setting the SandboxPool.

2. **Performance Overhead**: Secure runtimes add latency and resource overhead compared to runc:
- gVisor: ~10-50ms additional startup, minimal memory overhead
- Firecracker: ~125ms cold start, ~5MB memory per microVM
- Kata: ~500ms cold start, ~20-50MB memory per VM
Copy link
Collaborator

Choose a reason for hiding this comment

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

The kata-container has many underlying VM implementations, and the performance data of different implementations varies.

| Secure Runtime | Local Docker | Kubernetes | Notes |
|---------------|--------------|------------|-------|
| gVisor (runsc) | Full support | Full support | Via RuntimeClass |
| Firecracker | Partial | Full support | Docker requires containerd setup |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Docker does not natively support Firecracker and must run on Kata. There is no need to support Docker + Firecracker anymore.

[secure_runtimes.firecracker]
enabled = true
docker_runtime = "firecracker" # Requires containerd + firecracker
k8s_runtime_class = "kata-fc" # Some clusters expose via kata
Copy link
Collaborator

Choose a reason for hiding this comment

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

Firecracker cannot run "natively" as a Kubernetes CRI (Container Runtime Interface). It is a lightweight Virtual Machine Monitor (VMM) that provides microVM capabilities, while the CRI is an interface designed for container runtimes. The correct ways to use Firecracker in Kubernetes:

  • firecracker-containerd (closest to native approach)
  • Kata Containers + Firecracker

In this osep, recomand cri ish firecraker via kata ?

@jwx0925
Copy link
Collaborator

jwx0925 commented Feb 5, 2026

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants