mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3665] With firecfg, how do I configure specific applications to go through firejail? #2310
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#2310
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 @Joe23232 on GitHub (Oct 13, 2020).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3665
I know that with the command
sudo firecfgwill get all the applications to open through firejail, however I don't want this, I want to only specify specific applications such as chromium etc.How would I achieve this if this is even possible?
@rusty-snake commented on GitHub (Oct 13, 2020):
Edit
/usr/lib/firejail/firecfg.config(path differs from distro and configure; uselocate firecfg.config). You should first create a backup of it.Use firecfg.py with custom groups (I work on more group control via command-line and config-file).
https://github.com/rahiel/firectl.
EDIT: added firectl
@Joe23232 commented on GitHub (Oct 14, 2020):
Hi thanks for your response,
Sorry but in regards to this step, what should I specifically edit in this file?
@rusty-snake commented on GitHub (Oct 14, 2020):
This file specifies for which programs firecfg creates symlinks (if they installed and have a profile). If a program is not listed there (or commented) no symlinks are created.
Example (create a backup; only set firefox, thunderbird and libreoffice)
@Joe23232 commented on GitHub (Oct 15, 2020):
Hey man
cat > /usr/lib/firejail/firecfg.config <<EOFsorry what doescat >and<<EOFmean? I know whatcatmeans but does this>do after thecat?@rusty-snake commented on GitHub (Oct 15, 2020):
That's are bash redirections.
https://www.cyberciti.biz/faq/using-heredoc-rediection-in-bash-shell-script-to-write-to-file/
https://wiki.bash-hackers.org/syntax/redirection
https://www.gnu.org/software/bash/manual/html_node/Redirections.html
Maybe it is easier to understand for you if it uses
echo. However, you do not need to understand them. It is enough to know what they do (replace /usr/lib/firejail/firecfg.config with thunderbird, firefox, libreoffice (see below)).Both snippets below do the same, replace /usr/lib/firejail/firecfg.config with
catwith a HERE-documentmultiple
echos@Joe23232 commented on GitHub (Oct 15, 2020):
I see mate, thanks :)
@Joe23232 commented on GitHub (Oct 27, 2020):
Hi @rusty-snake in your 2nd step, what do I have to edit within
/usr/lib/firejail/firecfg.configforfirefoxas an example? Am I supposed to just addfirefoxto it viaecho firefox >> /usr/lib/firejail/firecfg.config?@rusty-snake commented on GitHub (Oct 27, 2020):
Firecfg will only create symlink for programs listed in firecfg.config. If you want to exclude a program from firecfg, just comment it.
If you want to create symlink only for a few selected programs, remove (or better rename it to something like firecfg.config.orig) it and create a new with only the program you want (one per line). So to make firecfg only create symlinks for firefox and thunderbird, add
firefoxas first line andthunderbirdas second line. No other lines.@Joe23232 commented on GitHub (Oct 27, 2020):
Ah right now I see mate.
@Joe23232 commented on GitHub (Oct 27, 2020):
@rusty-snake
Sorry to bother you again but In regards to another question, I looked at this part of the
firejailarticle https://firejail.wordpress.com/documentation-2/building-custom-profiles/ and like wanted to create awhitelistprofile forfirefoxbut the only directory that is not private is the~/.config/firefox,~/.cache/firefoxand~/Downloadsand to those directories it has full read and write access rights.As stated on the website I have done all those things but I named it as
firefox.config.When I do a
cat firefox.configI get this output:I apologise for my lack of technical skills but what would I need to modify in this file to achieve what I need to achieve?
@rusty-snake commented on GitHub (Oct 27, 2020):
firefox has already a whitelisting-profile, no need to do so.
firefox does not use any of these (unless you patch it and build your own).
If you name a profile not
<binary>.profile, you need to provide a full path to it.If a program has already a profile, it is easier/better to copy it instead of the default.profile. You can the start with whitelisting all path with a
noblacklist. However, the most profiles are whitelisting-profiles if it is possible. And some are opt-in i.e. the have a commented whitelist section that just must be uncommented.@Joe23232 commented on GitHub (Oct 27, 2020):
Oh I am surrpised, I know that chromium based does this for sure so I suppose I want this for chromium based. Maybe as a side note then I want to then experiment/use as an example with
chromiuminstead offirefox.Oh I meant like I copied the file and named it as
firefox.profileand this file is located inside this directory~/.config/firejail.Oh ok that is true mate. So I have done this for
chromiumvia this commandcp /etc/firejail/chromium.profile chromium.profileSorry I am a bit confused, what is the difference between
noblacklistandwhitelist?In the
chromium.profilefile, it has this linewhitelist ${HOME}/.config/chromiumandnoblacklist ${HOME}/.config/chromium?@rusty-snake commented on GitHub (Oct 27, 2020):
noblacklist ${HOME}/.config/chromium: ignore all laterblacklist ${HOME}/.config/chromiumcommands.${HOME}/.config/chromiumis blacklisted in disable-programs.inc and would be inaccessible w/o this.whitelist ${HOME}/.config/chromium: enable whitelisting in ${HOME} and whitelist${HOME}/.config/chromium.@Joe23232 commented on GitHub (Oct 27, 2020):
I see mate I get the
whitelistpart now.If I am understanding this correctly, you mean by default
${HOME}/.config/chromiumwould be disabled through some external profile (viadisable-programs.inc) so statingnoblacklistoverrides the blacklisting stated bydisable-programs.inc?@rusty-snake commented on GitHub (Oct 27, 2020):
Yes. (There is a limitation:
noblacklistworks only for laterblacklistcommands).@Joe23232 commented on GitHub (Oct 27, 2020):
Sorry mate what do you mean by noblacklist works only for later blacklist commands?
@rusty-snake commented on GitHub (Oct 27, 2020):
foobar is not blacklisted
foobar is blacklisted
~/.mozilla is not blacklisted
~/.mozilla is blacklisted
@Joe23232 commented on GitHub (Oct 27, 2020):
Wouldn't it make more sense for it to be blacklisted instead of not being blacklisted? How come it is not blacklisted when the user later specifies he wants it to be blacklisted? Sorry I am just trying to understand a bit better, that is all :)
@rusty-snake commented on GitHub (Oct 27, 2020):
Internal (ignore if you do not understand): firejail applies option when they are read. Undoing a option is not always easy, so a first-will-win semantic is simpler to implement. But there are exceptions, read-only/read-write have a last-will-win semantic.
Usage (here you go): The
<profile-name>.localandglobals.localoverrides are included at the top of profiles. So if you want that your firefox for example can read .config/chromium, you just need to addnoblacklist ${HOME}/.config/chromium(and a whitelist).@Joe23232 commented on GitHub (Oct 28, 2020):
Ah I see. Thanks
Just out of curiosity, if I were to have
noblacklistinside thechromium.profilefile but I did not havewhitelist, the directories would still not be whitelisted, right? Allnoblacklisttells the global file is to simply ignore theblacklist?@rusty-snake commented on GitHub (Oct 28, 2020):
right
@Joe23232 commented on GitHub (Oct 29, 2020):
Thanks.
Sorry I just have one more question.
What is the difference between the these two files
chromium.localandglobals.local?@rusty-snake commented on GitHub (Oct 29, 2020):
chromium.local/<NAME>.profile: override for this profile onlyglobals.local: overrides for all profiles@rusty-snake commented on GitHub (Dec 16, 2020):
I'm closing here due to inactivity, please fell free to request to reopen if you have more questions.
@Joe23232 commented on GitHub (Dec 16, 2020):
Sure mate, thanks
On Thu, Dec 17, 2020 at 5:26 AM rusty-snake notifications@github.com
wrote:
@chaserene commented on GitHub (Aug 24, 2021):
@rusty-snake are all four steps in this comment required to firejail only select apps, or are they four different ways of achieving the same thing? asking because this seems to be madly complicated, and firectl has been deprecated.
an easy way to include/exclude apps from being firejailed would be very much welcome. thank you for your excellent hard work!
@chaserene commented on GitHub (Aug 24, 2021):
also, in the script in first step/option, isn't
firecfg --cleanmissing?@kmk3 commented on GitHub (Aug 24, 2021):
@chaserene commented on Aug 24:
Different ways.
Agreed; see #2097.
@chaserene commented on Aug 24:
I think it's meant to be used instead of
firecfg, as it does the same thing,but only for the programs specified in the
appsarray. So yes, if you hadalready run
firecfgand want to undo it, then first runfirecfg --cleanbefore following that step.