aboutsummaryrefslogtreecommitdiffhomepage
path: root/ldd
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-07-02 04:38:28 +0900
committerOphestra <cat@gensokyo.uk>2025-07-02 04:47:13 +0900
commit31aef905fa819310ee7694775a836c294ff742e4 (patch)
tree168eb9f598d2cbb46695d2c3e9864cb9ba8d76c6 /ldd
parenta6887f7253ae822357f0d4d019675acc8c3e0b4d (diff)
sandbox: expose seccomp interface
There's no point in artificially limiting and abstracting away these options. The higher level hakurei package is responsible for providing a secure baseline and sane defaults. The sandbox package should present everything to the caller. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'ldd')
-rw-r--r--ldd/exec.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ldd/exec.go b/ldd/exec.go
index f6f940e2..dbbe2055 100644
--- a/ldd/exec.go
+++ b/ldd/exec.go
@@ -9,6 +9,7 @@ import (
"time"
"git.gensokyo.uk/security/hakurei/sandbox"
+ "git.gensokyo.uk/security/hakurei/sandbox/seccomp"
)
const lddTimeout = 2 * time.Second
@@ -29,6 +30,8 @@ func ExecFilter(ctx context.Context,
container := sandbox.New(c, "ldd", p)
container.CommandContext = commandContext
container.Hostname = "hakurei-ldd"
+ container.SeccompFlags |= seccomp.AllowMultiarch
+ container.SeccompPresets |= seccomp.PresetStrict
stdout, stderr := new(bytes.Buffer), new(bytes.Buffer)
container.Stdout = stdout
container.Stderr = stderr