Task-level block rules do not constrain sandbox egress, so a deny rule is bypassable by Bash in the default mode

オープン
#802 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@00xcyd がすでに取り組んでいます。

2026年12月2日 から。

  • #821 @00xcyd による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, go

調査の方向性

Start with server/sandbox.go and sandbox/policy.go, then trace how SandboxRunInfo reaches the ARTEX_* container environment and artex-egress-proxy. Read the gate contract in intercept/target_gate_pg_test.go and check how sandbox WebFetch handles URLs and redirects. Done means block rules consistently deny matching sandbox egress, including when a host is also allowed, with the chosen behavior documented in the changelog.

索引モデルが issue の本文から書いたものです。

説明

bug P1

Problem

A task-level block (deny) rule is evaluated in two places: the target gate (intercept/target_gate.go) and asset insertion (db/asset_intercept_match.go). Neither sees the traffic of a sandboxed worker, and the sandbox egress policy does not read block rules at all.

With ARTEX_SANDBOX=required (the default since 0.7.1), Bash runs in artex-worker, whose network is enforced by artex-egress-proxy against sandbox.EgressPolicy. That policy is an allowlist only:

  • sandbox/policy.go:129 — EgressPolicy has Domains and CIDRs; there is no deny list field.
  • server/sandbox.go:66-155 — taskSandboxRunInfo builds that list from task_scope rows with approved_by_operator = true, frozen company grants (task_scope_egress), and task_intercept_rules where action='allow'. Block rules are never read.

Impact

A task-level deny rule does not stop a worker curl/python/nmap to any host the task already has in scope. Operators reasonably read the rule editor as an enforcement control — the same reading the UI now invites by putting the target gate next to it.

Concretely: task scope approves example.com; an operator adds a block rule for admin.example.com; the planner's worker fetches it with curl and the rule never fires. Only the target gate would stop it, and the gate never sees the socket.

Proposal (needs a design decision, not a quick patch)

  1. Read task_intercept_rules with action='block' in taskSandboxRunInfo and propagate them as a deny list through SandboxRunInfo → EgressPolicy → ARTEX_* container env → artex-egress-proxy, matching the existing "block wins over allow" order documented for the gate.
  2. Decide the semantics for a pattern that is both allowed (scope/company) and blocked (rule): block should win, as it does at the gate.
  3. Decide whether the deny list also applies to WebFetch in sandbox mode, which currently enforces EgressPolicy per URL and redirect hop — it should, for consistency.
  4. Migration/behaviour note: this narrows egress for existing tasks that carry block rules today; that is the intent, but it belongs in the changelog as a security fix.

Related

The gate's own contract is documented in intercept/target_gate_pg_test.go ("Task allow rules play no role in the gate: they neither satisfy it nor restrict it. Block rules, global and of the task, always win."), which is the behaviour the sandbox path should mirror.

主要言語
Go
スター
18.7k
フォーク
7k
平均マージ
10時間 57分
マージ済み PR(30日)
494

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

BaaRai/ARTEX のほかの issue

BaaRai/ARTEX の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。