Nim adapter for the Seccomp sandbox facility
-
Provides a high-level adaptor in seccomp.nim
-
Low-level wrapper in seccomp_lowlevel.nim
-
Tested on Linux
-
Basic tests
Refer to the generated documentation for the seccomp and seccomp_lowlevel modules
import seccomp
setSeccomp("write exit_group")
echo """Seccomp is now enabled. Future attempts to change the Seccomp configuration
or to call forbidden system calls will cause the process to be terminated"""
# e.g. createDir("/tmp/foo")
or:
import seccomp
let ctx = seccomp_ctx()
ctx.add_rule(Allow, "write")
ctx.add_rule(Allow, "exit_group")
ctx.load()
tests/trigger_seccomp.nim contains running examples of syscalls that will be blocked