mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1661] fetchmail.profile fails when local delivery to port 25 is needed (netfilter doesn't work) #1122
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#1122
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 @ghost on GitHub (Nov 28, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1661
The command
firejail --net=vnet0 --profile=/etc/firejail/fetchmail.profile fetchmail -v myemailacctresults in a fetchmail error:Some fetchmail configs need to talk to a local SMTP server; others don't, which was perhaps the assumption in the design of
fetchmail.profile. I've tried to fix it by introducingfetchmail.local:and
fetchmail.net:Same error results. Note that there are no current profiles that pass a file argument to the
netfilteroption, so in case it's a misuse in myfetchmail.local, I have also tried including--netfilter=/etc/firejail/fetchmail.neton the CLI, and still fails to connect.Also note that I'm still asked for a password despite whitelisting
${HOME}/.netrc(which is blacklisted in/etc/firejail/disable-common.inc). This seems to suggest that theinclude /etc/firejail/fetchmail.localmay be losing precedence by appearing at the top of thefetchmail.profile.I also confirm that I have a default
firejail.conf(thus restricted-network is no). It's worth pointing out thatvnet0is a tor middlebox in this case (this project). But also note that the tor middlebox is designed to allow local traffic./cc @chiraag-nataraj @SpotComms
@netblue30 commented on GitHub (Dec 2, 2017):
I think you are fighting the network namespace. When you do --net=vnet0, you move fetchmail in a new network namespace with a new loopback interface, and the server on local loopback remains in the regular system namespace. You cannot access the server from the new namespace.
Try without --net=veth0.
@ghost commented on GitHub (Dec 3, 2017):
@netblue30
Thanks, but that makes no difference. I already tested
--net=enp0s25(which is the default network device, and thus presumably the same as omitting the--netoption), and still the netfilter seems to fail to allow local port 25 connections.Also, my ignored whitelisting of
/.netrccould be a clue, because if that's being ignored what else is? Maybe my netfilter is also being ignored.@chiraag-nataraj commented on GitHub (Dec 4, 2017):
No, using the
--netoption always creates a new network namespace regardless of which interface you specify. Try it without using--netat all.@ghost commented on GitHub (Dec 6, 2017):
@chiraag-nataraj
That works. Omitting a net namespace enables traffic from fetchmail to the local SMTP server over port 25. So it confirms what @netblue30 said, but problems remain:
plugin "socat STDIO SOCKS4A:127.0.0.1:%h:%p,socksport=9050"to.fetchmailrcdoes not work because.onionservers do not resolve. Hence the need for a net namespace (which for me is the driver for introducing firejail). How can we poke a hole in the firejail to bridge the LAN with the network namespace, ideally just for port 25?~/.netrcfile is still ultimately blocked by global options, despite whitelisting it in/etc/firejail/fetchmail.local. The only workaround specifically for fetchmail is to embed the passphrases in~/.fetchmailrcinstead, because that can be whitelisted (due to lack of global blacklisting). But that's a hack and only works specifically for fetchmail, not other apps that would have a legit reason to access~/.netrc.If it's deliberate for global options to block whitelists in localized profiles, then perhaps
~/.fetchmailrcshould also be globally blacklisted (as it can contain passwords).BTW, if the netfilter option is useless in combination with the --net= option, then isn't it a defect that firejail even attempts to execute? Shouldn't it terminate with an error?
@smitsohu commented on GitHub (Dec 9, 2017):
regarding your second point:
add
noblacklist ${HOME}/.netrcto fetchmail.local and try it again@ghost commented on GitHub (Dec 9, 2017):
@smitsohu
Thanks, that worked.
@smitsohu commented on GitHub (Dec 11, 2017):
@libBletchley Thanks for pointing this out, it is now fixed on mainline