Background
Today I couldn't get sandlocked bun to work, where either bun repl or bun test silently exits with code 1. I figure it may have something to do the syscall filtering enforced by sandblock after ruling out possible interfering of filesystem rules.
Problem
The CLI help page reports two relevant options on this, --extra-deny-syscall and --extra-allow-syscall. Despite similar naming, notice that --extra-allow-syscall only accepts syscall group instead of specific syscalls, which is fairly confusing.
--extra-deny-syscall <NAME>
Extra syscall names to deny (in addition to Sandlock's default blocklist)
--extra-allow-syscall <NAME>
Extra syscall group names to allow (e.g. sysv_ipc)
After consulting the source code, there seems to be only two groups defined so far, default and sysv_ipc. And sysv_ipc is the only one we are able to disable with the option.
Questions
- I notice that the default syscall blocklist is quite comprehensive. Must the default blocklist be enforced to protect the security model
sandlock is based off? For example, would sandbox escape become possible if I check some syscalls off from the default blocklist?
- If the opt-out is not an option due to the first point, does it limit the use cases of
sandlock even for some common development tasks (say bun in my example)?
Background
Today I couldn't get sandlocked
bunto work, where eitherbun replorbun testsilently exits with code 1. I figure it may have something to do the syscall filtering enforced bysandblockafter ruling out possible interfering of filesystem rules.Problem
The CLI help page reports two relevant options on this,
--extra-deny-syscalland--extra-allow-syscall. Despite similar naming, notice that--extra-allow-syscallonly accepts syscall group instead of specific syscalls, which is fairly confusing.After consulting the source code, there seems to be only two groups defined so far,
defaultandsysv_ipc. Andsysv_ipcis the only one we are able to disable with the option.Questions
sandlockis based off? For example, would sandbox escape become possible if I check some syscalls off from the default blocklist?sandlockeven for some common development tasks (saybunin my example)?