interception rules changed #995
Replies: 2 comments 2 replies
-
Sure, is there a link to build I could test? |
Beta Was this translation helpful? Give feedback.
-
Great. I installed it and will test :-) But I noticed one issue during the installation. I had to decide between "my" system-fw.json/default-config.json and the updated versions of those rules. I just reset to the updated version ("installed the package maintainer's version"). But in future this type of conflict probably deserves a note in the release notes. Is it save to keep the current config/json files? Or is it recommended to update/reset? Or could there be a better way to migrate settings? |
Beta Was this translation helpful? Give feedback.
-
Interception rules have been changed to address a problem with TCP connections (e090833).
This change may have some side effects, so if you experience any problem, something that has stopped working after this change, please report it so we can fix it or revert this change.
Since the very beginning, we have intercepted outbound connections that looked like responses instead of new outbound connections:
443:1.1.1.1 -> 192.168.1.123:12345
Due to this, we added some mechanisms to solve this problem, because we couldn't obtain the process that originated the connection:
opensnitch/daemon/procmon/ebpf/find.go
Lines 26 to 27 in e090833
[x] Debug invalid connections
option.It turns out that using
ct state NEW
to intercept TCP outbound connections causes undesired effects:We intercept packets that not only have the SYN flag set, but also ACK, ACK+PSH or SYN+ACK. Mainly response packets.
In these cases the IPs are not in the expected order:
443:1.1.1.1 -> 192.168.1.123:12345
which causes not to obtain the process of the connection, because the connection in the system appears as12345:192.168.1.123 -> 1.1.1.1:443
For example:
Sometimes, very rarely, we even intercepted TCP FIN packets as new outbound connections.
Intercepting packets with only the SYN flag set seems to resolve this problem, at the cost of intercepting packets a little bit slower for some already established connections. But on the other hand, we don't display pop-ups with "erroneus" information (response packets as if they were new outbound connections).
This problem was particularly annoying with containerized connections.
For TCP outbound connections we're only interested in new connections for now, i.e., those with only the SYN flag set.
For the rest of connections, we can keep using
ct state new
unless probe otherwise, because it determines the state of the connections and handles many protocols (without it, we wouldn't intercept ICMP for example).https://elixir.bootlin.com/linux/v5.10.19/source/net/netfilter/nf_conntrack_core.c#L1688
https://thermalcircle.de/doku.php?id=blog:linux:connection_tracking_3_state_and_examples#pointer_and_ctinfo
Beta Was this translation helpful? Give feedback.
All reactions