mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2748] Wiki: Creating Profiles #1728
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#1728
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 @rusty-snake on GitHub (Jun 5, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2748
Issue for discussions about https://github.com/netblue30/firejail/wiki/Creating-Profiles
@jose1711 commented on GitHub (Jun 5, 2019):
I'd welcome some tips such as using
straceto trace syscalls or touched files/directories, auditing profiles or usingjail_prober.py@rusty-snake commented on GitHub (Jun 5, 2019):
@jose1711 if you can, start writing. 😉
EDIT: We can also add
firejail --traceandfirejail --debugEDIT2: and
firejail --debug-*@jose1711 commented on GitHub (Jun 5, 2019):
i wish i had that knowledge..
@matu3ba commented on GitHub (Jun 21, 2019):
find / -maxdepth 10 \( -type f -or -type d \) -name "$1" -print 2> /dev/nullreturns
/usr/local/as folder where firejail is installed.
For older versions of firejail
/etc/firejail/however might be correct.In
/run/firejail/temporary instance information are stored.[Put this in the beginning or to Home]
Profile Locations/Types explains 3 types of profiles, but lists 4.
The difference of usage is not very clear there.
"system-wide profiles are organized in a consistent manner"
I do not get the purpose of that sentence. Remove and explain better when which profile is used.
Change "Process/Steps for defining your own template (Contribution)" to "Contribute a new profile" or explain the difference between template and profile.
@rusty-snake commented on GitHub (Jun 22, 2019):
@matu3ba if you compile firejail your self (without
./configure --prefix=/usr), firejail is installed under/usr/local, but if you add--prefix=/usrto configure or use a packet from a distro/etc/firejailis correct.@rusty-snake commented on GitHub (Jun 22, 2019):
done
Fixed.
@matu3ba you should can edit the wiki, fell free to directly improve the wiki.
EDIT:
Maybe we should a some examples.
@matu3ba commented on GitHub (Jun 24, 2019):
@rusty-snake Please review my changes.
The language needs rephrasing though.
I did add some examples for my thunderbird adaption.
/usr/share/doc/firejail/profile.template does not exist on my system.
The noblacklist, whitelist behavior needs more explanation.
@rusty-snake commented on GitHub (Jun 24, 2019):
done
@matu3ba looks great.
For me too 😀 .
May we should leave the
firejail/Should be reworked again. Let's find a solution here.
You need FJ 0.9.61 (lastet git)
or newer.The wiki is new, there's a whole lot more to do.
@matu3ba commented on GitHub (Jun 27, 2019):
@rusty-snake
Did rework the whole thing. Please review.
For the test cases (I did not find any): Could you briefly tell, what is to be expected from conflicts?
@rusty-snake commented on GitHub (Jun 27, 2019):
I think the focus of this site should be on profiles therefore
nowhitelist,blacklist-nolog,read-onlyshould be omitted.I rewrite the "Steps for contributing your own profile" section, fell free to suggest anything.
??
@matu3ba commented on GitHub (Jun 27, 2019):
That looks very nice and comprehensive now, but I would like to mention
--auditfor checking big flaws or why was it written in the first place for not using it?read-onlyhad a bug you also commented in #1235 , which is why I wanted to explain and test this.@rusty-snake commented on GitHub (Jun 27, 2019):
if you reverberate to the template, everything that doesn't cause problems should be enabled, I think it might confuse rather. So I would suggest to add it to --debug, --tarce, ... and not as a single point.
than omit nowhitelist, blacklist-nolog and leave a short hint for read-only
@matu3ba commented on GitHub (Jun 27, 2019):
@rusty-snake Please review. Is there anything essential missing?
@rusty-snake commented on GitHub (Jun 27, 2019):
any later blacklist. -> any later
blacklist/whitelist.Common mistakes:
blacklist PATH: PATH is still present, but not accessible (with whitelist they don't exist)noblacklist ~/Documents/presentationsblacklist ~/Documents: didn't work@matu3ba commented on GitHub (Jul 1, 2019):
@rusty-snake Please review.
Did add your stuff. Did add a better explanation of profile precedence.
The template deserves a better place before the explanation.
Do shell commands have any special handling different from the profile?
Can you think of a better name that also mentions that profiles are explained here?
@rusty-snake commented on GitHub (Jul 1, 2019):
You can still run without firejail (
/usr/bin/firefox) and use the commandline (firejail --noprofile firefox,firejail --profile=myprofiel.profile fierfox)fixed in master
a common mistake?
first cmd then recusive the profiles
@rusty-snake commented on GitHub (Jul 1, 2019):
I recommend not to use /etc as it is not relevant and you must be root to edit it.
@SkewedZeppelin commented on GitHub (Jul 1, 2019):
It should be reworded, I think they meant
etcin the git repo.@matu3ba commented on GitHub (Jul 2, 2019):
@rusty-snake @SkewedZeppelin Thanks for the feedback. Included and changed the sections.
Did reorder the whole thing. What do you think of this ?
@matu3ba commented on GitHub (Jul 2, 2019):
I think the phrase "persistent" might be problematic due to dependence on the commands.
Aside the common mistake 1. could be possibly shifted to the General section.
@matu3ba commented on GitHub (Jul 8, 2019):
@rusty-snake @SkewedZeppelin Suggestion for finalization or closing from my side.
@rusty-snake commented on GitHub (Jul 8, 2019):
@matu3ba https://github.com/netblue30/firejail/issues/2729#issuecomment-499022730
@MrFrank17 commented on GitHub (Jul 18, 2020):
Hello,
I am trying to create a profile for the pcloud client (www.pcloud.com) and need some help. If that is the wrong place to ask, please show me right the one :-)
My profile looks like that at the moment:
`protocol unix,inet,inet6,netlink,packet
noblacklist ${PATH}/fusermount
whitelist ${HOME}/.config/pcloud
whitelist ${HOME}/.pcloud
whitelist ${HOME}/.local/share/applications/appimagekit-pcloud.desktop
whitelist ${HOME}/.config/pulse
noblacklist ${HOME}/pCloudDrive
include default.profile`
When starting with
--trace --debugI get a message: execv error: No such file or directory.Also the client offers "drive access" without syncing by mounting the cloud to a local folder by default.
Even when starting with
firejail --noprofile pcloudthis seems not to work.Has anyone created a profile for pcloud so far?
Thanks!
@rusty-snake commented on GitHub (Jul 19, 2020):
Longer threads: open a new issue
Short (2-3 comments): use #1139
From pcloud or firejail?
You can try my noprofile. If the error stays pcloud is likely not firejailable.
noprofile
noprofile.profile@MrFrank17 commented on GitHub (Jul 21, 2020):
Thanks for your quick answer!
Even with your "noprofile" the mapping of the cloud to a local folder does not work. So yes, maybe pcloud is not firejailable. Or at least that functionality as the rest seems to work.
I had to call it without
--trace. With that the application will not come up. It does not give any helpful error message. Is this there more to investigate about that?@MrFrank17 commented on GitHub (Jul 21, 2020):
Another question:
I noticed that the application, which were not closed on logout and are therefore started automatically on login, are not firejailed unless I close and reopen them. Using KDE on Kubuntu 20.04. Is this something to report? If yes, please give me the link.
Thanks!
@rusty-snake commented on GitHub (Jul 23, 2020):
Open a new issues for the KDE thing.
@MrFrank17 commented on GitHub (Jul 23, 2020):
Done!
Last question - sorry for bothering you:
When firejailed applications shall open other applications, (e.g. in KeepassXC clicking on the link of a website to open it in firefox) this is prevented for me. How can this be enabled?
@rusty-snake commented on GitHub (Jul 23, 2020):
Thats still an documentation lack. For now I move you to #3471.
@bbhtt commented on GitHub (Aug 6, 2020):
Is there a better way to audit Linux PS capabilities currently being used by a process other than pscap or getcap or bcc. Maybe include this in the wiki for caps.keep section https://www.andreasch.com/2018/01/13/capabilities/ https://en.wikibooks.org/wiki/Grsecurity/Appendix/Capability_Names_and_Descriptions
@NetSysFire commented on GitHub (Sep 3, 2020):
I would like to rewrite some parts, especially Locations and Types, of this page because they are a bit unclear and should be a bit more simple imo.
Correct me if any of the statements below is wrong or needs improvement.
file types
Every file in a firejail dir (
/etc/firejail,~/.config/firejail) is basically a profile. They all follow the same syntax.However, there are still some different file types:
.profile)curl.profilecurl.profileatom-beta.profile. They usually only containincludestatements.atom-betais very similar toatom, so the same sandboxing settings are used.firefox-common.profile. Some applications have different flavors, like Firefox, and all have some sandboxing settings in common..local)curl.local. Also see this wiki pageglobals.localis a special override file. It will affect every regular profile..inc)include globals.localandinclude $application.localparts of almost every profile but this file type usually contains useful reusable statements, likedisable-common.inc.localfile.allowhandle allowing access to certain paths. e.gallow-ruby.incwill allow access to certain ruby paths, which the application may need for addons/plugins.disable-*includes handle blacklisting paths, like disallowing access to sensible files.whitelist-*includes contain statements necessary for whitelisting profilesfirefox-common-addons.incfile locations
Depending on where you put a file, it might override other files.
Files in
~/.config/firejailhave a higher priority than/etc/firejail, so if/etc/firejail/curl.profileand~/.config/firejail/curl.profileboth exist, firejail uses~/.config/firejail/curl.profile. This applies to every file type mentioned above.@rusty-snake commented on GitHub (Sep 3, 2020):
Thanks for helping with the docs 🥇 🤗 .
file locations
all right
file types
Right, I added these "profile-types" to better explain the differences how profile are used. (🤓 There is one function differences:
include foobar.localdoes not fail, while all others fail if they do not exist. 🤓 )I would split it
all fine
We could split it in whitelist, disable, special (feh-network.inc). However this is overkill IMHO.
@NetSysFire commented on GitHub (Sep 4, 2020):
Just updated my comment to add these improvements
@rusty-snake commented on GitHub (Sep 11, 2020):
LGTM
There is one special: /etc/firejail/firejail.config.
However I don't think we need to talk about every special thing.
We might want to clarify that this is only for blacklisting (by disable-*.inc). If a profile contains
allow-python3.incandprivate-bin foo,barthe python interpret is not available.@Thaodan commented on GitHub (Oct 5, 2020):
Is there a reason that preinstalled profiles go to /etc? Wouldn't it make more sense to ship them in /usr?
@NetSysFire commented on GitHub (Dec 2, 2020):
I would like to add some more info about directives to the page, like this:
includequietPerhaps it would make sense to add a few more columns, like a notes column which contains relevant issues or caveats. We could maybe even link to the source of the directive, but this may be overkill.
Because Firejail has lots of directives it might be better to even use a separate page.
There are of course the manual pages but I did not find any information about override support for specific directives for example.
What do you think about this?
@matu3ba commented on GitHub (Dec 2, 2020):
/etcgradually became the configuration directory./usris for source code and alike, which is why the github dev is placed on/usr.For making things easy, it is just prefixed.
@matu3ba commented on GitHub (Dec 2, 2020):
Graphical stuff is easier to understand, but you dont want to separate the directive from the support check marks (wasting space).
If there is a directive with override support, the command has a name/phrasing.
If not, there does not exist a name/phrasing.
@Thaodan commented on GitHub (Dec 2, 2020):
This not true or at least just half of it. Preinstalled/vendor config should go to /usr now days to be differentiated from system config.
@rusty-snake commented on GitHub (Dec 2, 2020):
No real reason, but it would require code changes and would confuse unskilled users and outdated the most tutorials around the internet,
It would be in large parts a duplication of the man-pages, I don't know if we are doing ourselves good with it.
Since
ignore includeis supported, all command can beignored (except condition?) includingquite. The issue withquiteis that it must be the first command, meaning in the most situations you can't ignore it from locals.@tredondo commented on GitHub (Mar 24, 2021):
Should the content from https://firejail.wordpress.com/documentation-2/building-custom-profiles/ be moved onto the wiki page,
@rusty-snake commented on GitHub (Aug 4, 2021):
https://github.com/netblue30/firejail/discussions/4444