test(drivers): pin root rejection for image-mapped policy identities in Docker and Podman #3653
Description
User Story
As a custom-image operator, I want regression tests ensuring image account lookup cannot turn an accepted policy name into a root workload.
Problem Statement
Docker and Podman resolve policy process.run_as_user and process.run_as_group names against the image's passwd/group files. After lookup, ResolvedWorkloadIdentity::new rejects UID/GID 0 (since #2942). #2578 treats image account data as untrusted input. This requests resolver-level regression tests, not new production checks.
The existing tests use OCI USER or policy root, not an accepted policy name resolving to 0 (test citations below). The security identity table attributes the identity change to the supervisor; it is done by the sandbox runtime's launcher (openshell-sandbox), after the driver's lookup and zero check, and the table describes neither.
Impact / Why This Matters
Existing tests could miss a resolver bypassing the constructor or resolving names after the zero check.
Proposed Design
Test image-mapped policy identities in both resolvers and correct the security identity table.
Acceptance Criteria
- Both resolvers reject validator-accepted policy names, including
sandbox, mapped to UID 0 or GID 0, with a valid non-root control. - Security docs credit the sandbox runtime for the identity change and describe image account lookup followed by the driver's numeric zero check.
Alternatives Considered
Shared-constructor tests alone do not cover each resolver's policy-name lookup path.
Agent Investigation
Read policy validation, identity resolution, resolver tests, and security documentation at main a8f98ec; nothing executed.
crates/openshell-policy/src/lib.rs:853-860: acceptssandboxor an in-range numeric ID, notroot.crates/openshell-driver-docker/src/lib.rs:621-693,crates/openshell-driver-podman/src/isolation.rs:85-182: image account lookup, thenResolvedWorkloadIdentity::new.crates/openshell-isolation-interface/src/contract.rs:212-223: rejects UID/GID 0.crates/openshell-driver-podman/src/isolation.rs:442-454: OCIUSERtest;crates/openshell-driver-docker/src/tests.rs:1515-1526: policyroot/roottest.docs/security/best-practices.mdx:211-212: supervisor attribution; no image-name lookup or post-resolution check. The calls are incrates/openshell-sandbox/src/main.rs:1456-1467.
Checklist
- I've reviewed existing issues and the architecture docs
- This is a design proposal, not a "please build this" request
Activity
johntmyers commentedon Sep 24, 2026
Could you please specify the exact issue with tests you are experiencing and reproduction steps?
github-actions commentedon Oct 15, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 14 days if there is no further activity. Comment or remove the state:stale label to keep it open.