Files
agent/.env.example
T
kicer 2f96414c49 加固:executor 拒绝容器自身来源的 /exec;token 移出仓库
- 隔离只 unshare mount+pid,命令与 executor 同 net ns,能打到 127.0.0.1:9000;此前全局 token 一经泄漏,会话内即可借 /exec 以任意会话 cwd 起命令、绕过隔离读他人数据。现 /exec 先于鉴权拒绝源地址为回环/本机网卡的请求(403),/health 不设限;core 在另一容器、源地址非本机,不受影响。

- 实测:容器内带合法 token 调用 403、容器内 /health 200、core 侧新 token 200 且 session 隔离与技能执行正常。

- token 不再硬编码:compose 改用 ${EXECUTOR_TOKEN:?...} 从 .env 读取(.env 已 gitignore,附 .env.example 模板;未设置直接报错,杜绝静默无鉴权)。旧值已轮换(旧 token 401,新 token 200)。

- 本机集成测试用 EXECUTOR_ALLOW_LOCAL_ORIGIN=1 放行回环来源(executor/smoke-test.js、app/test/remote-exec.test.js),生产不得设置;ARCHITECTURE §2/§6 同步。
2026-09-11 21:17:02 +08:00

4 lines
168 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 复制为 .env 并填入真实值(.env 已在 .gitignore,不会被提交)。
# 生成 token:openssl rand -hex 32
EXECUTOR_TOKEN=change-me-openssl-rand-hex-32