-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to compile firejail non-setuid #1846
Comments
I'm not an expert - but here are some thoughts:
|
I think it's worth considering, with a few reservations: 😄
If someone compiles with --nosetuid, might they be lulled into a false sense of security with the belief that seccomp and the other above options are working, when they're really not? Esp. in cases like Fedora, where (if they use this approach) the user may not even be aware that it's running without the setuid bit.
|
@curiosity-seeker
This is interesting approach. System daemons can still be sandboxed as they're started by root which has always access to firejail binary. However this is packaging issue which still can be unacceptable for some distros. @Fred-Barclay
That would be very helpful to decide if this approach make any sense to follow. Unfortunately I'm unable to compile such list. |
Yes, you're right. of course. |
I've tried what is suggested above in b).
Works well. No problems so far. |
You probably mean |
Yes, sorry - typo :-( |
Non-suid install here: ff1599f You configure as usuall, and add --disable-suid:
The variant with mode 4750 and group firejail seems to be working fine, but I'll do some more testing. After you add yourself to the group just remember to logout and login again. |
@netblue30 can you elaborate what are consequences of BTW: I think we could make mode 4750 and group firejail official recommendation. |
@Vincent43 The issue I see with mode 4750 and group firejail is that every single user on a system (I believe) will have to be manually added to the firejail group. Whereas with the current method, every user can run firejail. It's certainly a great alternative, but I'm not sure it's suited for official recommendation (at least, not as the default). |
Yes, it can be an issue on multi-user systems. On Archlinux it can be fixed by using |
If I'm seeing it correctly, my user doesn't belong to
|
Hm, maybe they changed it recently. |
The sandbox will work only if you start it as root (for example if you run servers).
Will do! However, it will work only for more technical users. For non-technical users I have this plan:
Question: is anybody using --git-install? I intend to remove it. |
I'm not. I just clone and build from source manually.
Good to know! So everything will still work as usual?
What advantages does this offer over the current method? Can we have an option for people who don't use Can we pass a list of users when running the code to add users to /etc/firejail/firejail.users? |
Yes.
Yes, it will handle the same problem. It is easier to install than 4750/root:firejail, and we can make it invisible to the users.
Sure, it is very easy to implement. I should also add a --remove-users. Or we can allow root user edit /etc/firejail/firejail.user with a text editor. |
The This way it would be transparent for users but won't need duplication of existing functionality in firejail |
What @Vincent43 said, with the exception that I would prefer us using something other than sysusers.d. There are still some distros out there where systemd isn't necessarily installed (Gentoo) or almost definitely isn't present (Devuan, the Arch and Manjaro OpenRC folks at Artix, and so on). |
Kees Cook writes in his excellent blog regarding security enhancements in kernel 5.1:
Could this become relevant for Firejail? |
No, firejail needs to be root. |
Currently there are two ways to build sandboxes in linux:
Firejail is traditionally compiled as setuid binary but it can also use user namespaces when they're available. Both have their own security issues.
Some distros like Fedora or Opensuse are reluctant to add setuid binaries to official repos which means no firejail for their users. If we add possibility to compile firejail as non-setuid binary (
--nosetuid
?) which uses unprivileged user namespaces to create sandbox then will be more chance that those distros will accept official firejail package. Also all users who are afraid of setuid bit will have alternative. Bubblewrap already provides this choice (on Archlinux and Debian it's compiled as setuid, on Fedora it uses namespaces).The text was updated successfully, but these errors were encountered: