aboutsummaryrefslogtreecommitdiffhomepage
path: root/fst/sandbox.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-04-13 03:23:28 +0900
committerOphestra <cat@gensokyo.uk>2025-04-13 03:30:19 +0900
commit31b7ddd122d54c36edb101d2c8bdf230651f27d4 (patch)
tree2dd0623bfa0d410d83aabfc51d276df3a14ef3e8 /fst/sandbox.go
parentc460892cbdfa66a2cf1f0ebcec59cf550e67962e (diff)
fst: improve config
The config struct more or less "grew" to what it is today. This change moves things around to make more sense and fixes nonsensical comments describing obsolete behaviour. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'fst/sandbox.go')
-rw-r--r--fst/sandbox.go63
1 files changed, 0 insertions, 63 deletions
diff --git a/fst/sandbox.go b/fst/sandbox.go
deleted file mode 100644
index c4936a2e..00000000
--- a/fst/sandbox.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package fst
-
-import (
- "git.gensokyo.uk/security/fortify/sandbox/seccomp"
-)
-
-// SandboxConfig describes resources made available to the sandbox.
-type (
- SandboxConfig struct {
- // container hostname
- Hostname string `json:"hostname,omitempty"`
-
- // extra seccomp flags
- Seccomp seccomp.FilterOpts `json:"seccomp"`
- // allow ptrace and friends
- Devel bool `json:"devel,omitempty"`
- // allow userns creation in container
- Userns bool `json:"userns,omitempty"`
- // share host net namespace
- Net bool `json:"net,omitempty"`
- // expose main process tty
- Tty bool `json:"tty,omitempty"`
- // allow multiarch
- Multiarch bool `json:"multiarch,omitempty"`
-
- // initial process environment variables
- Env map[string]string `json:"env"`
- // map target user uid to privileged user uid in the user namespace
- MapRealUID bool `json:"map_real_uid"`
-
- // expose all devices
- Device bool `json:"device,omitempty"`
- // container host filesystem bind mounts
- Filesystem []*FilesystemConfig `json:"filesystem"`
- // create symlinks inside container filesystem
- Link [][2]string `json:"symlink"`
-
- // direct access to wayland socket; when this gets set no attempt is made to attach security-context-v1
- // and the bare socket is mounted to the sandbox
- DirectWayland bool `json:"direct_wayland,omitempty"`
-
- // read-only /etc directory
- Etc string `json:"etc,omitempty"`
- // automatically set up /etc symlinks
- AutoEtc bool `json:"auto_etc"`
- // cover these paths or create them if they do not already exist
- Cover []string `json:"cover"`
- }
-
- // FilesystemConfig is a representation of [sandbox.BindMount].
- FilesystemConfig struct {
- // mount point in container, same as src if empty
- Dst string `json:"dst,omitempty"`
- // host filesystem path to make available to the container
- Src string `json:"src"`
- // do not mount filesystem read-only
- Write bool `json:"write,omitempty"`
- // do not disable device files
- Device bool `json:"dev,omitempty"`
- // fail if the bind mount cannot be established for any reason
- Must bool `json:"require,omitempty"`
- }
-)