Files
ai-exchange/docs/AI_ICT_敏感凭据低风险清理记录_2026-05-18_v1.md
T
2026-05-18 22:30:34 +08:00

2.7 KiB
Raw Blame History

AI_ICT 敏感凭据低风险清理记录 2026-05-18 v1

本轮边界

本轮只做仓库侧敏感信息清理和防回归检查,不做任何真实凭据轮换。

明确不改:

  • 远端 SSH / sudo 密码。
  • OKX key / secret / passphrase。
  • 数据库密码。
  • webhook URL。
  • proxy / broker / market truth 运行配置。
  • 远端正在运行的 .env。
  • execution_allowed、real_live_ready、risk governor、trust bucket、operator confirmation protocol。

已清理内容

  • 删除旧 expect 明文运维脚本:
    • scripts/deploy_server.exp
    • scripts/deploy_with_expect.exp
    • scripts/fix_pg_hba.exp
    • scripts/ssh_diagnose.exp
  • rollback 文档和检查器从 deploy_server.exp 切换到 scripts/deploy_with_password.py,密码只通过运行时环境变量注入。
  • .gitignore 新增 tmp_*.jsonl 和 *_capture.jsonl,避免 webhook capture / 临时事件日志被误提交。
  • 新增 scripts/run_secret_static_checks.py,只输出文件、行号、规则名和原因,不打印 secret 值。
  • scripts/run_script_static_checks.py 已接入 secret scan,现有脚本静态检查会一起挡住高置信明文凭据。
  • Trading Delivery Checklist 已加入 run_secret_static_checks.py,后续 market validation / deploy 前会先过敏感信息门。

当前风险说明

  • 当前工作树不再追踪旧明文 expect 脚本。
  • .env.local 仍保持 gitignored,不进入仓库。
  • 未进行 Git 历史重写;git log --all -- scripts/deploy_server.exp scripts/deploy_with_expect.exp scripts/fix_pg_hba.exp scripts/ssh_diagnose.exp 显示历史中仍有 4 个提交触达过这些旧脚本。
  • 因本轮不做轮换,历史泄露风险没有被“密码失效”彻底关闭;只是避免继续扩散和再次误提交。

验证证据

  • python scripts/run_secret_static_checks.py:passed,检查 git-tracked 文件且不打印 secret 值。
  • python scripts/run_script_static_checks.py:passed,已包含 secret scan。
  • python -m unittest tests.unit.test_secret_static_checks tests.unit.test_script_static_checks tests.unit.test_trading_delivery_readiness tests.unit.test_deploy_with_password tests.unit.test_documentation_consistency:35 tests OK。
  • python -m unittest discover -s tests/unit:779 tests OK。
  • git diff --check:仅 LF/CRLF 提示,无 whitespace error。

后续轮换建议

只有在确认备用登录方式、远端 .env 备份、部署 smoke 和回滚路径都可用之后,才逐项轮换:

  • SSH / sudo 密码。
  • OKX read-only / future sandbox key。
  • 数据库密码。
  • webhook URL。
  • proxy auth。

轮换时应一次只换一类,换完立即运行对应 smoke,不要批量同时替换。