Files
seal-use/.agents/rules/security-posture.md
T
yunyingk f8e083f3b2 Fix security scan findings: confirm gate, exit codes, redaction, CI tag env (#180)
- Gate rules push behind --yes at CLI and domain layers (fail-closed on
  dryRun=false without confirm)
- Raise webhook replay partial failure as CliError so exit 1 survives
  cli.ts exitCode overwrite; route webhook stdout through printJson for
  exit-12 protection and --output-file support
- Narrow MCP read-only allowlist: drop config mode/lint (write forms are
  indistinguishable under token-prefix matching; config get covers reads)
- Extract redactSensitiveText to core, extend credential patterns, apply
  to HTTP sendError/500 and domain error messages
- Pass release TAG_NAME via env instead of inline ${{ }} interpolation
  to close script injection through crafted tag names
- Track .zcodeignore so enterprise credential exclusions travel with the
  repo
- Add .agents/rules/security-posture.md documenting usability-first
  accepted risks (loopback adapter auth, update verification, mutation
  command gates, skill dump stdout); register skill dump as a documented
  stdout Markdown exception in AGENTS.md and cli-protocol.md
- Rebuild dist/mcp/server.js
2026-09-24 22:02:24 +08:00

2.4 KiB
Raw Blame History

description, globs, trigger
description globs trigger
内部自用安全取舍:本地适配器免鉴权、自更新免强校验——好用优先,已知并接受 src/http/**,src/cli/commands/update.ts,src/cli/service.ts,src/cli/commands/http.ts,scripts/install.sh,SECURITY.md manual

安全取舍与已接受风险(Usability First)

本工具为内部自用,一切以"好用"为第一优先级。以下取舍是明确的架构决策, 而非待修缺陷;后续开发/评审不得以"安全健壮性"为由擅自加固,使日常使用变繁琐。


1. 本地 HTTP 适配器:免鉴权(by design)

  • src/http/server.ts 默认绑定 127.0.0.1:8787,POST /api/cli、/api/tool/*、/v1/* 不加 token/session 校验,Access-Control-Allow-Origin: * 保持不变,/shutdown 保持无鉴权,HOST/--host 允许自由绑定(含非回环地址)。
  • 决策:内部单机/内网自用,不引入 per-install token、Host 头白名单、Origin 校验、 命令 deny-list 等门禁——这些会显著增加本地自动化的接入成本。
  • 边界:此决策依赖"仅本机/可信内网访问"的使用前提。若未来对外开放或暴露到 不可信网络,需重新评估(SECURITY.md 已披露该信任模型)。

2. 自更新与安装链:免完整性强校验(by design)

  • seal-use update(src/cli/commands/update.ts)与 scripts/install.sh: 下载二进制后不做 checksum 强制比对、不做签名校验;校验和不匹配仅告警不阻断。
  • GitHub 加速代理(ghfast.top / gh.ddlc.top 等)与 Gitea 镜像均视为自有可信分发源, 可自由选用、随便安装,不默认强制 SEAL_USE_MIRROR=github。
  • 决策:分发链路全部自有可控,不引入"校验失败即拒绝安装"的阻断逻辑, 保证 update / curl | bash 一路顺畅。
  • 边界:若未来引入外部第三方镜像或公开分发,需先补上强制校验再开放。

通用原则

  • 安全修复分级处理:影响"好用"的加固默认不做(本文件第 1、2 条); 不影响日常体验的修复(如确认门逻辑漏洞、错误输出脱敏、exit code 契约)照常做。
  • 修改本文件涉及的代码前,先读本决策;不要把上述行为当作 bug"顺手修掉"。
  • 权威信任模型见 SECURITY.md;本文件记录的是"接受风险、不修"的产品决策。