Task-level block rules do not constrain sandbox egress, so a deny rule is bypassable by Bash in the default mode
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- docker, go
- Domain
- networking, security
Research direction
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.
Written by the indexing model from the issue text.
Description
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—EgressPolicyhasDomainsandCIDRs; there is no deny list field.server/sandbox.go:66-155—taskSandboxRunInfobuilds that list fromtask_scoperows withapproved_by_operator = true, frozen company grants (task_scope_egress), andtask_intercept_ruleswhereaction='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)
- Read
task_intercept_ruleswithaction='block'intaskSandboxRunInfoand propagate them as a deny list throughSandboxRunInfo→EgressPolicy→ARTEX_*container env →artex-egress-proxy, matching the existing "block wins over allow" order documented for the gate. - Decide the semantics for a pattern that is both allowed (scope/company) and blocked (rule): block should win, as it does at the gate.
- Decide whether the deny list also applies to
WebFetchin sandbox mode, which currently enforcesEgressPolicyper URL and redirect hop — it should, for consistency. - 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.
- Dominant language
- Go
- Stars
- 18.7k
- Forks
- 7k
- Avg merge
- 10h 57m
- Merged PRs (30d)
- 494
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BaaRai/ARTEX
-
bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
BaaRai/ARTEX#981 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BaaRai/ARTEX#980 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
BaaRai/ARTEX#812 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
question
Difficulty 4/5 1-2 days Newbie friendliness 35/100
BaaRai/ARTEX#983 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug P2
Difficulty 3/5 1-2 days Newbie friendliness 20/100
BaaRai/ARTEX#977 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
BUG: Backend Docker build fails due to Go version mismatchPossibly taken @Aakriti0207 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 93/100
gittuf/visualizer#203 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
agent:ready
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
turbot/flowpipe#1162 · 1 comment ·
Maintainers usually reply within 1 day