mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3942] gVisor backend #2464
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#2464
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Feb 2, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3942
gVisor emulates the majority of linux syscalls in userland, providing a respectable sandbox.
gVisor provides a runtime (runsc) capable of running OCI spec containers. https://gvisor.dev/docs/user_guide/quick_start/oci/
It should be possible to either modify gVisor to accept a different interface or to have firejail output an OCI config for an OCI runtime.
gVisor already has something that may be a starting point:
sudo runsc do echo ok@topimiettinen commented on GitHub (Feb 3, 2021):
I think virtualization is one of the missing pieces of Firejail. It would allow much better system call interception than seccomp (which can't dereference pointers), even very low level operations like filtering of CPU instructions or messing with page tables. Some Spectre-type attacks could be prevented by flushing caches and inserting a random small delay at every system call. This would be too expensive for all applications but maybe acceptable for Firejail. Detection of ROP, JOP or Spectre-class attacks would be awesome. Application checkpoint/restore would be nice too. Windows seems to use VMs to virtualize processes at OS level, so Linux is behind here.
Running runsc or writing OCI config files seems to be way too high level interface. Instead the interface should be a C library with very detailed control. System call intercepting should be done by Firejail, for example gVisor could call a plugin provided by Firejail. gVisor also duplicates sandboxing functions already implemented in Firejail, like network or file system filtering features, but perhaps that can be ignored.
@topimiettinen commented on GitHub (Feb 3, 2021):
I opened a feature request for gVisor: https://github.com/google/gvisor/issues/5440
@ghost commented on GitHub (Feb 23, 2021):
gVisor is intriguing because it's a far better sandbox than firejail, bwrap, nsjail or any others. Unfortunately the OCI spec is quite lame, but I think I will use it anyway.
Note that it doesn't appear to implement unix sockets correctly, can't get the x11 or wayland sockets to work even with --fsgofer-host-uds. So it would appear to be restricted to non-graphical applications.
gVisor in contrast to seccomp does not pass any syscalls, it interprets them. Those it can service itself it does, others it services by calling syscalls itself but there is never direct pass-through. Which is far superior isolation to seccomp. It uses seccmp on itself too of course to restrict itself from calling arbitrary syscalls should it be compromised.