-
Notifications
You must be signed in to change notification settings - Fork 588
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
add restrict-namespaces to (almost) all applicable profiles #5537
add restrict-namespaces to (almost) all applicable profiles #5537
Conversation
Cool! |
Excellent work!
The relationship in web browsers between (1) user namespaces / their internal sandbox functionality and (2) Firejail's own sandbox always interested me. It also almost always evades me. Got lots of learning to do, but @rusty-snake and I touched on this topic just recently. Looking forward to doing some comparisons running Firefox with different sets of restrict-namespaces=foo. It would be nice if we could provide a wiki page on this exotic topic in the future, offering advice on how to go about setting things up and potential security pitfalls. But we'll have plenty of time to come back to this now that restrict-namespaces is in the profiles! |
I think I introduced a bug in ping-hardened.inc.profile. From the calling ping.profile:
Somehow I cannot find this hardened ping or its source code, do you still have a sample at hand (I noticed you contributed the profile), or could you maybe point me to the right place? That would be awesome. What I would like to know is if |
@smitsohu I indeed contributed that extra include option. But there's no special version or any custom software package involved. At the time I simply noticed that there's a considerable difference in behaviour of On Ubuntu I still cannot include ping-hardened.inc.profile. It keeps breaking ping there so the comments are still valid. On Arch Linux ping still works fine with $ pacman -Q iputils
iputils 20221126-1 $ cat /etc/firejail/ping.local
# Firejail profile for ping
# Persistent local customizations
# hardened-malloc (blacklisted by globals.local)
noblacklist /usr/lib/libhardened_malloc.so
env LD_PRELOAD=/usr/lib/libhardened_malloc.so
## system-wide profile
#+ overrides
# Add the next line to your ping.local if your kernel allows unprivileged userns clone.
include ping-hardened.inc.profile
protocol unix,inet
ignore protocol
private-bin ping
private-etc alternatives,ca-certificates,crypto-policies,hosts,nsswitch.conf,pki,resolv.conf,ssl
# hardened-malloc
private-lib libhardened_malloc.so |
@glitsj16 Thank you! Then we can leave it as is. Just |
@smitsohu Very welcome. And thank you for comfirming |
Closes #5440
My algorithm was roughly as follows:
# Redirect
tagseccomp
directiverestrict-namespaces
ifseccomp
is commented outrestrict-namespaces
if there is aseccomp !chroot
directive, indicating use of a new user namespacerestrict-namespaces
to all other profiles, including default.profile and server.profileThere are a few special cases, among them: basilisk.profile, palemoon.profile, fdns.profile, unbound.profile.
I didn't attempt for now to fit
restrict-namespaces
to common browsers.