mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-12-05 21:01:50 +08:00
feat(traffic,sandbox): add TUN/netstack transparent gateway, egress controls, CAP_NET_RAW hardening, and i18n fixes
- Implement full-traffic transparent gateway (cmd/artex-gateway, traffic/netstack.go, traffic/transparent.go) using Linux TUN + gVisor netstack deferred TCP handshakes (eliminating nmap/nc false-positive open ports), real ICMPv4 Echo proxying, UDP/DNS interception, and per-container upstream proxy overrides. - Add egress blacklist + asset-intercept sync, non-HTTP flow/DNS SQLite persistence and APIs, and /system/proxy & /function/traffic TCP/UDP/DNS UI panels. - Fix sandbox Playwright MCP browser loopback --proxy-server rewrite and NODE_EXTRA_CA_CERTS override in server/mcpstdio.go. - Strip all SUID/SGID binaries in Dockerfile.sandbox, grant minimal cap_net_raw+ep to nmap/nping/ping with ARTEX_SANDBOX_ALLOW_NET_RAW toggle, and enforce IPv4/IPv6 anti-spoofing in iptables and netstack. - Remove hardcoded Chinese "(全局)" from GET /api/proxy/routes, localize ContainerRoutesTab / NonHTTPTrafficPanel labels, and expose reactive locale/isEn from useLiveTranslation for React Compiler compatibility.
This commit is contained in:
1 parent
9c43e694a3
commit
d786de90af
69 files changed
+13082
-1433
No files matched your search
+17
-4
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/Autumn-27/artex/db"
|
||||
"github.com/Autumn-27/artex/intercept"
|
||||
"github.com/Autumn-27/artex/internal/sandbox"
|
||||
"github.com/Autumn-27/artex/traffic"
|
||||
"github.com/Autumn-27/norma/agentcore"
|
||||
"github.com/Autumn-27/norma/harness"
|
||||
"github.com/Autumn-27/norma/llm"
|
||||
@@ -398,14 +399,27 @@ func (w *Worker) execute(ctx context.Context, name string, taskID int64, as *db.
|
||||
proxyAddr = w.proxyAddrFn()
|
||||
}
|
||||
sysProxyAddr, sysCACert, sysDataDir := proxyAddr, w.proxyCACert, w.workDir
|
||||
bashEnv := proxyEnv(proxyAddr, w.proxyCACert)
|
||||
srcID := traffic.SourceIdentity{
|
||||
Scope: "task",
|
||||
OwnerID: strconv.FormatInt(taskID, 10),
|
||||
IntentID: intent.ID,
|
||||
}
|
||||
webFetchProxy := proxyAddr
|
||||
if w.proxyCACert != "" && proxyAddr != "" {
|
||||
webFetchProxy = traffic.FormatProxyContextURL(proxyAddr, srcID)
|
||||
}
|
||||
bashEnv := proxyEnv(webFetchProxy, w.proxyCACert)
|
||||
if sandboxActive {
|
||||
if proxyAddr != "" && sbMgr.Config().ProxyURL != "" {
|
||||
sysProxyAddr = sbMgr.Config().ProxyURL
|
||||
sysCACert = sandbox.ContainerCACertPath
|
||||
}
|
||||
sysDataDir = sandbox.ContainerWorkDir
|
||||
bashEnv = sbMgr.ProxyEnv(proxyAddr != "")
|
||||
if proxyAddr != "" && w.proxyCACert != "" && sbMgr.Config().ProxyURL != "" {
|
||||
bashEnv = sbMgr.ProxyEnvWithURL(traffic.FormatProxyContextURL(sbMgr.Config().ProxyURL, srcID))
|
||||
} else {
|
||||
bashEnv = sbMgr.ProxyEnv(proxyAddr != "")
|
||||
}
|
||||
}
|
||||
sysBody := workerSystem(sysProxyAddr, sysCACert, sysDataDir, displayRunDir)
|
||||
if w.wantConstraints() {
|
||||
@@ -450,9 +464,8 @@ func (w *Worker) execute(ctx context.Context, name string, taskID int64, as *db.
|
||||
// WebFetch 走记录代理,其 HTTP 与 curl 一样被留痕;载入代理 CA 让经 MITM
|
||||
// 重签的 HTTPS 证书能【正常校验通过】(而非关掉校验)。proxy 空则直连。
|
||||
EnableWebFetch: true,
|
||||
WebFetchProxy: proxyAddr,
|
||||
WebFetchProxy: webFetchProxy,
|
||||
WebFetchCACert: w.proxyCACert,
|
||||
// 联网搜索(可选)。ddgs 无需 key;brave-free 需 BraveKey;tavily 需 TavilyKey。
|
||||
// WebSearchProxy 是独立的出口代理(http/https/socks5),与记录流量的 MITM 代理无关;空则直连。
|
||||
EnableWebSearch: w.webSearch.Enabled && w.webSearch.Backend != "deepseek",
|
||||
WebSearchBackend: w.webSearch.Backend,
|
||||
|
||||
Reference in new issue
Block a user