Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

+1, escalating privileges in order to drop privileges is counterintuitive and risky.

This was the best possible solution for a while, but things are getting better with Landlock introducing unprivileged sandboxing for file accesses. There are helper libraries in Go and Rust at https://github.com/landlock-lsm, and it's easy to play around with it with the landlock-restrict example tool:

  $ go install github.com/landlock-lsm/go-landlock/cmd/landlock-restrict@latest
  $ mkdir /tmp/lolcat
  $ HOME=/tmp/lolcat landlock-restrict -ro /usr /lib /etc -rw /tmp/lolcat -- /bin/bash
The web browser I'm writing this from is sandboxed using the same example tool, so this works for bigger software as well. :) (Full disclosure, I'm the author of the go-landlock library.)

I'm having high hopes that this'll get used by a lot of other sandboxing software as well. :) (If you run into issues, please file bug reports, I'm interested to hear about it.)



> escalating privileges in order to drop privileges is counterintuitive

A lot of valid solutions are counterintuitive.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: