It's not based on Bubblewrap
It always annoyed the hell out of me to run random binaries from the internet without any real control over what they can access.
Totally agree! But when I tried to build landrun it downloads code from several github accounts. Random dependencies from the internet are a worse security risk than what it is trying to solve. I'd sandbox Firefox (the only binary to be an obvious entry point for hackers on a typical desktop machine). But for this I need to trust that none of the github accounts "russross", "urfave", "cpuguy83" or "xrash" on github have been compromised by hackers (unlikely but not impossible), and therefore increases the attack surface.
go build -o landrun cmd/landrun/main.go
go: downloading github.com/urfave/cli/v2 v2.27.6 go: downloading github.com/landlock-lsm/go-landlock v0.0.0-20250303204525-1544bccde3a3 go: downloading kernel.org/pub/linux/libs/security/libcap/psx v1.2.70 go: downloading golang.org/x/sys v0.26.0 go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.5 go: downloading github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 go: downloading github.com/russross/blackfriday/v2 v2.1.0
Yeah agreed, the "Supply chain" problem of OSS will bite us in the ass someday, although if you are willing to trust me, you should definitely trust likes of unfave!
... it is a little ironic that the README.md for a tool that is supposed to help mitigate the risk of running software from a random source on the Internet tells me to `go install github.com/zouuup/landrun/cmd/landrun@latest`
Ahem, go install builds from source, so you're not trusting a binary. That said... you can always run landrun in landrun.
# landrun --rox
/usr touch /tmp/file
touch: cannot touch '/tmp/file': Permission denied
# landrun --ro/xusr --rw /tmp touch /tmp/file
#
Why does this matter?
Landlock is a Linux Security Module (LSM) that lets unprivileged processes restrict themselves.
It's been in the kernel since 5.13, but the API is awkward to use directly.
It always annoyed the hell out of me to run random binaries from the internet without any real control over what they can access.
Features:
Works with any CLI command
Secure-by-default: deny all, allow only specified paths
No root, no special privileges required
More convenient than selinux, apparmor, etc
Written in Go, small and fast
GitHub:
https://github.com/Zouuup/land...
Put no trust in cryptic comments.