ARTEX/traffic
BaaRai eb5d3d73c1 security(agent): confine the file tools and close the executor review
The SDK file tools Read, Write, Edit, MultiEdit, LS, Glob and Grep run in
the server process, which is root in the image, and took any absolute or
relative path: Read returned /app/keys/jwt.key or the config file, and
Write could plant a skill or rewrite the config past the approval gate.

- agent/filetools.go: defaultTools replaces the seven tools for every
  agent kind (chat, main agent, planner, worker). Same names, prompts and
  schemas; every path goes through an os.Root on the run's working
  directory, opened component by component below the data directory, so
  absolute paths elsewhere, "..", symlinks leading out, a run directory
  swapped for a symlink and files with extra hard links are refused. Grep
  no longer starts ripgrep. The LLM connection test passes an empty tool
  list instead of nil (nil meant the unconfined defaults).
- traffic: chmod the go-mitmproxy CA private key to 0600 after the proxy
  creates or loads it; the CA certificate stays readable.
- server: the executor gets HOME and XDG_CACHE_HOME in <data>/exec-home,
  owned by it, on the bash shim, the MCP drop shim and the custom-tool
  credential path.
- server: ARTEX_LLM_PROXY and ARTEX_LLM_BASE_URL can carry user:pass@;
  they are scrubbed and sealed with the other startup secrets.
- docker: no-new-privileges for the artex service, setuid/setgid bits
  stripped in the image, PLAYWRIGHT_BROWSERS_PATH kept at root's cache.
- db: the persistence approval seed inserts each rule only when no rule
  of that name exists, so a re-run does not duplicate rules.
- Root-gated tests run the bash shim, a custom tool and an MCP stdio
  command as the executor and check the uid, a 0600 root file, the
  server's /proc environ and a cache write.
2026-11-20 05:35:54 +01:00
..
rewrite feat(traffic/rewrite): let the proxy record a rule's transport error 2026-11-17 22:22:56 +01:00
archive.go 归档 2026-08-28 12:56:29 +08:00
archive_test.go 归档 2026-08-28 12:56:29 +08:00
blobrange_test.go fix(traffic): bound BlobRange without overflowing int64 2026-11-18 17:22:13 +01:00
ca_perm_test.go security(agent): confine the file tools and close the executor review 2026-11-20 05:35:54 +01:00
evidence.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
external.go fix(traffic): reject CR/LF in ingested methods and headers 2026-11-18 22:41:42 +01:00
external_test.go fix(traffic): reject CR/LF in ingested methods and headers 2026-11-18 22:41:42 +01:00
pace.go feat(traffic): apply rewrite rules in the capture proxy (P3.3b1) 2026-11-17 22:23:12 +01:00
pace_test.go feat(traffic): pace Bash requests at the capture proxy 2026-11-15 00:57:13 +01:00
passthrough_test.go Expire a MITM passthrough mark after one minute. 2026-11-17 13:04:37 -05:00
proxy_test.go fix(traffic): 流量录制代理默认只监听 127.0.0.1,避免默认开放代理暴露 (#129) (#130) 2026-09-16 09:36:32 +08:00
reclaim_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
replay.go Treat an expired passthrough mark as intercepted again, and say what the window costs. 2026-11-17 15:58:24 -05:00
replay_test.go Treat an expired passthrough mark as intercepted again, and say what the window costs. 2026-11-17 15:58:24 -05:00
rewrite_flow.go feat(traffic): apply rewrite rules in the capture proxy (P3.3b1) 2026-11-17 22:23:12 +01:00
rewrite_flow_test.go feat(traffic): apply rewrite rules in the capture proxy (P3.3b1) 2026-11-17 22:23:12 +01:00
stream.go feat(traffic): filter stream messages by direction 2026-11-19 22:37:23 +01:00
stream_direction_test.go feat(traffic): filter stream messages by direction 2026-11-19 22:37:23 +01:00
stream_test.go fix(traffic): bound stream message pages, spill before the transaction, seconds timestamps 2026-11-16 08:21:38 +01:00
traffic.go security(agent): confine the file tools and close the executor review 2026-11-20 05:35:54 +01:00
traffic_store_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
traffic_test.go feat(traffic): record WebSocket and SSE stream messages 2026-11-16 07:47:25 +01:00
upgrade_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00