[0]: https://blog.cloudflare.com/sandboxing-in-linux-with-zero-li...
Sandboxing _can_ be without overhead, but in the case of firejail it's definitely not the case.
Could you please name which application, and how do you notice it?
I don't know if it also makes a difference during execution.
EDIT: it's kinda amusing to get downvoted on this.
a) There's no performance issue. Just use linux sandboxes
b) There are these possible performance hits
c) I use those sandboxes and I have observe X performance issues.
a) Your performance issues are not valid performance issues, because I say so.
Ok, gotcha
seccomp has very little impact but it's not 0:
https://wiki.tizen.org/Security:Seccomp#Performance_Analysis
firejail or systemd isolation techniques (using a variety of methods such as mounting a private version of directories or initiating ACL's at application start) are extremely lightweight but not 0. Most processes (regardless of desktop or server) usually live long enough (more than a few seconds anyway) to justify any theoretic impact. Even firejail on an ancient desktop system will not change things so that it's noticeable by a user imo.
Now, there is some overhead in forking a child process to have different capabilities than the parent, and some overhead in using a pipe/shared memory to communicate between the sandboxed child and the parent, but that overhead should be tiny compared to the work of decoding compressed video, etc.
Essentially, I'm imagining a bunch of isolated VMs. How is that wrong in practice?
Your OS already has a layer that checks, when a process tries to open a file or access a bit of hardware, whether you have permission to access it. Your CPU has a layer that checks, when you try to read or write a given memory address, whether you have the right permissions. And so on.
A lot of sandboxing amounts to making those existing checks more restrictive - telling the OS "If this program running as John Doe asks to open a file, instead of treating it like John Doe treat it like someone with no files at all" - which is no slower than what the OS was doing anyway.
The sandboxing that comes with performance penalties is generally doing more than just sandboxing - for example, Ubuntu's 'snaps' have sandboxing, but they also duplicate a bunch of libraries for compatibility reasons.
Out of boredom, I started 400 containers with podman running only bash in Ubuntu. It used less than 1 GB of RAM in total. podman is likely overkill if you just want sandboxing, however.
I'm sure there are still tradeoffs to containerization but at least the overhead is minimal.