Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions .github/workflows/websocket-conformance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: WebSocket Conformance

on:
workflow_dispatch: {}
# Add `schedule:` here after this focused lane has burned in manually.

permissions: {}

jobs:
build-gateway:
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-build.yml
with:
component: gateway
platform: linux/amd64

build-supervisor:
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-build.yml
with:
component: supervisor
platform: linux/amd64

websocket-conformance:
name: WebSocket Conformance
needs: [build-gateway, build-supervisor]
runs-on: linux-amd64-cpu8
timeout-minutes: 30
permissions:
contents: read
packages: read
container:
image: ghcr.io/nvidia/openshell/ci:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/runner/_work:/home/runner/_work
env:
MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAG: ${{ github.sha }}
OPENSHELL_REGISTRY: ghcr.io/nvidia/openshell
OPENSHELL_REGISTRY_HOST: ghcr.io
OPENSHELL_REGISTRY_NAMESPACE: nvidia/openshell
OPENSHELL_REGISTRY_USERNAME: ${{ github.actor }}
OPENSHELL_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v6

- name: Install OS test dependencies
run: apt-get update && apt-get install -y openssh-client && rm -rf /var/lib/apt/lists/*

- name: Log in to GHCR
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Run WebSocket conformance e2e
env:
OPENSHELL_SUPERVISOR_IMAGE: ${{ format('ghcr.io/nvidia/openshell/supervisor:{0}', github.sha) }}
run: mise run --no-deps --skip-deps e2e:websocket-conformance
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions architecture/security-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ with the sandbox's ephemeral CA and inspect method/path or protocol-specific
metadata before forwarding. The proxy also supports credential injection on
terminated HTTP streams when policy allows the endpoint.

Raw streams, HTTP upgrades, and long-lived response bodies are connection
scoped. Policy reloads affect the next connection or the next parsed HTTP
request; they do not rewrite bytes already being relayed.
Raw streams and long-lived response bodies are connection scoped. Policy
reloads affect the next connection or the next parsed HTTP request; they do not
rewrite bytes already being relayed. HTTP upgrades switch to raw relay by
default. A `protocol: rest` endpoint can opt in to
`websocket_credential_rewrite` for client-to-server WebSocket text messages
after an allowed `101` upgrade; server-to-client traffic and all other upgraded
protocols remain raw passthrough.

## Live Updates

Expand Down
7 changes: 4 additions & 3 deletions crates/openshell-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ const POLICY_EXAMPLES: &str = "\x1b[1mALIAS\x1b[0m
$ openshell policy get my-sandbox
$ openshell policy set my-sandbox --policy policy.yaml
$ openshell policy update my-sandbox --add-endpoint api.github.com:443:read-only:rest:enforce
$ openshell policy update my-sandbox --add-endpoint realtime.example.com:443:read-write:websocket:enforce:websocket-credential-rewrite,allowed-ip=10.0.0.0/8
$ openshell policy update my-sandbox --add-allow 'api.github.com:443:GET:/repos/**'
$ openshell policy set --global --policy policy.yaml
$ openshell policy delete --global
Expand Down Expand Up @@ -1403,19 +1404,19 @@ enum PolicyCommands {
#[arg(add = ArgValueCompleter::new(completers::complete_sandbox_names))]
name: Option<String>,

/// Add or merge an endpoint: host:port[:access[:protocol[:enforcement]]].
/// Add or merge an endpoint: host:port[:access[:protocol[:enforcement[:options]]]].
#[arg(long = "add-endpoint")]
add_endpoints: Vec<String>,

/// Remove an endpoint: host:port.
#[arg(long = "remove-endpoint")]
remove_endpoints: Vec<String>,

/// Add a REST allow rule: `host:port:METHOD:path_glob`.
/// Add a REST or WebSocket method/path allow rule: `host:port:METHOD:path_glob`.
#[arg(long = "add-allow")]
add_allow: Vec<String>,

/// Add a REST deny rule: `host:port:METHOD:path_glob`.
/// Add a REST or WebSocket method/path deny rule: `host:port:METHOD:path_glob`.
#[arg(long = "add-deny")]
add_deny: Vec<String>,

Expand Down
Loading
Loading