mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #554] Firejail security features limited with Chromium based browsers? #390
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#390
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 @Kebron718 on GitHub (Jun 2, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/554
Hello,
I'm fairly new to the Linux world and before that I was using Opera and Firefox with Sandboxie.
Looking at the various profiles I noticed that Chromium based browsers do not use most of the security features enabled in the firefox profile like e.g. seccomp, caps.drop all, nonewprivs, noroot.
I know that Chromium has some sandboxing features included. Is this the reason why these features are not in the profile?
I tried putting seccomp in the chromium profile but the browser window would not open.
I could not find anything specific on that subject in the man pages or on the web. Maybe you could elaborate on the reasons for these differences for less experienced users like me.
Secondly, is it save to say that using 'firejail chromium / chrome / opera' with their profiles not including seccomp, etc. is as secure as using 'firejail firefox'?
Best
Kebron718
@netblue30 commented on GitHub (Jun 2, 2016):
Chromium/Opera/etc are distributed with a similar security sandbox. Some features in Firejail are disabled in order to allow this security sandbox to run - you cannot run both of them.
@nick75e commented on GitHub (Jun 2, 2016):
I don't trust closed-source software so this is why I use firejail with Chrome even though Opera/Chrome(ium) come with their own sandbox.
I've managed to use Chrome with firejail by disabling its sandbox with
google-chrome -no-sandboxcommand (there must be something similar for Chromium and Opera). Then you can use all the options you mentioned.P.S.: Opera/Chrome's sandbox can protect you from the internet but what's protecting you from Opera/Chrome, just saying...
@requiredregistration commented on GitHub (Jun 3, 2016):
google chrome and opera are based on chromium (which is open source). the sandbox of chromium uses a few of the same features that are used by firejail for security.
@ncouture commented on GitHub (Sep 3, 2016):
@netblue30 what do you think of the chrome sandbox?
@netblue30 commented on GitHub (Sep 3, 2016):
Firejail is modeled after the chrome sandbox.
@Futureknows commented on GitHub (May 22, 2017):
So is the bottom line Chromium/Chrome are just as safe without Firejail? Google and trust aren't in the same universe.
@curiosity-seeker commented on GitHub (May 22, 2017):
No, they aren't. It's important to understand the security architecture of Chromium:
The renderer processes and the broker process communicate with each other via IPC. That site says:
"Security bugs in IPC can have nasty consequences (file theft, sandbox escapes, remote code execution)."
And here is where Firejail comes into play. If you look at the Chromium profile you'll see that through the included *.inc files many important folders/files are blacklisted. Moreover, the Chromium profile is a whitelisted profile which means that Chromium - specifically the broker process - has only access to the files/folders in your home directory which are explicitly whitelisted. And it contains various more options which tighten the sandbox even more.
So, to cut a long story short: Chromium/Chrome sandboxed with Firejail goes far beyond what Chromium offers by default.
P.S.: @netblue30 caps.keep sys_chroot,sys_admin works for me. Perhaps you or someone else can test this, too, so that we could further harden the profile.
@Fred-Barclay commented on GitHub (May 22, 2017):
@curiosity-seeker Awesome! See
0216073889@Ferroin commented on GitHub (May 23, 2017):
Just to clarify a bit more:
In general, I would suggest to most people that you want to use the firejail profile as-is, because using
-no-sandboxand adding seccomp to the firejail profile actually reduces the internal security of the browser.@curiosity-seeker commented on GitHub (May 23, 2017):
@Ferroin : Absolutely! I had actually planned to write a similar answer to @nick75e 's post but forgot about it.
Regarding your point 1.: This is becoming even more important as the Chromium developers are about to improve site isolation.
@curiosity-seeker commented on GitHub (May 23, 2017):
@Fred-Barclay : Thanks! So this works also for you. Good to know!
@Kebron718 commented on GitHub (May 23, 2017):
Hello,
glad to see that there‘s some new life in this thread.
I‘ve been running Chromium on Leap with the following additions to the Chromium profile without any problems:
I noticed that using
protocol unix,inet,inet6,netlinkseems to at least partially enable seccomp in Firejail. At least it says so in Firetools/Tools. By removing the protocol entry it shows seccomp: disabled.Would it be better security-wise to remove the protocol entry altogether because it might interfere with Chromium’s built-in seccomp sandbox or should I leave it in as an additional layer of security?
PS
I also noticed the entry
ipc-namespacein the Firefox profile. Does it make any sense adding it to the Chromium profile as well?@Ferroin commented on GitHub (May 23, 2017):
@Kebron718 I'm not entirely sure. I believe that the protocols thing uses Seccomp-BPF to do syscall argument inspection to limit what protocols can be used, and I think that coexists fine with further seccomp restrictions, so unless you're seeing error messages about sandboxing from Chromium, I would assume that it doesn't interfere with Chromium's seccomp usage.
As far as IPC-namespace, that may or may not break things. I don't know enough about how Chromium's internal sandboxing is done at a low level to know for certain.
@curiosity-seeker commented on GitHub (May 25, 2017):
@Kebron718 : I must admit that I'm really puzzled! I tried the options you suggested on Fedora 25 - and they work for me! I had tried
caps.drop alla long time before and Chrome wouldn't start, that's why I had been usingcaps.keep sys_chroot,sys_adminfor a while. So it seems that something has changed in the inner workings of Chrome.I can also confirm that after enabling
protocol unix,inet,inet6,netlinkFiretools reports seccomp as enabled. Very interesting, indeed!@netblue30: Do you have an explanation for this behavior?
@netblue30 commented on GitHub (May 26, 2017):
Yes, protocol statement is implemented as a separate seccomp filter. So, you end up with two seccomp filters installed.
Is it possible Suse/Leap people disabled the sandbox embedded in chromium? If that's the case, you should also try to add "seccomp" to your profile.
@Ferroin commented on GitHub (May 26, 2017):
New enough versions of the Linux kernel don't require special capabilities (or EUID=0) to create user namespaces, which means that on such kernels, the sandboxing in Chromium/Chrome/etc behaves a bit differently from an outside perspective, and
caps.drop allshouldn't prevent the sandboxing from working.. I think that the current kernel shipped in openSUSE Leap has the patches that do this, but I'm not 100% certain about it.@curiosity-seeker commented on GitHub (May 26, 2017):
Well, I'm using Fedora 25 (64bit), and chrome://sandbox reports that the Namespace-Sandbox, the PID-Namespaces, Netwerk-Namespaces and the"Seccomp-BPF"-Sandbox are enabled and that "Seccomp-BPF"-Sandbox supports TSYNC". The SUID-Sandbox and YAMA-LSM are disabled. If I enable seccomp on the profile, Chrome doesn't start. Without seccomp, above options work for me.
@Ferroin commented on GitHub (May 26, 2017):
I'm pretty certain the 'SUID-Sandbox' thing is what Chrome/Chromium reports as enabled when it needs to run SUID root or with CAP_SYS_ADMIN to get the sandboxing working right, which is what I was talking about above that isn't needed on newer Linux kernels.
The YAMA thing you don't need to worry too much about, it's a kernel-side protection that Chrome/Chromium doesn't have any control over, but is unnecessary on most systems that use SELinux (including Fedora) because the SELinux default policies already handle what YAMA protects against (namely, ptrace() based attacks).
As far as seccomp being enabled in firejail breaking Chrome sandboxing, I'm pretty sure Firejail explicitly disables further modification of Seccomp-BPF state.
@Fred-Barclay commented on GitHub (May 26, 2017):
If I'm understanding this correctly, we can add
caps.drop allto the Chrome profile in a year or two, after Debian Jessie/Ubuntu 14.04/other distros with older kernels are EOL?@netblue30 commented on GitHub (May 27, 2017):
It's been there since kernel 3.10, but very few distros have it enabled by default. Ubuntu and Mint have it by default, in Debian you need to be root to use it, Arch doesn't have it compiled in the kernel.
@curiosity-seeker commented on GitHub (May 27, 2017):
I think this corresponds to what the Chromium doc says: The setuid is enabled for old kernels (or kernels without above change), the user namespaces sandbox is enabled for new kernels.
@Fred-Barclay : In this respect I guess that we can add this change in a year or two, provided that distros like Arch Linux will have enabled user namespaces by then. So far the Arch developers haven't as they say that there are still too many bugs in user namespaces. Let's hope that this will change over time.
@Fred-Barclay commented on GitHub (May 27, 2017):
@curiosity-seeker That's right - I'd forgotten about Arch. Lack of user namespaces is one reason I haven't stuck with Arch for very long. 😞
@curiosity-seeker commented on GitHub (Jun 1, 2017):
FWIW, this works for me on Fedora 25 for google-chrome-stable:
EDIT: As a matter of fact above seccomp.keep plus seccomp work for me (considering this which I hadn't known before):
@curiosity-seeker commented on GitHub (Jun 2, 2017):
BTW, is there any reason why disable-develop.inc is not in the profile? I've added it and it doesn't cause any problems so far.