refactor(sandbox): 按威胁模型精确化——仅不受信任代码进容器
http/db 类工具的子进程是瘦壳(纯计算),危险操作全在受信任主进程, 套容器是纯开销无隔离收益。调整为: - 开发者预写工具:移除 spec 的 sandbox: profile: stdio,回默认 local 本地执行(仍保留 env_clear + 白名单注入) - tool_manager 产出的工具:spec_yaml 自动写 sandbox: profile: stdio, 不受信任代码(LLM 提供 rust_code)默认进 stdio 容器 - tool_manager 编译:仍走 builder 容器 - 移除 ias-network-runner Dockerfile(当前无工具直接联网) - executor docker 分支仅保留 stdio/builder,删 network 分支 验证:datetime 本地执行 +08:00;tool_manager 产出工具 spec 含 sandbox: profile: stdio 且容器内执行成功;25 测试通过。
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
# ias-network-runner — 允许联网的工具运行环境
|
||||
# 供需要自行发起 HTTP 的工具使用(当前工具均通过宿主 http 消息代理联网,
|
||||
# 此镜像为将来工具直接联网预留)。运行时仍可按需 --network none。
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
ENTRYPOINT []
|
||||
@@ -1,16 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
# 构建三类沙箱基础镜像。无需为每个工具单独写 Dockerfile。
|
||||
# 构建沙箱基础镜像。
|
||||
# - ias-stdio-runner : 运行 tool_manager 产出的不受信任工具(无网络只读)
|
||||
# - ias-tool-builder : tool_manager 编译 Rust 工具(离线)
|
||||
# 无需为每个工具单独写 Dockerfile。
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")" # docker/
|
||||
|
||||
echo "=== 构建 ias-stdio-runner(无网络只读容器)==="
|
||||
docker build -t ias-stdio-runner -f Dockerfile.stdio-runner .
|
||||
|
||||
echo "=== 构建 ias-network-runner(联网容器)==="
|
||||
docker build -t ias-network-runner -f Dockerfile.network-runner .
|
||||
|
||||
echo "=== 构建 ias-tool-builder(Rust 编译容器)==="
|
||||
docker build -t ias-tool-builder -f Dockerfile.tool-builder .
|
||||
|
||||
echo "=== 完成 ==="
|
||||
docker images | grep -E '^ias-(stdio|network|tool)'
|
||||
docker images | grep -E '^ias-(stdio|tool)'
|
||||
|
||||
Reference in New Issue
Block a user