-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
Connections associated with the wrong application #387
Comments
mm, interesting @raboof , could you reproduce it again with DEBUG log level and post the logs when it occurs? thank you! |
It looks like I'm using the (default?) 'proc' process monitor method. Perhaps that's inherently racy? would ftrace or audit be recommended? |
no, Btw, do you see this behaviour often? Sometimes I've ran into this issue but very rarely. On the other hand what's /nix/store/? nix-store storage location, sandboxed, like snap? |
Cool, staying tuned ;)
I only saw it twice so far
Indeed it's nix's storage location, but it's not sandboxed (other than being in located a somewhat hard to find path ;) ) |
mmh... analyzing the connections of my system using ftrace I'm seeing something weird:
this is a trace reporting that opensnitchd has connected to 127.0.0.1 on port 9054, but that's no possible. What is actually establishing those connections is Tor, not opensnitchd. So maybe there's something that is not behaving correctly. |
Hi @gustavo-iniguez-goya, OS : |
Thank you @NRGLine4Sec , this should be fixed with the new monitor method eBPF. If you can build latest sources from master, I can post the .o eBPF object to ease that compilation step in order for you to test. |
Yes, I saw you merge this new monitor method. |
Should this fix be in the 1.4.0rc1? I've been having the same issue and just upgraded to the RC to test it out. |
not in v1.4.0rc1 @lahdekorpi , but in the next rc release (latest sources from master). By the way, which app is being reported erronously? Would you mind to share what apps do you run as usual? (no problem if you don't want to share them, it's only to try to reproduced the issue locally). |
I've gotten this very randomly on different processes, including kbfsfuse, dropbox, chrome, signal, gnome account, evolution... I haven't figured out if there are any conditions that need to be met for this to happen. |
For me, it comes often with Signal Desktop too and Joplin. |
thank you! so it looks like Signal and kbfs (and chrome probbly) are in used when this occur. For me is when I proxify everything through Tor. I don't think that this will be fixed with eBPF, as I'm using it and from time to time I see this behaviour. |
hey, could you comment out this line, recompile the daemon and see what happens? |
I've found a way of reproducing this problem and I think I've got a fix finally. So the problem is that sometimes the details of an outgoing connection (src port:src IP -> dest IP:dest port) as seen by iptables does not match the results when query the kernel for it via netlink: new connection udp => kernel entries:
We can't validate that the results from the kernel match 1:1 the outgoing connection. However, filtering by the source port we can get the inode and be somewhat confident that the PID corresponds to the connection. There're 4 scenarios where this can occur:
ntpd:
chromium:
The 3rd case can be reproduced by exhausting source ports of the local system, for example by opening (and not closing) 4k connections to port 9999 (or any other port different from 80/443/etc). After a while, a new pop-up will appear asking to allow a connection to that port from a wrong application. Apparently (just guessing) the connection entries remain longer in the SOCK_DIAG subsystem than the actual life of the connection, so when a source port is reused by the system, it may still exist in the SOCK_DIAG subsystem. That said, using eBPF procs monitor method minimized/solves this problem, so I encourange you to use it if you're having this issue. |
One of the steps of PIDs discovering is knowing what's the socket inode of a connection. The first try is to dump the active connections in the kernel, using NETLINK_SOCK_DIAG via netlink. Sometimes when a source port was reused, the kernel could return multiple entries with the same source port, leading us to associate connections with the wrong application. This change fixes this problem, while allowing us to discover other apps. More information: #387 (comment) Note: this problem shouldn't occur using the procs monitor method eBPF.
This issue should be fixed in latest version v1.4.0, with ebpf as process monitor method. |
Hi! Loving opensnitch, looks like the state-of-the-art in Linux Desktop Firewalling!
Describe the bug
I have had 2 occurrences where opensnitch appears to have associated a connection with the wrong application.
Once was yesterday, when opensnitch claimed zoom was connecting to a website that I had open in my browser. Suspicious, but I didn't have time to look into it further at that time.
Today, it claimed
kbfsfuse
was trying to reachupload.wikimedia.org
, which also seems unlikely. I allowed the connection, and verified withnetstat
that indeed it looks like it was Firefox, not kbfsfuse, that was connecting to wikimedia.To Reproduce
I haven't found a way to reproduce this yet. Any suggestions on how to narrow down this problem are appreciated!
Post error logs:
Log of the 'allow:
Checks after that:
OS (please complete the following information):
The text was updated successfully, but these errors were encountered: