Files
Nexus/docs/changelog/2026-05-22-telegram-sanitize-and-security-tests.md
T
Your Name aa65f10c52 docs: Phase 2 audit records, project memory, WSL guide
Audit docs:
- docs/reports/audit-phase-2{a-j}-line-walk.md: per-file line walk findings
- docs/reports/audit-phase-2-findings-matrix.md: 63 findings (52 fixed, 3 partial, 7 accepted)
- docs/reports/2026-05-23-full-audit-report.md: full audit consolidation
- docs/reports/audit-full-vs-phase2-reconciliation.md: cross-reference
- docs/reports/audit-phase-2-walk-closure.md: closure sign-off

Project docs:
- docs/project/phase-2-audit-remediation.md: SSOT for all fixes
- docs/project/alert-push-policy.md: dashboard alert design decisions
- docs/project/production-verification-checklist.md: first-deploy checklist
- docs/project/script-execution.md: script platform design
- docs/project/wsl-integration-test.md: WSL code-only verification guide
- docs/project/line-walk-audit-standard.md: audit methodology
- docs/project/mysql-mcp-setup.md: MCP config guide

Changelogs: 18 entries (2026-05-22 to 2026-05-23)
Project memory: CLAUDE.md, AGENTS.md updated to reflect current state
Deploy: nginx_https.conf template updated

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 15:27:40 +08:00

907 B
Raw Blame History

Telegram 出站脱敏 + 安全回归测试(F2d-04 / F2f-06

日期: 2026-05-22

F2d-04 — Telegram 脱敏

  • server/infrastructure/telegram/__init__.py:新增 sanitize_external_message(),屏蔽 DB/Redis URL、password、Bearer、密钥片段。
  • send_telegram_system_alert():出站前脱敏 + html.escape
  • send_telegram() 成功日志同样脱敏后再截断。
  • self_monitor.pyRedis/MySQL 失败详情写入 logger.warning(..., exc_info=True)Telegram 仅固定文案。

F2f-06 — 回归测试

tests/test_security_unit.py 扩展至 15 项,覆盖:

  • 危险命令、server_ids JSON 解析、HTTPS callback
  • sanitize_external_message 脱敏与截断
  • JwtAuthMiddleware 401 / 公开路径跳过
  • /api/install//api/auth/logout 公开前缀
  • 安装后 _reject_if_installed() → 403
pytest tests/test_security_unit.py -q