mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2397] Nix, snap, appimage support #1598
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#1598
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 @jackTaw88 on GitHub (Feb 10, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2397
Hi,
It would be great if we have nix, appimage and snap builds. So we don't need to install firejail to OS.
I found a nix package of firejail. I installed it but it gives error on any command I type:
I could not open nautilus or firefox.
Than I installed firejail with apt-get. It worked.
But now it does not work for snap applications. For example I can not start the chromium which is installed as 'snap':
It would be great to have snap support like appimage.
Thanks in advance
@ghost commented on GitHub (Feb 10, 2019):
Hi @jackTaw88 I'm not too familiar with snap packages, but did you try the
/etc/firejail/snap.profilewith your chromium snap yet? Allthough it has an erroneous Description (see https://github.com/netblue30/firejail/pull/2398 for a fixI), it might be the way you need to start snaps with firejail, very much like the --appimage option for AppImages:$ firejail --profile=snap chromium
@Vincent43 commented on GitHub (Feb 11, 2019):
snaps have their own sandbox so I don't think it's useful or even possible to run them with firejail. Creating snap for firejail itself is something different though.
@jackTaw88 commented on GitHub (Feb 11, 2019):
@glitsj16
Also opera snap gives the same output error :( Is there another thing I can try?
@Vincent43 can someone give support for snap packages?
For example 'nix' packages works with firejail.
@ghost commented on GitHub (Feb 11, 2019):
@jackTaw88 I'm afraid that was just about all I could track down on firejailing snap packages.
@Vincent43 That makes sense, the part about it not being useful to run snap packages with firejail I mean. In that context it might only be confusing users if they see a
snap.profiledon't you think? Besides considering dropping that, I wonder if anyone knowledgeable is considering adding a section to the firejail man on AppImages, Snaps, Flatpaks and the likes?@Vincent43 commented on GitHub (Feb 12, 2019):
@jackTaw88 AFAIK nix packages aren't sandboxed while snaps are. That's why one work and other don't. Snap daemon needs similar privileges as firejal so it's not possible to combine them together.
@glitsj16 I agree that snap.profile is confusing and doesn't have a chance to work so it should be dropped. AppImages are already documented. For snap and flatpak we could add a line that they won't work.
@curiosity-seeker commented on GitHub (Feb 12, 2019):
@Vincent43
I must admit that I've never used snaps. But according to this site there are not only snaps with a strict confinement but also with a classic confinement which "Allows access to your system’s resources in much the same way traditional packages do. To safeguard against abuse, publishing a classic snap requires manual approval, and installation requires the --classic command line argument."
So perhaps for this second confinement level it makes still sense to sandbox them with Firejail?
@Vincent43 commented on GitHub (Feb 12, 2019):
It may vary across specific snaps but those may need system wide access (that's supposedly the reason they couldn't be sandboxed with snap). There's also problem how well firejail will co-operate with snap daemon (not very well, I assume 😄 ).
@ghost commented on GitHub (Feb 13, 2019):
After reading up on snaps at https://docs.snapcraft.io/, it's only fair to try and clear up any initial confusion I introduced in this thread (see above). The
/etc/firejail/snap.profileis solely about sandboxing thesnaptool that interacts with snap packages and gets installed withsnapd.As @Vincent43 already stated a few times, confining individual snap packages is in the hands of snapd and out of firejail's reach. Hence the command I suggested @jackTaw88 was never going to work (what was I thinking?). Too make matters worse I jumped the gun, and suggested to drop /etc/firejail/snap.profile alltogether.
I was mistaken here, very much so even. @Vincent43: if my understanding is correct, there is nothing in this thread yet to conclude the snap.profile doesn't have a chance to work. A refactored version in fact now works as expected, like any other application profile. Simply put: firejail the snap tool, sure - firejail a snap package, not feasible. At least that is what my tests suggest after seriously redoing snap.profile.
@jackTaw88 I hope this clears up some of the confusion. You can use firejail protection on any
snapcommand just fine:$ firejail snap list
$ sudo firejail snap install chromium
$ sudo firejail snap remove chromium
To actually start a snap app version of chromium after installation you need to use a command where firejail doesn't enter the picture:
$ env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/chromium_chromium.desktop /var/lib/snapd/snap/bin/chromium
Phjew, hope this helps. Time for some none-snapping recreation :-)
@Vincent43 commented on GitHub (Feb 14, 2019):
I'm not sure if there is security benefit for executing snap like this as without firejail it should work without sudo (it asks for auth through polkit but the process run as unprivileged user) . Sandboxing things while having to run them as root isn't much security wise.
Did you tested that there are no regressions when installing/removing snaps with firejail? For example it should create apparmor rules dynamically during install/remove packages.
Even if sandboxing snap command with firejail can technically work I don't see it as being relevant for security and there is a risk it could break things. That's why I would still opt for removing
snap.profilecompletely.@ghost commented on GitHub (Feb 14, 2019):
Hi @Vincent43 Yes I tested quite extensively and as far as I could tell there were no such regressions. Apparmor rules get created/destroyed exactly like when running vanilla snap commands without firejail. I retested and the sudo indeed is not needed. But I do see the validity of your points. Taking out the snap.profile it is.
@jackTaw88 commented on GitHub (Feb 15, 2019):
Thank you :)