30 lines
1.3 KiB
Markdown
30 lines
1.3 KiB
Markdown
|
|
# 审计 — 2026-06-07 快速添加 SSH 主机密钥 + 错误中文化
|
|||
|
|
|
|||
|
|
## 范围
|
|||
|
|
|
|||
|
|
| 文件 | 变更要点 |
|
|||
|
|
|------|----------|
|
|||
|
|
| `server/infrastructure/ssh/asyncssh_pool.py` | `try_ssh_login` 探测 `known_hosts=None`;SSH 错误中文化 |
|
|||
|
|
| `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;待生产快速添加验证
|