Skip to content

Commit 1cd4afd

Browse files
koki-developclaude
andcommitted
feat: set sandbox HOME directory to /sandbox instead of /tmp
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6e5fadd commit 1cd4afd

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

e2e/tests/security/go_runtime_attack.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ tests:
206206
status: "OK"
207207
signal: null
208208
run:
209-
stdout: "HOME=/tmp\nPATH=/usr/bin:/bin\n"
209+
stdout: "HOME=/sandbox\nPATH=/usr/bin:/bin\n"
210210
stderr: ""
211-
output: "HOME=/tmp\nPATH=/usr/bin:/bin\n"
211+
output: "HOME=/sandbox\nPATH=/usr/bin:/bin\n"
212212
exit_code: 0
213213
status: "OK"
214214
signal: null

internal/sandbox/configs/nsjail.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ clone_newnet: true
3838
iface_no_lo: true
3939

4040
# HOME must be set because many tools read it for config/cache paths.
41-
envar: "HOME=/tmp"
41+
envar: "HOME=/sandbox"
4242

4343
# Static rlimits (constant across all runtimes and execution steps).
4444
# Each requires an explicit _type: VALUE because the protobuf defaults

internal/sandbox/execution.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (e *execution) buildArgs() []string {
7070
)
7171

7272
// Runtime-specific environment variables (e.g. PATH, GOROOT).
73-
// HOME=/tmp is set in the config file.
73+
// HOME=/sandbox is set in the config file.
7474
for _, env := range e.env {
7575
args = append(args, "-E", env)
7676
}

0 commit comments

Comments
 (0)