diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-01 23:54:33 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-01 23:56:28 +0900 |
| commit | 3b8a3d3b004695d79745c34821b33cfbe41048a9 (patch) | |
| tree | bdc3ba42fa32e2d4c2c48305e8f381f40bc4c891 /internal/app/app_pd_linux_test.go | |
| parent | c5d24979f5d6095116d66beb544aa382816183f9 (diff) | |
app: remount root readonly
This does nothing for security, but should help avoid hiding bugs of programs developed in a hakurei container.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/app/app_pd_linux_test.go')
| -rw-r--r-- | internal/app/app_pd_linux_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/app/app_pd_linux_test.go b/internal/app/app_pd_linux_test.go index 7f0049bf..66cebe4f 100644 --- a/internal/app/app_pd_linux_test.go +++ b/internal/app/app_pd_linux_test.go @@ -2,6 +2,7 @@ package app_test import ( "os" + "syscall" "hakurei.app/container" "hakurei.app/container/seccomp" @@ -56,7 +57,8 @@ var testCasesPd = []sealTestCase{ Bind("/tmp/hakurei.1971/tmpdir/0", "/tmp", container.BindWritable). Bind("/home/chronos", "/home/chronos", container.BindWritable). Place("/etc/passwd", []byte("chronos:x:65534:65534:Hakurei:/home/chronos:/run/current-system/sw/bin/zsh\n")). - Place("/etc/group", []byte("hakurei:x:65534:\n")), + Place("/etc/group", []byte("hakurei:x:65534:\n")). + Remount("/", syscall.MS_RDONLY), SeccompPresets: seccomp.PresetExt | seccomp.PresetDenyDevel, HostNet: true, RetainSession: true, @@ -195,7 +197,8 @@ var testCasesPd = []sealTestCase{ Bind("/run/user/1971/hakurei/ebf083d1b175911782d413369b64ce7c/pulse", "/run/user/65534/pulse/native", 0). Place(hst.Tmp+"/pulse-cookie", nil). Bind("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/bus", "/run/user/65534/bus", 0). - Bind("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/system_bus_socket", "/run/dbus/system_bus_socket", 0), + Bind("/tmp/hakurei.1971/ebf083d1b175911782d413369b64ce7c/system_bus_socket", "/run/dbus/system_bus_socket", 0). + Remount("/", syscall.MS_RDONLY), SeccompPresets: seccomp.PresetExt | seccomp.PresetDenyDevel, HostNet: true, RetainSession: true, |
