mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #141] Firejail with grsecurity #94
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#94
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 @netblue30 on GitHub (Nov 16, 2015).
Original GitHub issue: https://github.com/netblue30/firejail/issues/141
Moved from the blog:
Got a question regarding the “an existing sandbox was detected…” error. I’m running a grsec kernel, and I’ve got two users. User A has /usr/bin/firejail as the shell while user B has /bin/bash. When I bring up a terminal emulator (xterm, uxterm, or xfce terminal) in either of the users, I see this error. When I run firejail –tree, the processes shows up. Even when I log into something like TTY2 without a GUI, I get the same error when attempting to go into firejail or run something with firejail. Should I disable grsec’s chroot restrictions? I’ve tried disabling several (caps, fchdir, shmat, unix, ect) with out any success. When I run firejail without a grsec kernel, firejail works flawlessly. What do?
@password12345678 commented on GitHub (Nov 17, 2015):
Hi, thanks for responding to my inquiry so quickly!
Here's what I have in my config file http://pastebin.com/qk7zGHuj. The only exception is that I have TPE_RESTRICT_ALL and CHROOT_DENY_UNIX turned off in my sys turnable. I'm using the 4.2.6 kernel with grsecurity-3.1-4.2.6-201511141543.patch.
On a side note, I was messing around with my fstab, and found out that firejail can't have /usr/bin mounted in read-only. Here's what my fstab looks like now:
/dev/mapper/asdf-home /home ext4 nosuid,noatime,nodev 0 2
/dev/mapper/asdf-opt /opt ext4 discard,noatime,nosuid 0 2
/dev/mapper/asdf-usr--bin /usr/bin ext4 defaults,nosuid,noatime,rw 0 2
/dev/mapper/asdf-usr--local /usr/local ext4 defaults,nosuid,noatime,ro 0 2
/dev/mapper/asdf-usr--sbin /usr/sbin ext4 defaults,nosuid,,noatime,ro 0 2
/dev/mapper/asdf-var /var ext4 discard,noatime,nodev,nosuid 0 2
tmpfs /tmp tmpfs noatime,nosuid,nodev,size=2G 0 1
@netblue30 commented on GitHub (Nov 17, 2015):
I put a copy of your config here, in case it expires on pastebin:
@Kalle72 commented on GitHub (Nov 25, 2015):
The problem is related to the proc-restrictions of GrSec (CONFIG_GRKERNSEC_PROC=y, CONFIG_GRKERNSEC_PROC_USERGROUP=y or CONFIG_GRKERNSEC_PROC_USER=y). Assuming you have chosen "CONFIG_GRKERNSEC_PROC_USERGROUP=y" with the trusted group 123 then the user opening a firejail-instance must be member of group 123. Otherwise firejail cannot look onto /proc and fails with the "existing sandbox error" (I am on gentoo and tested it with my self-compiled hardened-kernel)
However, inserting the user into the trusted group 123 is more a workaround then a fix, because the user get rights he should not get.
One could overcome this problem if firejail would execute its instances as a special "user" (for example this user could be called firejail). (Polkit for example acts like that and uses the user polkitd for its actions. Therefore inserting polkitd into 123 solves all polkit related problems!)
Then one could put this special user (firejail) into the trusted group 123 without putting the regular user into the trusted group.
Additionally this would have one further advantage: With grsec one can forbid any network access to some user/group. Assuming that firejail opens a sandbox with the rights of the special user "firejail" one could forbid network access to the regular user but the regular user could open a program with network access via firejail. This leads to a regular user which can only access internet through firejail.
I hope this was understandable and not to chaotic ;-)
PS: If my suggestion is problematic, because one user is not sufficient if a bunch of regular users would use firejail at the same time on the same machine, one could introduce a firejail user named "user_firejail" for every regular user.
PPS: The "reply"-field on https://l3net.wordpress.com/projects/firejail/ does not work for me?!?
@netblue30 commented on GitHub (Nov 25, 2015):
Thanks for the write-up. I'll have to give it a try and see what is going on. What do you mean by "replay" field?
@Kalle72 commented on GitHub (Nov 25, 2015):
With reply-field I meant the field where one can write an answer.