ARTEX/intercept
BaaRai 04a7ab3c39 security(server): keep server secrets from agent processes
GHSA-prm8-vw2v-wjwh: the agent command executor ran as root in the server's
container and PID namespace, so it could read /app/keys and recover the
server secrets from /proc/<pid>/environ.

Deliverable 1, executor identity. Agent processes (Bash, the interactive
shell, custom tools, stdio MCP servers) run as the uid/gid set by
-exec-uid and -exec-gid (default 10001). Custom tools use
SysProcAttr.Credential. Norma starts Bash and the shell itself, so a PATH
shim (the server binary named bash) drops the identity before exec; MCP
stdio commands run through the same binary in drop mode. The task and chat
workspace trees are shared with the executor group (setgid, group rw,
umask 002). The key files and the config file become root-only, and
/app/keys is 0700 in the image. An explicit -exec-uid that cannot be applied
stops the start; the default logs once that same-uid isolation is
unavailable when the server is not root.

Deliverable 2, sealed environment. On Linux, SealProcessEnv re-executes the
server once with the secret variables removed from its environment block,
passing the values through an inherited pipe. The new image restores them
into the Go environment, so readers see the same configuration. Off Linux it
logs that the environment is not sealed.

Deliverable 3, approval gate. Custom tools, MCP servers and skill files
(create_/update_ of custom tool and MCP, create_skill, update_skill_file)
meet built-in ask rules seeded once (intercept_persistence_rules_v1). A user
allow rule cannot skip them; a user deny still wins. The rules are data the
agent cannot edit.

Tests: resolution and refusal of root identities, drop command wrapping,
sealed-environment encoding, and an end-to-end handoff test on Linux that
checks the kernel environment block and a child process hold no secret
names and that the values survive (empty and multi-line included). Approval
matching is tested in intercept.
2026-11-20 05:35:53 +01:00
..
alwaysallow_denylist.go fix(intercept): deny always-allow for git, cmake, ctest and cpack 2026-11-20 01:23:45 +01:00
alwaysallow_denylist_test.go fix(intercept): deny always-allow for git, cmake, ctest and cpack 2026-11-20 01:23:45 +01:00
argv.go fix(intercept): deny always-allow for git, cmake, ctest and cpack 2026-11-20 01:23:45 +01:00
argv_compound.go fix(intercept): over-approximate unknown options on known wrappers and expand parallel flags 2026-11-19 18:56:42 +01:00
argv_compound_test.go fix(intercept): over-approximate unknown options on known wrappers and expand parallel flags 2026-11-19 18:56:42 +01:00
argv_test.go fix(intercept): deny always-allow for git, cmake, ctest and cpack 2026-11-20 01:23:45 +01:00
closed_judge.go Intercept judge: review fixes for the closed-question mode 2026-11-13 08:40:02 +01:00
closed_judge_pg_test.go Intercept judge: closed-question mode, fail-closed to ask 2026-11-12 22:35:11 +01:00
closed_judge_test.go Intercept judge: review fixes for the closed-question mode 2026-11-13 08:40:02 +01:00
default_tools_test.go fix(intercept): gate ExecuteExtraTool and Monitor by default 2026-11-20 01:48:50 +01:00
enrich_probe_test.go enrich: route the HTTP probe through the pinned dialer (F13) 2026-11-12 11:53:33 +01:00
export_test.go enrich: route the HTTP probe through the pinned dialer (F13) 2026-11-12 11:53:33 +01:00
intercept.go fix(intercept): gate ExecuteExtraTool and Monitor by default 2026-11-20 01:48:50 +01:00
persistence.go security(server): keep server secrets from agent processes 2026-11-20 05:35:53 +01:00
persistence_test.go security(server): keep server secrets from agent processes 2026-11-20 05:35:53 +01:00
prompt.go Intercept judge: closed-question mode, fail-closed to ask 2026-11-12 22:35:11 +01:00
prompt_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
review_context.go Intercept judge: closed-question mode, fail-closed to ask 2026-11-12 22:35:11 +01:00
review_context_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00
risk.go fix(intercept): destructive commands score high; chunk batch decisions to the server limit 2026-11-14 22:46:18 +01:00
risk_test.go fix(intercept): destructive commands score high; chunk batch decisions to the server limit 2026-11-14 22:46:18 +01:00
target.go feat(intercept): target extraction, resolver, exemptions and the gate in the hook (S3b 1.5-1.7) 2026-11-11 00:34:55 +01:00
target_declared_test.go fix(intercept): match block rules on the declared targets before any lookup 2026-11-11 15:47:58 +01:00
target_dial.go feat(intercept): pinned dialer for WebFetch and the custom http tool (S3b 2.1) 2026-11-11 19:19:55 +01:00
target_dial_pg_test.go feat(intercept): pinned dialer for WebFetch and the custom http tool (S3b 2.1) 2026-11-11 19:19:55 +01:00
target_dial_test.go feat(intercept): pinned dialer for WebFetch and the custom http tool (S3b 2.1) 2026-11-11 19:19:55 +01:00
target_exempt.go security(server): block SSRF in POST /api/llm/models (GHSA-7w8h) 2026-11-20 02:35:39 +01:00
target_exempt_test.go feat(intercept): pinned dialer for WebFetch and the custom http tool (S3b 2.1) 2026-11-11 19:19:55 +01:00
target_extract.go feat(traffic): record WebSocket and SSE stream messages 2026-11-16 07:47:25 +01:00
target_gate.go fix(intercept): make target pins name-only behind any proxy 2026-11-19 15:47:36 +01:00
target_gate_pg_test.go feat(intercept): target extraction, resolver, exemptions and the gate in the hook (S3b 1.5-1.7) 2026-11-11 00:34:55 +01:00
target_gate_test.go fix(intercept): make target pins name-only behind any proxy 2026-11-19 15:47:36 +01:00
target_redirect.go feat(intercept): check every redirect hop against the target gate (S3b 1.9) 2026-11-11 17:07:35 +01:00
target_redirect_pg_test.go feat(intercept): check every redirect hop against the target gate (S3b 1.9) 2026-11-11 17:07:35 +01:00
target_redirect_test.go feat(intercept): check every redirect hop against the target gate (S3b 1.9) 2026-11-11 17:07:35 +01:00
target_rendered.go fix(intercept): match block rules on the declared targets before any lookup 2026-11-11 15:47:58 +01:00
target_rendered_test.go feat(intercept): gate the rendered targets of custom tools (S3b 1.8) 2026-11-11 15:04:42 +01:00
target_request.go feat(intercept): pinned dialer for WebFetch and the custom http tool (S3b 2.1) 2026-11-11 19:19:55 +01:00
target_request_test.go Refactor PostgreSQL test skipping logic 2026-11-19 14:23:29 -03:00
target_resolve.go feat(intercept): pinned dialer for WebFetch and the custom http tool (S3b 2.1) 2026-11-11 19:19:55 +01:00
target_test.go feat(traffic): record WebSocket and SSE stream messages 2026-11-16 07:47:25 +01:00
testmain_test.go feat(intercept): target-gate schema, opt-in flag and approval requests (S3b 1.2-1.4) 2026-11-10 23:05:47 +01:00
trace.go Intercept judge: closed-question mode, fail-closed to ask 2026-11-12 22:35:11 +01:00
trace_test.go Translate all Chinese text to English 2026-10-08 23:14:34 +02:00