aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pkg/exec.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-02-19 14:30:31 +0900
committerOphestra <cat@gensokyo.uk>2026-02-19 14:30:31 +0900
commite335d99c6b9b21a3b24f5f055b92fb1f3406a773 (patch)
tree65b1cf07535a8e748530539171126c2fd94844eb /internal/pkg/exec.go
parentd888d09b6dc8b42bedec9689a09ddae2e16197cc (diff)
internal/pkg: export seccomp presets
This is useful for external tooling providing an execArtifact-like environment. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/pkg/exec.go')
-rw-r--r--internal/pkg/exec.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/pkg/exec.go b/internal/pkg/exec.go
index bb0c7ba0..7b1d7f3e 100644
--- a/internal/pkg/exec.go
+++ b/internal/pkg/exec.go
@@ -365,6 +365,10 @@ func scanVerbose(
}
}
+// SeccompPresets is the [seccomp] presets used by exec artifacts.
+const SeccompPresets = std.PresetStrict &
+ ^(std.PresetDenyNS | std.PresetDenyDevel)
+
// cure is like Cure but allows optional host net namespace. This is used for
// the [KnownChecksum] variant where networking is allowed.
func (a *execArtifact) cure(f *FContext, hostNet bool) (err error) {
@@ -388,8 +392,7 @@ func (a *execArtifact) cure(f *FContext, hostNet bool) (err error) {
z := container.New(ctx, f.GetMessage())
z.WaitDelay = execWaitDelay
- z.SeccompPresets |= std.PresetStrict &
- ^(std.PresetDenyNS | std.PresetDenyDevel)
+ z.SeccompPresets = SeccompPresets
z.SeccompFlags |= seccomp.AllowMultiarch
z.ParentPerm = 0700
z.HostNet = hostNet