feat(drivers): inject local sandbox identity#2335
Conversation
Make Docker and Podman select a validated numeric agent identity and inject it into the supervisor, allowing userless images to run without a baked-in sandbox account.\n\nCloses #2331 Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
|
Thank you for your interest in contributing to OpenShell, @matthewgrossman. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
E2E Test AttestationThe local Docker E2E test passed against the committed implementation. Podman is not installed on this development host; the PR adds the equivalent test to the repository's rootless Podman E2E lane.
Test SummaryTests Executed
The fixture asserts that the image contains neither a named |
|
Thank you for your interest in contributing to OpenShell, @matthewgrossman. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
| sandbox_uid: None, | ||
| sandbox_gid: None, |
There was a problem hiding this comment.
QUestion: Why is the default not DEFAULT_SANDBOX_UID?
| /// Numeric UID for the agent process. Defaults to 10001. | ||
| #[arg(long, env = "OPENSHELL_PODMAN_SANDBOX_UID")] | ||
| sandbox_uid: Option<u32>, | ||
|
|
||
| /// Numeric GID for the agent process. Defaults to the resolved UID. | ||
| #[arg(long, env = "OPENSHELL_PODMAN_SANDBOX_GID")] | ||
| sandbox_gid: Option<u32>, | ||
|
|
There was a problem hiding this comment.
Out of scope for this change, but is annonymous struct embedding possible in rust so that one could group common driver options like these?
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| FROM public.ecr.aws/docker/library/python:3.13-slim |
There was a problem hiding this comment.
Question: Why not something even smaller? Do we need python?
| //! - A running Docker- or Podman-backed OpenShell gateway | ||
| //! - Docker or Podman runtime running (for image build) |
There was a problem hiding this comment.
Do these strictly need Docker or Podman drivers? (not for image build).
Summary
Make the Docker and Podman compute drivers choose and inject a validated numeric agent identity at runtime, so OpenShell-managed sandboxes no longer require a baked-in
sandboxuser or group. The supervisor now presents the same numeric identity and/sandboxhome consistently for primary and SSH-launched agent processes.Related Issue
Closes #2331
Changes
10001:10001, support operator overrides, validate both values against the policy identity range, and override image/user-supplied identity environment variables.HOME,USER, andLOGNAMEconsistently when dropping to a numeric identity.USERis not authoritative for an OpenShell-managed agent.Deviations from Plan
Local Docker validation completed. Podman is not installed on this development host, so the new Podman E2E target was compiled locally and is left to the repository's rootless Podman CI lane for runtime validation.
Testing
mise run pre-commitpassesTests added:
custom_imagecompile.docker_sandbox_from_userless_dockerfilepasses locally;podman_sandbox_from_userless_imageis covered by rootless Podman CI.Checklist
Documentation updated:
architecture/compute-runtimes.mdandarchitecture/sandbox.md: runtime identity ownership and flow.