mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #5619] mutt: cannot decrypt ~/.muttrc.gpg #3048
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#3048
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 @hyder365 on GitHub (Jan 25, 2023).
Original GitHub issue: https://github.com/netblue30/firejail/issues/5619
Using firejail 0.9.72 on Arch, the new mutt profile causes a bit of chaos. My setup is slightly abnormal so it may be an edge case not worth fixing, but I'll describe it anyway:
Mutt has no ability to hash the stored passwords. Anything in .muttrc is in cleartext. To get around this, some people have a ~/.muttrc.gpg file that contains the login/config info in a gpg-encrypted form. In the normal ~/.muttrc, I have:
This decrypts the real config on startup, but now fails because of firejail presumably blocking off access to that .gpg file (or gpg itself, but I assume that's allowed since so many people use gpg with mutt). The simplest fix I would propose is allowing read access to ~/.muttrc* rather than just ~/.muttrc. For now I can just whitelist access to that file.
edit: Whitelisting that file isn't enough because mutt can't read the gpg keyring it seems. Adding ~/.gnupg as read-only doesn't work because then temp files can't be made. Adding ~/.gnupg as read-write doesn't work because mutt can't access the smartcard holding the private key. I'll just have to disable firejail for this program for now.
@kmk3 commented on GitHub (Jan 26, 2023):
@hyder365 on Jan 25:
Do you mean that it used to work on 0.9.70?
There was an email-related refactor done in 0.9.72 (#5571), but I don't
remember any changes related to these issues.
mutt.profile allows access to ~/.config/mutt.
Does it work if you store it somewhere like ~/.config/mutt/muttrc.gpg instead?
Note that mutt.profile allows access to ~/.gnupg and
${RUNUSER}/gnupg, so itshould have access to the keyring (unless it's stored somewhere else).
Do you know what is the path to the smartcard device in /dev?
Does adding this to ~/.config/firejail/mutt.local work?
@hyder365 commented on GitHub (Jan 26, 2023):
Thanks for the reply. I'm now trying with the file in ~/.config/mutt/.muttrc.gpg (and ~/.muttrc updated to point here) and a ~/.config/firejail/mutt.profile that has:
But on startup mutt still shows a default config.
Don't know the /dev node for the Nitrokey. I'd be glad to try any other suggestions.
@rusty-snake commented on GitHub (Jan 26, 2023):
The instruction was to add the two lines to
mutt.local. Usingmutt.profile(the way you did) does not work. Can you re-check withmutt.local.@kmk3 commented on GitHub (Jan 26, 2023):
@hyder365 on Jan 26:
In order for the
ignores to work, they have to appear before the commands inquestion, so redirects should always appear last:
Though as @rusty-snake mentioned, unless you actually want to override the
entire default profile, it's easier to just add commands to the .local file
(which is included by the .profile file in /etc).
Try plugging/unplugging it and running
dmesg -Hto see if it says anythingabout the device.
Or doing
ls /devwith it plugged/unplugged and comparing the results.Example:
@hyder365 commented on GitHub (Jan 26, 2023):
Using ~/.config/firejail/mutt.local with only the two ignore lines mentioned above gets further, but now mutt prompts to insert the smartcard corresponding to the key for decryption of the .muttrc.gpg file.
@hyder365 commented on GitHub (Jan 26, 2023):
There's no difference in the /dev list with the device plugged in or unplugged, even after a reboot.
@rusty-snake commented on GitHub (Jan 26, 2023):
What's about stuff deeper in /dev like /dev/input?
@hyder365 commented on GitHub (Jan 26, 2023):
with and without gives me only one line of diff, "189:641"
with and without gives me
@kmk3 commented on GitHub (Jan 27, 2023):
@hyder365 on Jan 26:
Does it work with
firejail --profile=noprofile mutt?noprofile.profile is intended to allow as much as possible (and so is not
secure).
If so, the problem most certainly lies in mutt.profile (rather than in firejail
itself). In which case, a way to debug it is to comment all of mutt.profile
and then uncomment lines until it breaks again. I'd suggest trying that and
then posting the lines causing the issue.
@hyder365 commented on GitHub (Jan 27, 2023):
Yes, works fine with that.
If you have any specific ones you want me to try, I'll be glad to.
Reading the default mutt.profile, I see a comment about "Add the next lines to your mutt.local for oauth.py,S/MIME support." but the options are related to perl and python, neither of which I'm using for anything.
(All of those "mkdir" and "mkfile" lines in mutt.profile are extremely annoying and I have to clean up my home directory after every attempt to debug this. I didn't need any of those files or directories for mutt functionality.)
@kmk3 commented on GitHub (Jan 27, 2023):
@hyder365 on Jan 27:
I don't have a Nitrokey and I don't know how it is accessed, so my best guess
would have been those
ignorecommands.Maybe
stracecould help find which paths it tries to access. Example:Other than that, what is left is brute force: Comment everything and uncomment
chunks of lines until the problem is narrowed down.
Some seem to be completely unnecessary (like the ones related to text editors),
others I'm not sure.
Also, does (/can) mutt itself modify any path other than these?
Are all other paths expected to always be created/modified manually from
outside of mutt, including the configuration files?
Note that if mutt creates a path in the home directory that is not whitelisted,
everything in it will be lost after the sandbox is closed.
@rusty-snake commented on GitHub (Jan 28, 2023):