I wonder if there’s a way to do this without requiring the creation of a new system user. Some way to revoke all write access for the current process.
https://www.freebsd.org/cgi/man.cgi?capsicum(4)
https://wiki.freebsd.org/Capsicum
https://www.cl.cam.ac.uk/research/security/capsicum/freebsd....
Capsicum is convoluted though.
OpenBSD has pledge and unveil, which from what I have seen are very elegant.
https://man.openbsd.org/pledge.2
https://man.openbsd.org/unveil
I wonder if there’s a way to do this without requiring the creation of a new system user. Some way to revoke all write access for the current process.