feat(gateway): verify the trust of a launched driver binary in packaged installs

未关闭
#5,936 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
security

调研方向

Start at the gateway's driver discovery path: the first binary found in driver_dir, the conventional libexec directories, or next to the gateway executable, and the launcher that execs it. Read #5384 and #5385 for the ownership check that was dropped, then isolate the trust decision into a pure function over the binary's owner, mode and parent directory, taking the user-namespace uid mapping as an input. Unit-test it for the initial namespace and a user namespace, and confirm the packaged tmachine systemd user unit (PrivateTmp=true) still starts the gateway with the check enabled.

由索引模型根据 Issue 内容生成。

描述

area:drivers

User Story

I run the gateway from the packaged systemd user unit and launch compute drivers (Docker, Podman, VM) from /usr/libexec/openshell. I directly encountered the gateway refusing to start a driver because of an ownership check on the driver binary, and I want a driver trust check that is both safe and works for packaged installs.

Problem Statement

The gateway executes the first driver binary it finds in driver_dir, the conventional libexec directories, or next to its own executable. On main it performs no ownership, mode or parent-directory check on that binary. The launcher PR keeps only a mode check (not writable by group or others) and drops an owner check, because the owner check broke packaged installs: the packaged user unit sets PrivateTmp=true, which runs the gateway in a user namespace where root-owned files appear owned by the overflow uid (65534), so "owned by root or the gateway user" rejected /usr/libexec/openshell/openshell-driver-docker.

Impact / Why This Matters

Without a trust check, a driver binary that another local user can replace is executed with the gateway's authority. The check must still work in a user namespace, or packaged installs fail to start.

Desired Workflow

The gateway verifies a driver binary before it launches it. A binary in a root-owned system directory passes in every supported deployment, including the packaged user unit. A binary or directory another user can modify is refused with an error that says why. Success: packaged installs start, and a replaceable binary is rejected.

Acceptance Criteria

  • The check passes for root-owned binaries under /usr/libexec/openshell when the gateway runs in a user namespace.
  • The binary's parent directory is checked, because a writable directory lets any file be replaced.
  • The decision is a pure function with unit tests for the initial namespace and for a user namespace.
  • The packaged tmachine environments start the gateway with the check enabled.

Related: #5384, #5385. Deferred from the launcher PR to keep that change free of new behaviour.

主要语言
Rust
星标
21.5k
派生
2.1k
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

NVIDIA/OpenShell 的其他 Issue

查看 NVIDIA/OpenShell 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。