mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #328] How to easily use private-bin #231
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#231
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 @chiraag-nataraj on GitHub (Feb 27, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/328
I'm trying to further lock down Firefox beyond the default profile. I've already used
private-tmpandprivate-etcas well as only allowing certain directories and files in my home directory usingwhitelist. My next hope was to further restrict what firefox is able to do usingprivate-bin. I tried only whitelistingfirefox,iceweasel(this is a Debian system),sh, andwhichand now, while firefox tries to start up, it gives me a/usr/bin/libxul.so not foundwhich makes sense (libxul.sois in/usr/lib, not/usr/bin). I guess all this is a long-winded way of asking how I can figure out which binaries are required by iceweasel/firefox so I can whitelist only those binaries. None of the current trace/debug options give enough info for this as far as I can tell.@netblue30 commented on GitHub (Feb 27, 2016):
I am on Debian 8 here. In a terminal I run "sudo firemon". This prints out all processes forked by your application in the sandbox. In another terminal I start "firejail /usr/lib/iceweasel/iceweasel". This is what I get in firemon terminal:
It looks like the only thing I need from /bin is bash. I close firefox window and I start again, this time using private-bin:
Play some youtube videos, just in case it requires some other executables in /bin - you'll find them listed in firemon window.
@netblue30 commented on GitHub (Feb 27, 2016):
At some point playing with it I also get:
This means I need to add ps, grep, and sh to the list:
@chiraag-nataraj commented on GitHub (Feb 27, 2016):
Awesome thanks!
@chiraag-nataraj commented on GitHub (Feb 27, 2016):
I just tried using firemon and this is the output I get (at the beginning):
and then it continues with other things. The thing is just whitelisting
/bin/sh,/usr/bin/which,/usr/bin/dbus-launch,/usr/bin/firefox, and/usr/bin/iceweaselisn't enough for some reason. It's now giving a different error saying "Unable to find Mozilla runtime".@chiraag-nataraj commented on GitHub (Feb 27, 2016):
Could this be because /usr/bin/iceweasel is a symbolic link to /usr/lib/iceweasel/iceweasel?
@chiraag-nataraj commented on GitHub (Feb 27, 2016):
Yeah, that's why this is happening. Basically, since
/usr/bin/iceweasel -> /usr/lib/iceweasel/iceweasel, firejail is getting confused. Is there a workaround for this at the moment besides manually calling /usr/lib/iceweasel/iceweasel instead of /usr/bin/firefox? I guess I could just add /usr/lib/iceweasel/ to the path or something or hard-link /usr/lib/iceweasel/iceweasel to /usr/bin/iceweasel.@chiraag-nataraj commented on GitHub (Feb 27, 2016):
Sorry for all the comments, but just wanted to comment as to how I resolved this finally.
Since the
/usr/bin/firefoxscript checks for the existence of/usr/bin/firefox.real, I set up a shell script that just calls/usr/lib/iceweasel/iceweaseland put it in that location. Now I can use private-bin and just usefirejail firefox!@netblue30 commented on GitHub (Feb 27, 2016):
Or you can just add a shell script as /usr/local/bin/iceweasel, and then you just type "iceweasel". It also works with you desktop environment menus. I am using something like this:
@chiraag-nataraj commented on GitHub (Feb 27, 2016):
Ah...yeah, I guess that works too. I guess I like explicitly knowing when I'm sandboxing something.