3 ms·
> > Pledge / unveil on userland > This sounds very nice, is there anything similar on Linux? Seccomp is the closest thing we have to pledge, and it is used by
by cyphar 6y ago
> > Pledge / unveil on userland
> This sounds very nice, is there anything similar on Linux?
Seccomp is the closest thing we have to pledge, and it is used by some programs to restrict the set of operations they can do (but the most common use of seccomp profiles is containers -- pretty much all container runtimes apply a default seccomp profile to reduce kernel attack surface reachable by containers).
As for unveil, you could implement it with mount namespaces (or an LSM like AppArmor -- which isn't actually that hard to set up, but unprivileged users may have to go through extra hoops) but most programs don't do that themselves.
But in short, not really. Most security mechanisms in Linux are intended to be managed by administrators or system services rather than the program itself (with some exceptions, but even those exceptions end up being managed by system services in practice).
- gbrown_ 6y agoJust to add, pledge can be called repeatedly throughout the program to reduce the behaviors that are permitted unlike seccomp.
- cyphar 6y agoYou can do that with seccomp -- each filter is run along with the others and the most restrictive return value is used by seccomp. If a program in a seccomp sandbox couldn't add a new secxokp filter to itself, you wouldn't be able to run programs like OpenSSH inside containers (which you can).