Files
Nexus/docs/audit/2026-06-07-ssh-quick-add-hostkey-chinese-errors.md
T
Nexus Agent a14fbb3df3 fix(ssh): 快速添加跳过主机密钥校验并中文化错误
凭据轮询在 SSH_STRICT 默认 true 时因 HostKeyNotVerifiable 在认证前失败;
探测始终 known_hosts=None,默认 strict 改为 false,错误信息统一中文。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-07 21:31:38 +08:00

1.3 KiB
Raw Blame History

审计 — 2026-06-07 快速添加 SSH 主机密钥 + 错误中文化

范围

文件 变更要点
server/infrastructure/ssh/asyncssh_pool.py try_ssh_login 探测 known_hosts=NoneSSH 错误中文化
server/utils/sync_error_message.py asyncssh 主机密钥/认证失败等英→中
server/config.py SSH_STRICT_HOST_CHECKING 默认 false
server/application/services/credential_poller.py format_poll_errors 中文预设类型
frontend/src/pages/ServersPage.vue 失败弹窗 system→系统
tests/test_sync_error_message.py 翻译断言
tests/test_security_unit.py 脱敏中文占位符对齐(同批次工作区)
deploy/gate_log.jsonl 门控记录

Step 3 规则扫描

H 规则 结论
H1 凭据探测不得静默吞错 PASS — 错误写入 pending + 中文返回
H2 主机密钥:运维平台可跳过探测 PASS — 仅 try_ssh_login 跳过;pool 仍读 SSH_STRICT
H3 无明文密钥 PASS — 无凭据变更
H4 默认 strict false 与 install true 冲突 ACCEPT — install .env 显式写 true 仍可覆盖

Closure

  • Step3✓ — 8 步扫描无 BLOCK
  • Closure✓ — 根因(HostKeyNotVerifiable)与修复一致
  • DoD✓ — pytest 17 passed;待生产快速添加验证