-
Notifications
You must be signed in to change notification settings - Fork 567
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
Should ~/.local/share/ be blacklisted? #504
Comments
I think we can add another profile command, "standard-app" or something, that will whitelist in ~/.config, ~/.cache and ~/.local only the application directory. For example for vlc, it will leave in only ~/.config/vlc, ~/.cache/vlc and ~/.local/vlc. |
Then we'll have problems with folders which aren't named exactly like their programs, like:
But here's a thought I just had. Probably shitty, but "parsing man pages' FILES chapter". |
Let's think about it for a few weeks, we'll figure out something. |
We really should switch to a whitelist-based system, at least for the home directory. Most programs only need access to their config files and |
@chiraag-nataraj I tend to agree but I don't want to cause usability problems, and some programmes probably have a legitimate reason to access somewhat-arbitrary folders -- text editors, for instance. We'd need to take that into account. |
idk...I feel like to some extent, it's largely solved by reorganizing your computer a bit and retraining yourself. I've actually been sandboxing my emacs for a while now, and while it's a bit annoying (I ended up writing a helper script which hard-links a file I want to edit into That being said, I guess we could start switching the more obvious ones first — that is, the ones that don't really need access to more than a small subset of folders. Even if we have a handful of programmes which stick to the current blacklist-based system, switching over the majority to a whitelist-based system would be beneficial, I think. |
Also, we should keep in mind that people can always customize the whitelists to be more expansive e.g. for their text editors. So like, just |
If anyone is still paying attention to this old thread... I've been a user for a few months, and agree that initial difficulty of deployment of firejail would have made me reluctant to continue with it. However, now that I have some familiarity with it, I'd like a whitelist-based option. My suggestion is to add an option in /etc/firejail/firejail.config to blacklist everything, then rely on .local files to clean up the ensuing mess. With a comment in firejail.config telling newbies to not try this until they're familiar enough with writing .profiles and .locals that they can handle the fallout (and to not complain if they can't ;). [By the way, is firejail.config overwritten by future updates of firejail? Some installers would detect this and ask whether to keep the old one or not, but I don't know if they all do, nor whether I'd trust myself to always check the diff and not blindly accept the newer version. Maybe have firejail.config include /etc/firejail/firejail-overrides.config that starts life empty and is never overwritten by new versions of firejail?] I'm tempted to add One reason I'm considering this is because I've made several mistakes when writing new .profiles and .locals (see #3071) that were hard to track down, or even notice - and having blacklist-by-default would have made these much easier to discover. And of course another reason is that I've installed many apps that aren't covered by blacklist entries in default-{programs,common}.inc but which store things in subdirs of ~ that I'd prefer weren't readable by other jailed apps. As for that idea above about using a hardlink when launching emacs - I like it. Of course it only works within the same filesystem. Maybe do a copy/copy-back instead? That would also allow the truly paranoid to do the copy-back by hand only after diffing to check if emacs, with its nearly infinite cleverness and powers, didn't try to sneak |
This is proving to be very difficult (impossible?) to use blacklist/noblacklist/whitelist/read-only combos to do what I want. For example, I tried:
expecting to have everything in ~ blacklisted, except ~/foo/bar, with ~/foo read-only and ~/foo/bar writable. But that wasn't what I got: ~/foo/bar was read-only, even though whitelisted while ~/foo was --read-only'ed, even though the man page says this shouldn't happen. Anyway, these sequences of blacklist/noblacklist/whitelist/read-only are going to be a nightmare to get right. BTW - does the doc somewhere spell out how order-sensitive these options are? It's not in the man page. Also, note this [BTW - this is firejail 0.9.58.2 in debian buster (MX 19)]:
Which makes perfect sense. But it means that one cannot make top-level items in ~ completely invisible to jails (just not readable). Relatedly, if some mischievous jailed app decided to create in ~ some malicious init script that wasn't already there (like .xsession or .xsessionrc), and one hasn't added ...Private homes are the only way to go. What I will do is put a |
You don't need and shouldn't use blacklist when you use whitelist at the same time. In general blacklist is used in profiles to make them work for as many users as possible as it's hard to predict all workflows and use cases. For your own profiles where you know which dirs you need to access I recommend to forget about blacklist completely and use whitelist + readonly instead. Using |
The reason I added that whitelist option was to get this:
from the firejail man page. Which was the only way I could think of to make a parent dir read-only but make a child dir writable. And which didn't work as advertised. Also note the text error "...the whiltelist read-only." should probably be "...the whitelisted child read-only". And, the man page doesn't really say what happens with OK - lesson learned - I should have done But, now I have the --private= scheme working, at least until it doesn't... |
As it is now, we tend to blacklist specific files in .local/share and then noblacklist them in the application profile. For example, in disable-programs.inc, ${HOME}/.local/share/epiphany is blacklisted, and then noblacklisted in epiphany.profile. This seems like a bit of a circular approach to me; and besides, every file in ~/.local/share that's not blacklisted is visible to any programme.
Would it be better to simply blacklist ~/.local/share/ entirely and noblacklist/whitelist the subdirectories as needed? It shouldn't take up too much additional code (it actually might reduce the total amount of code) and could benefit the profiles overall.
Thoughts?
The text was updated successfully, but these errors were encountered: