mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #2786] private-gnupg? #1744
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#1744
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 @msva on GitHub (Jun 19, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2786
Hi there!
I'm trying to customize my chrome profile to allow the usage of
BroswerPassplugin (integration withpasspassword manager, which, in turn, usesgpg).So, I'd like to create a separate
~/.gnupgdirectory for the chrome (to not share my own with chrome's jail), but I see no way to do that now.The only similar way is using
private=path, but it is incompatible withpsd(profile-sync-daemon, the thing that helps to save SSD from browsers violence), that I am using. So, it looks like not an option.I also tried to
whitelist ~/.gnupg(although, it is definitely not what I want), but still plugin fails to work, complaining on "wrong owner" of ~/.gnupg. :-/So, is it possible to achieve what I want with current directives, or can we implement something like
private-gnupgdirective, working like "private", but for~/.gnupg?@chiraag-nataraj commented on GitHub (Jun 19, 2019):
This is actually the exact reason I decided not to use the browser integration, to be honest — I would have to open up my browser profile way too much.
Right now, I can use
passin a way that it never has access to the internet (except for the occasionalpass git push). With the setup required forpassfforbrowserpassor whatever, you have to open up your browser profile quite a bit.I don't think creating a separate
~/.gnupgdirectory would work. I actually need to use this trick for another piece of software I use (ProtonMail Bridge) and whitelisting~/.gnupgworks just fine (it usespassfor storing credentials), so I'm curious as to why it's breaking on your end. You may have to also usewritable-run-userto ensure thegpg-agentsocket is available (assuming you have asystemdsystem which startsgpg-agentas a service listening in/var/run/gnupgor whatever).@msva commented on GitHub (Jun 19, 2019):
The idea of separate
~/.gnupgwas about to splitting up the key, used to encrypt chrome subdir from another keys, so, if something will escape chrome sandbox (well, actually, not that I trust Google too), it will not have access to all of my case.That is also why I don't want that it had access to gpg-agent that runs outside of firejail...
@rusty-snake commented on GitHub (Jun 20, 2019):
@msva workaround to have a
private-gnupgoption (not testet with chrome + pass; maybe gpg-agent can make problems, but you already say you don't want to use it):firejail --mkdir=${HOME}/.gnupg_chrome --whitelist=${HOME}/.gnupg_chrome --env=GNUPGHOME=${HOME}/.gnupg_chrome chrome@rusty-snake commented on GitHub (Jun 26, 2019):
@msva does that work for you?
@rusty-snake commented on GitHub (Jul 15, 2019):
@msva I'm closing here due to inactivity, please fell free to reopen if you have more questions.
@msva commented on GitHub (Sep 27, 2019):
Sorry for delay in the communication.
Unfortunately, I can't re-ope the issue.
Although, the workaround itself looks fine, it seems, something strange with FJ:
By default, I start chrome as
google-chrome-unstable, which resides in /usr/local/bin and is a symlink to firejail.Also, I doing all the stuff in
~/.config/firejail/google-chrome-unstable.profile. And almost all the things works fine.Although, if I put
(not even GNUPGHOME, just any random variable), and then
firejail --join=chrome_pid, there is NO such variable.But if I run
firejail --profile=~/.config/firejail/google-chrome-unstable.profile sh -c 'echo $VAR'I can see it's value (although, somewhy both"and${HOME}stays there, while they shouldn't, IMHO (I suppose,${HOME}should be interpreted and replaced with proper path, and""should disappear, for not being interpreted as part of variable value)@msva commented on GitHub (Sep 27, 2019):
btw, is it a way for firejail to force exit after "main child" exits?
Say, I run Chrome (or, say, KMail) in FJ, but then
gpg-agentspawns inside the jail, and even when I exit KMail or Chrome, that gpg-agent keeps running and keeps the jail...So, I'd like if there be a way to avoid such orphan jails :-/
@rusty-snake commented on GitHub (Sep 27, 2019):
Related to #2433? Workaround: maybe something like
firejail sh -c "chrome; kill .... Or start gpg-agent by your DE / SessionManager (e.g.systemd --user).@rusty-snake commented on GitHub (Sep 27, 2019):
See #907. @chiraag-nataraj any progress on this?
@msva commented on GitHub (Sep 27, 2019):
Yeah, problem looks a bit similar.
Well, that is what I tried to avoid by symlinking
/usr/local/bin/chrome-binary-nametofirejail... (I mean, "creating additional wrappers").It is. But I don't trust chrome to use that agent (with cached GPG auth), so I don't enable
writable-run-useroption in chrome's profile (so, I guess, that's whygpgcalled in the jail can't see the running agent and spawns new one).@VTimofeenko commented on GitHub (May 16, 2020):
I managed to set up Firefox in firejail+apparmor with browserpass:
Preparation:
${HOME}/.websites-passwords${HOME}/.gnupg_ff/usr/bin/test_gpgwith the following content:(replace
$HOMEhere with the real home)FF Addon configuration:
/usr/bin/test_gpgis set as custom gpg binary and${HOME}/.websites-passwordsas the custom store locationFirejail profile whitelists the two directories
Apparmor allows executables from
/usr/libexec/browserpass-nativeNote on dbus:
If the only available pinentry programs are gnome ones, I believe
ignore nodbusis required in the profile, otherwise the pinentry window would not appear. As an alternative,pinentry-fltkmay be used.