feat(agent): bind destination-constrained agent keys with [email protected]

未关闭
#327 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@inureyes 已经在做这个了。

开始于 2026年11月5日。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
cli, security

调研方向

Read docs/openssh-compatibility-status.md and upstream russh PR #794 to understand the dependency boundary and required binding data. Then inspect the agent authentication path and the agent-restrict regression harness; work can begin once a released russh version exposes the binding API. Done means both binding modes are covered and agent-restrict passes on Linux and macOS.

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

描述

priority:medium status:blocked type:enhancement

Problem / Background

Follow-up to #314. The pinned OpenSSH V_10_3_P1 regress test agent-restrict still fails on both CI platforms. After #314 the phases that do not need destination constraints pass: authentication w/o agent (including the certificate hosts host_d and host_e, which needed host-certificate verification), authentication with agent (no restrict), unrestricted keylist, authentication with agent incorrect key (basic restrict), username incorrect, agent restriction honours certificate principal, multihop without agent, multihop agent unrestricted, multihop wrong username, multihop cycle no agent, multihop cycle agent unrestricted, and multihop cycle restricted deny.

The phases that still fail are exactly the ones where a destination-constrained key must be usable: authentication with agent (basic restrict), keylist (basic restrict), username, username wildcard, multihop restricted, multihop username, multihop wildcard username, and multihop cycle restricted allow. Each fails with SSH agent authentication error: Agent failure because the agent refuses to sign with a constrained key for a client that has not sent [email protected].

Upstream dependency

Sending [email protected] requires the exact negotiated host key or host certificate blob, the initial key-exchange session ID, and the server's key-exchange signature, plus a per-connection binding mode (direct authentication versus a forwarded agent connection). russh 0.64.1 does not expose that tuple to the client handler. The upstream proposal is russh PR #794 (https://github.com/Eugeny/russh/pull/794), still open. Per the dependency boundary in docs/openssh-compatibility-status.md, only an immutable merged upstream revision followed by a crates.io release may be consumed; no fork or contributor branch.

Proposed Solution

  • When russh ships the binding API, send [email protected] to the agent before listing identities, with the certificate blob when one was negotiated, the initial session ID (never a rekeyed one), and the forwarding flag set for forwarded agent connections.
  • Keep constraints intact: never drop or rewrite agent constraints to make authentication succeed.
  • Re-run tests/openssh-regress/run.py --test agent-restrict on Linux and macOS.

Reproduction

python3 tests/openssh-regress/run.py --test agent-restrict --results /tmp/agent-restrict.json. On hosts where the regress directory path is longer than sockaddr_un allows, the agent socket cannot be created and the verdict is environmental; run the script through a short symlinked OBJ directory to reach the failing phases.

Acceptance Criteria

  • agent-restrict passes on Linux and macOS CI with the pinned V_10_3_P1 harness.
  • Destination-constrained identities are bound with the negotiated host key or certificate, the initial session ID, and the correct forwarding mode; a regression test exercises both binding modes.
  • The dependency is a released russh version (or an immutable merged upstream revision as a temporary measure), recorded in docs/openssh-compatibility-status.md.
主要语言
Rust
星标
71
派生
7
平均合并
4 小时 51 分钟
30 天内合并 PR
14

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

lablup/bssh 的其他 Issue

查看 lablup/bssh 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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