Menu

Sandboxing subprocesses with Landlock in Go 1.28

Reddit r/golang·u/atkrad·about 1 month ago
#nrVFtPX3
#landlock#subprocess#sandboxing#apply#ruleset
Reading 0:00
15s threshold

I was looking through the upcoming Go 1.28 changes and found the new Landlock support in syscall.SysProcAttr interesting.

It lets Go apply a Landlock ruleset to a subprocess without restricting the parent process. We still need to create the ruleset ourselves, but we no longer need a separate launcher just to apply it to the child.

I wrote a short article with a runnable example that blocks directory creation in the subprocess while allowing it in the parent.

It's based on the development version of Go 1.28, so the API may still change before release.

https://abdolirad.me/articles/go-1-28-landlock-subprocess-sandboxing/