Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion deploy/docker/Dockerfile.supervisor
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
# deploy/docker/.build/prebuilt-binaries/<arch>/.

# Keep the GNU runtime and CA roots without a shell or unused native TLS libraries.
# The default variant preserves UID 0 and /; compute drivers set the runtime UID.
# Compute drivers override the image's non-root default with the runtime identity.
ARG SUPERVISOR_BASE_IMAGE=gcr.io/distroless/base-nossl-debian13@sha256:f21fdfe4ede467d9ea8a6caaec1f8381ea4502243a3e8bb1c43df80c6fbaaeae
FROM ${SUPERVISOR_BASE_IMAGE} AS supervisor

ARG TARGETARCH

COPY --chmod=0555 deploy/docker/.build/prebuilt-binaries/${TARGETARCH}/openshell-supervisor /openshell-supervisor

USER 65534:65534

ENTRYPOINT ["/openshell-supervisor"]
8 changes: 4 additions & 4 deletions deploy/helm/openshell/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ rules:
- create
- get
{{- if $managedSshIngressEnabled }}
# Apply gateway-only SSH ingress isolation in managed namespaces.
# Server-side apply needs patch only for the fixed SSH policy name.
# The shared rule above provides get/create for runtime policies.
- apiGroups:
- networking.k8s.io
resources:
- networkpolicies
resourceNames:
- openshell-sandbox-ssh
verbs:
- get
- create
- patch
- update
{{- end }}
{{- end }}
{{- end }}
23 changes: 18 additions & 5 deletions deploy/helm/openshell/tests/clusterrole_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tests:
path: metadata.name
value: openshell-node-reader-my-namespace

- it: grants managed namespace NetworkPolicy apply permissions
- it: restricts managed SSH policy mutation to its fixed name
set:
server.drivers.kubernetes.workspaceMode: managed
asserts:
Expand All @@ -24,7 +24,18 @@ tests:
content:
apiGroups: ["networking.k8s.io"]
resources: ["networkpolicies"]
verbs: ["get", "create", "patch", "update"]
resourceNames: ["openshell-sandbox-ssh"]
verbs: ["patch"]
- contains:
path: rules
content:
apiGroups: ["networking.k8s.io"]
resources: ["networkpolicies"]
verbs: ["create", "get"]
- notExists:
path: rules[?(@.resources[0] == "networkpolicies")].verbs[?(@ == "update")]
- notExists:
path: rules[?(@.resources[0] == "networkpolicies" && !@.resourceNames)].verbs[?(@ == "patch")]

- it: limits namespaced admission reads to PVCs
set:
Expand Down Expand Up @@ -77,7 +88,8 @@ tests:
content:
apiGroups: ["networking.k8s.io"]
resources: ["networkpolicies"]
verbs: ["get", "create", "patch", "update"]
resourceNames: ["openshell-sandbox-ssh"]
verbs: ["patch"]

- it: gives schema-v2 managed SSH ingress precedence over the legacy alias
set:
Expand All @@ -92,7 +104,8 @@ tests:
content:
apiGroups: ["networking.k8s.io"]
resources: ["networkpolicies"]
verbs: ["get", "create", "patch", "update"]
resourceNames: ["openshell-sandbox-ssh"]
verbs: ["patch"]

- it: omits credential Secret access in managed mode
set:
Expand Down Expand Up @@ -124,7 +137,7 @@ tests:
- name: registry-two
asserts:
- notExists:
path: rules[*].resourceNames
path: rules[?(@.resources[0] == "secrets")].resourceNames
- contains:
path: rules
content:
Expand Down
4 changes: 4 additions & 0 deletions docs/how-it-works/sandboxes/runtimes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ and `SUPERVISOR_BASE_IMAGE` build arguments override their pinned bases. See
[Container Image Base Overrides](https://github.com/ai-openshell/openshell/blob/main/CONTRIBUTING.md#container-image-base-overrides)
for build commands and base compatibility requirements.

The supervisor image defaults to UID/GID `65534:65534`, including with a custom
base. Compute drivers select the runtime identity explicitly. For direct image
launches, make mounted runtime and log directories writable by the selected user.

For TLS-enabled Docker, Podman, and MicroVM gateways, set `guest_tls_ca` in
`[openshell.gateway]` or use the package-managed local CA. Remove the retired
`guest_tls_cert` and `guest_tls_key` fields. Supervisors receive only the
Expand Down
3 changes: 2 additions & 1 deletion skills/debug-openshell-cluster/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ the driver did not supply an immutable image ID; Kubernetes currently omits it.
When no image UID is available, `unmapped.container_image` preserves any known
workload image reference, including for VM and shared-supervisor records.
For custom builds using `SUPERVISOR_BASE_IMAGE`, check the selected base's GNU
runtime libraries, CA certificates, and inherited user and working directory.
runtime libraries, CA certificates, and working directory. The image defaults
to UID/GID `65534:65534`; compute drivers select the runtime identity explicitly.
Use container logs, engine inspection and the configured exec health probe for
diagnostics; `exec ... sh`, package installation and in-container shell scripts
are unavailable. Workload shells belong to the separate sandbox image. Preserve
Expand Down
Loading