mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2256] More restrictive profiles when run with --appimage #1508
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#1508
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 @crass on GitHub (Nov 9, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2256
I started thinking about this because I noticed that the firefox profile creates a whitelisted home while the digikam profile does not. At first I was surprised that the digikam profile did not whitelist home, but then considered that collections of photos could be in arbitrary directories of home or
/media. So it does make sense.The logic still applies to digikam's appimages, however there is less trust in the appimage binary because its not downloaded securely or verified normally, as the digikam installed through the package manager would be. So perhaps we don't want to by default be giving appimages access to home or
/media.So I'm thinking that running an appimage should conditionally
disable-mntand whitelisting or making readonly the home directory. Ideally, these directives would be put indisable-common.profile. However, I don't see how that would be done with whitelisting because the directories under home that need to be whitelisted varies depending on the profile. For instance, digikam would want${PICTURES}whitelisted, but amarok would want${MUSIC}. Setting home to readonly would be better, but suffer the same issues with write, eg. digikam wanting to write to its database in${PICTURES}.Am I missing something? Does anyone have an idea on doing this by only changing a few lines in
disable-common.profile? Or does every profile potentially need to be updated? Also what are the thoughts on this proposal? Are there reasons that this shouldn't be done? I don't think it should be a problem, since the user can just add the appropriate--whitelist=...to get access to the needed directories.@netblue30 commented on GitHub (Nov 14, 2018):
I think we need to enhance the conditional support in the profile parser. We already recognize HAS-APPIMAGE:
We need to expand it to handle include command, so we can bring in lots of other commands from a different profile file in case appimage is enabled.
We also need support to negate the condition, something like
@crass commented on GitHub (Nov 18, 2018):
Yep, I agree with those enhancements. However, I don't see how they would solve the issue. Conditional includes are just a convenience and don't allow any more functionality. Negative conditions do add more functionality, but not seeing how that helps here.
I think something like a "convert noblacklist to whitelist" command (or behavior when using --appimage) would do what I want for the digikam case. This seems potentially confusing (would need to be well documented and noted in logs) because
noblacklistwill behave aswhitelist. Perhaps another commandweak_whitelistto be used instead ofnoblacklistin the digikam profile would be better, whereweak_whitelistacts asnoblacklistunless another option, saystrengthen_weak_whitelist, is applied, which would makeweak_whitelistbehave aswhitelist.This feels like the right direction, but still not quite right.
@rusty-snake commented on GitHub (Jun 26, 2019):
@crass you can do in
globals.localthis will break many apps, but if you want you can do this with
sed,awk& Co.profile before:
profile after: