mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2908] Plugins support #1816
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#1816
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 @KOLANICH on GitHub (Aug 13, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2908
I guess we may need some architecture allowing usage of standalone plugins.
Here are some ideas:
0. firejail keeps a cache in a location accessible only by a prjvileged location. this cache is a database with the following tables:
files, containing aninode,pathandhash. There should be a cron job cleaning missing files from the table. Checked and updated on every execution of an executable using fj.yara, containing a yara filename,hashandversionis incremented on every file hash change.plugins, containing a pluginname,yara,hash,version. This table is checked and filled on firejail startup.cachecontainingfile,plugin,plugin_version,cached_diffyarafile. All executions of plugins are hardcorely sandboxed.yarafile .cachefirst; its hash must match thehashincacheand pluginversionincachemust match one inplugins. If there is no cached additions to a profile, then the file is matched against all the registered yara files.@chiraag-nataraj commented on GitHub (Sep 15, 2019):
This honestly sounds like a major vector to introduce bugs and security vulnerabilities.
Why are plugins necessary (or even useful)? Is there a specific use-case you have in mind?
@KOLANICH commented on GitHub (Sep 16, 2019):
@chiraag-nataraj commented on GitHub (Sep 16, 2019):
GUI configuration doesn't really require plugins per se , though. It just requires someone to track
firejail's development and, if necessary, expose certain profile options based on the version of the tool (gotten throughfirejail --version).As for automatic hardening, I'm still not sure I see a usecase for plugins specifically here. We have a separate script in this repo, I believe, to enumerate the syscalls used, and we have
firejail --build. Currently, there are so many nuances with each profile that most of the profile generation can't really be automated...at the very least, someone has to look over it, test it out, see if it breaks a common usecase, and so on.As you can tell, I'm very much against the idea of a plugin architecture given the nature of the tool (for the reasons I mentioned earlier). I'll let other people chime in though, since I don't want to hog the conversation here.
@topimiettinen commented on GitHub (Sep 17, 2019):
@KOLANICH's points could support having some kind of external configuration for
firejail --build,firecfgorfiretoolsUI. I fully agree with @chiraag-nataraj that support forfirejailitself is too risky.But 3rd party plugins as a way for achieving this would only lead to problems. We would need to support some kind of stable API or ABI. We couldn't test if our changes would lead to problems for the 3rd parties somewhere, perhaps closed source. For example, if we later wanted to add sandboxing to plugins or tighten it, there could be delayed complaints or reluctance to implement anything due to possible breakage. I've seen this kind of hesitation for other apps.
Configuration files of Firejail are relatively stable, so external programs should be able to generate profiles or parts of them. This could be made easier if Firejail supported drop-ins like systemd, so for example
firefox.profilecould be enhanced by adding snippets in/etc/firejail/firefox.profile.d/for more static configuration and/var/lib/firejail/firefox.profile.d/for more automatically generated configuration. The generators should not be run by Firejail, butfirecfg,firetoolsor elsewhere, for example during package installation or every run ofapt/rpm, on every boot etc.