Open unknowndevQwQ opened 1 year ago
Hi @unknowndevQwQ ,
When opensnitch's firewall backend is nft, the table used by nft for xt compatibility is changed, which causes applications using xt to behave abnormally......at least they don't work as expected due to missing xt rules.
Could you expand on what's not working? If you could post a detailed example it would be useful.
What xt rules are missing?
I have no idea how we're interfering in this case. When using nftables
we don't use the nft
binary, we add the rules directly to the kernel. I mention it because in some systems iptables for example points to iptables-nft (lrwxrwxrwx. 1 root root 22 nov 16 2018 /etc/alternatives/iptables -> /usr/sbin/iptables-nft
)
Does it work if you use "Firewall": "nftables"
?
Does it work if you use
"Firewall": "nftables"
?
I've set it up and that didn't solve the problem.
Could you expand on what's not working? If you could post a detailed example it would be useful.
What xt rules are missing?
I have no idea how we're interfering in this case. When using
nftables
we don't use thenft
binary, we add the rules directly to the kernel. I mention it because in some systems iptables for example points to iptables-nft (lrwxrwxrwx. 1 root root 22 nov 16 2018 /etc/alternatives/iptables -> /usr/sbin/iptables-nft
)
First, insert a rule into any chain of the filter and mangle tables of iptables-nft, start opensnitch, and then try to view the filter/mangle table iptables-nft will prompt Table 'filter' contains incompatible base-chains, use the 'nft' tool to list them
.
This causes any tool that uses iptables to no longer be able to write new rules. Existing rules are also rendered useless because of their priority.The rules work, but that prompt from iptables is rather annoying.
Can you change the configuration field "Firewall" to "iptables" and see if it works as expected?
Can you change the configuration field "Firewall" to "iptables" and see if it works as expected?
There are no conflicts with other processes using iptables, but the nfqueue rule added by opensnitch seems to stop matching other rules once it passes?
yes, that is expected. Once we receive an outbound connection via the nfqueue rule, we allow or deny it.
Think of it as any other rule with target DROP / ACCEPT, except that in this case the verdict is applied dynamically based on rules.
yes, that is expected. Once we receive an outbound connection via the nfqueue rule, we allow or deny it.
Think of it as any other rule with target DROP / ACCEPT, except that in this case the verdict is applied dynamically based on rules.
If the traffic will not continue to match the nft/xt rule after accept, I would want opensnitch to have a lower priority, since I am using a transparent proxy tool.
Please, explain in great detail your setup:
Please, explain in great detail your setup:
- name of the transparent proxy tool
cgproxy + qv2ray/v2ray
cgproxy is responsible for configuring iptables rules and putting specific applications into specific cgroup paths for proxying. qv2ray is responsible for configuring v2ray, and v2ray provides proxy capabilities.
My current use case has two v2rays, one controlled by qv2ray and the other v2ray provides the tproxy port and forwards traffic to the v2ray controlled by qv2ray.
- What IPs and ports it makes use of.
By default, cgproxy expects v2ray to listen on the localhost:12345 tproxy port, but both cgproxy and v2ray can be configured for other ports. Export traffic? Depending on the proxy node used, there is no fixed list, and I have never denied any traffic when using opensnitch so far.
- What other applications use the proxy.
cgroup v2 path /user.slice/user-1000.slice
Exclude qv2ary and v2ray.
- is opensnitch filtering connections passing throught the proxy?
Yes, but it will also somehow disconnect after allowing it.
- etc.
v2ray has an unreachable problem when using the kcp protocol. I don't want to 「墙颜欢笑」 anymore.
Describe the bug When opensnitch's firewall backend is nft, the table used by nft for xt compatibility is changed,
which causes applications using xt to behave abnormally......at least they don't work as expected due to missing xt rules.iptables will pass a prompt that nft should be used instead of the iptables management table.Include the following information:
1.5.8
ArchLinux
N/A
Linux arch 6.2.7-zen1-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 18 Mar 2023 01:06:38 +0000 x86_64 GNU/Linux
To Reproduce
Steps to reproduce the behavior:
systemctl enable --now opensnitsh
Expected behavior (optional) opensnitch uses its own tables instead of the default five tables.
Additional context I'm still trying to avoid xtables, but there are a lot of things that still rely on xt. some of the more well-known examples I can come up with include cni-plugins, docker, libvirt, k8s, and a lot of tools I don't recognize. Adding chains unknown to xt to the default table may cause unpredictable behavior in tools that rely on xt.